A comprehensive test site for demonstrating Intercom messenger functionality and features including tours, surveys, events, and JWT authentication.
- User Authentication: JWT-based user authentication with Intercom
- Interactive Tours: Trigger and test Intercom product tours
- Surveys: Launch different types of Intercom surveys
- Event Tracking: Track custom events with metadata
- Help Center Integration: Direct link to Intercom help documentation
- Responsive Design: Mobile-friendly sidebar navigation
- Modal Interfaces: Clean modal dialogs for tour and event configuration
Before you begin, ensure you have:
- A GitHub account
- A Vercel account (free tier available)
- An Intercom workspace with admin access
- Node.js 18.x or higher (for local development)
Before you can deploy to Vercel, you need to get a copy of the code on your computer. Here's how to do it step by step:
- Go to the original repository: Visit https://github.com/cox512/vercel-test-site-traditional
- Fork the repository: Click the "Fork" button in the top-right corner of the page
- Create your fork: GitHub will create a copy under your account (e.g.,
https://github.com/YOUR-USERNAME/vercel-test-site-traditional)
- On Mac: Press
Cmd + Space, type "Terminal", and press Enter - On Windows: Press
Win + R, type "cmd", and press Enter - On Linux: Press
Ctrl + Alt + T
Navigate to your Desktop or Documents folder (or wherever you want to store the project):
cd DesktopOr navigate to Documents folder:
cd DocumentsOr create a new folder for your projects:
mkdir my-projects
cd my-projectsReplace 'YOUR-USERNAME' with your actual GitHub username:
git clone https://github.com/YOUR-USERNAME/vercel-test-site-traditional.gitWhat this does: Downloads a complete copy of the project code to your computer.
Navigate into the project folder that was just created:
cd vercel-test-site-traditionalInstall the required packages (only needed if you plan to run the project locally):
npm installWhat this does: Downloads and installs all the code libraries this project needs to run.
Note: You only need to run npm install if you plan to test the site on your computer before deploying to Vercel. If you're going straight to Vercel deployment, you can skip this step.
After running these commands, you should see a folder called vercel-test-site-traditional on your Desktop (or wherever you chose to clone it). This folder contains all the project files you'll need for deployment.
-
Sign in to Vercel
- Go to vercel.com
- Click the "Log In" button if you aren't already logged into your account
- Click "Continue with GitHub" to sign in with your GitHub account
- Authorize Vercel to access your GitHub repositories when prompted, do not authorize it to access your organizational data if it asks
-
Create a New Project
- Once logged in, click the "New Project" button on your Vercel dashboard
- You'll be taken to the "Import Git Repository" page
-
Import Your Forked Repository
- Find your repository: Look for
vercel-test-site-traditionalin the list of repositories - If you don't see it immediately:
- Use the search bar at the top to search for "vercel-test-site-traditional"
- Make sure you're looking under your GitHub username
- If it's still not visible, click "Adjust GitHub App Permissions" to grant Vercel access to more repositories
- Import the repository: Click the "Import" button next to your forked repository
- Find your repository: Look for
-
Configure Project Settings
- Project Name: Vercel will auto-populate this (you can change it if desired)
- Framework Preset: Vercel should automatically detect "Other" or "Node.js"
- Root Directory: Leave as "./" (default)
- Build Command: Should auto-populate with
npm run build(or leave empty - Vercel will handle it) - Output Directory: Leave empty (Vercel will auto-detect)
- Install Command: Should auto-populate with
npm install
-
Deploy
- Click "Deploy" button
- Vercel will start building and deploying your project
- Wait for the build to complete (usually takes 1-2 minutes)
- You'll get a success message with your deployment URL
Important Note: Your project will deploy but won't function properly until you add the required environment variables (covered in step 3 below).
- Make sure you've completed Step 1 (cloning the repository) first
- You need Node.js installed on your computer (download here if you don't have it)
- Your terminal should be open and you should be in the project directory
Install Vercel's command-line tool globally on your computer:
npm install -g vercelWhat this does: Downloads and installs Vercel's command-line tool so you can deploy from your terminal. The -g flag means "global" - it installs it for your entire computer, not just this project.
If you get permission errors:
- On Mac/Linux: Try
sudo npm install -g vercel(you'll need to enter your password) - On Windows: Run your command prompt as Administrator
Check if Vercel CLI was installed correctly:
vercel --versionWhat this does: Shows the version number of Vercel CLI if it installed correctly. You should see something like Vercel CLI 32.5.0 (numbers may vary).
Start the login process:
vercel loginWhat happens next:
- Vercel will ask you to choose a login method
- Select "Continue with GitHub" (recommended)
- Your web browser will open automatically
- Sign in to your GitHub account if you're not already logged in
- Authorize Vercel to access your GitHub account
- Return to your terminal - you should see a success message
If the browser doesn't open: Copy the URL that appears in your terminal and paste it into your web browser manually.
Make sure you're in the right folder:
cd vercel-test-site-traditionalVerify you're in the right place by listing the files:
lsWhat you should see: You should see files like app.js, package.json, vercel.json, and folders like api/, public/, views/.
Start the deployment process:
vercelWhat happens next - Vercel will ask you several questions:
-
"Set up and deploy [your project path]?"
- Type
yand press Enter
- Type
-
"Which scope do you want to deploy to?"
- Choose your personal account (usually your GitHub username)
- Use arrow keys to select, then press Enter
-
"Link to existing project?"
- Type
n(no) and press Enter (since this is your first deployment)
- Type
-
"What's your project's name?"
- Press Enter to accept the default name, or type a custom name
-
"In which directory is your code located?"
- Type
./and press Enter (this means the current directory)
- Type
What happens during deployment:
- Vercel will upload your files
- Build your project (this may take 1-2 minutes)
- Deploy it to a live URL
- Show you the deployment URL when complete
After deployment completes, you'll see output like:
✅ Production: https://your-project-name.vercel.app [copied to clipboard]
What to do:
- Click the URL or copy and paste it into your web browser
- Your site is now live! (But remember, it won't work properly until you add environment variables)
Unlike the dashboard method, with CLI you need to add environment variables through the Vercel dashboard:
- Go to vercel.com/dashboard
- Find your newly deployed project and click on it
- Click "Settings" → "Environment Variables"
- Add all the required environment variables (see Step 3 in the main guide)
- Redeploy by running the following command in your terminal:
vercel --prodOnce set up, deploying updates is easy:
vercel --prod"Command not found: vercel"
- The CLI didn't install properly
- Try installing again:
npm install -g vercel
- On Mac/Linux, try with sudo:
sudo npm install -g vercel
"Login failed"
- Make sure you have a Vercel account
- Try clearing your browser cache and running the login command again:
vercel login
"Build failed"
- Check that you're in the correct directory:
cd vercel-test-site-traditional - Make sure
package.jsonexists in your current directory - Try installing dependencies first:
npm install
Permission errors
- On Mac/Linux: Add
sudobefore npm commands:sudo npm install -g vercel
- On Windows: Run Command Prompt as Administrator
You'll need to set up the following environment variables in your Vercel project:
| Variable | Description | Where to Find |
|---|---|---|
INTERCOM_APP_ID |
Your Intercom application ID | Intercom Settings → Installation → Web |
INTERCOM_JSON_SECRET |
Secret key for JWT token generation | Intercom Settings → Authentication → Identity Verification |
TRIGGER_TOUR_ID |
Tour ID for the trigger tour button | |
TOUR_LINK |
Tour URL for direct tour links | |
LARGE_SURVEY_ID |
Survey ID for the large survey | |
SMALL_SURVEY_ID |
Survey ID for the small survey | |
SURVEY_LINK |
Survey URL for direct survey links | |
HELP_CENTER_URL |
URL for your Intercom Help Center |
- Go to your Vercel dashboard
- Select your deployed project
- Click on the "Settings" tab in the nav bar that runs across the top of the page
- Click the "Environment Variables" in the left-hand sidebar
- Add each of the variables below with their corresponding value:
INTERCOM_APP_ID=your_app_id_here
INTERCOM_JSON_SECRET=your_secret_key_here
TRIGGER_TOUR_ID=tour_id
TOUR_LINK_ID=tour_id
LARGE_SURVEY_ID=survey_id
SMALL_SURVEY_ID=survey_id
SURVEY_LINK_ID=survey_id
- Click "Save" after adding all the variables
- Redeploy your application to apply the changes
To run the project locally for development:
Create a .env file in the root directory:
touch .envAdd your environment variables to the .env file (repeat for all variables from the table above):
echo "INTERCOM_APP_ID=your_app_id" >> .env
echo "INTERCOM_JSON_SECRET=your_secret_key" >> .env
echo "TRIGGER_TOUR_ID=your_tour_id" >> .env
echo "TOUR_LINK_ID=your_tour_id" >> .env
echo "LARGE_SURVEY_ID=your_survey_id" >> .env
echo "SMALL_SURVEY_ID=your_survey_id" >> .env
echo "SURVEY_LINK_ID=your_survey_id" >> .envStart the development server:
npm run devOpen your browser to: http://localhost:3000
├── api/
│ └── generate-jwt.js # Serverless function for JWT generation
├── public/
│ ├── scripts.js # Client-side JavaScript
│ ├── styles.css # CSS styles
│ └── helpcenter-icon.svg # Help center icon
├── routes/
│ └── index.js # Express routes
├── views/
│ ├── head.ejs # HTML head template
│ ├── landing.ejs # Main landing page
│ ├── messenger-visitor.ejs # Intercom messenger setup
│ ├── new-tab.ejs # New tab test page
│ └── page-two.ejs # Dropdown test page
├── app.js # Express server setup
├── package.json # Dependencies and scripts
└── vercel.json # Vercel configuration
Once deployed, your test site will have:
- Bot Actions: Trigger an Intercom workflow with a button (you will need to set up the "Customer clicks an Element" Workflow and select the "Trigger Workflow" button as the trigger)
- Tours: Start product tours via the 'startTour' JS method or via a tour link
- Surveys: Launch surveys using the 'startSurvey' JS method or via a survey link
- Events: Track custom events with metadata
- Navigation: Links to additional test pages for testing behavior on page change and the opening of new tabs
- Help & Support: Direct access to help center
- Fill in the user details form
- Click "Boot User" to authenticate with Intercom
- JWT tokens are automatically generated and applied
- Use the sidebar buttons to test various Intercom features
- Open modals to configure tours and events with custom parameters
- Update User Custom Data Attributes
JWT not working:
- Verify
INTERCOM_JSON_SECRETis correctly set in Vercel environment variables - Check that JWT is enabled in your Intercom workspace see instructions in the Intercom Help Center if you run into issues.
Tours/Surveys not triggering:
- Ensure the tour/survey IDs are correct and active in your Intercom workspace
404 errors on deployment:
- Check that
vercel.jsonis properly configured - Verify all environment variables are set in Vercel dashboard
If you encounter issues:
- Check the browser console for error messages
- Review Vercel deployment logs
- Verify all environment variables are correctly set
- Ensure your Intercom workspace is properly configured
This project is open source and available under the MIT License.