Prerequisites
- A Chameleon account (free trial available)
- Your Account Token for installation (found on the Install page)
- Your API Secret for REST API calls (generated in Settings → Tokens)
Your Account Token is embedded in the JavaScript snippet (client-side) and is safe to include in frontend code. Your API Secret is used for REST API authentication (server-side) — keep it secure and never expose it in client-side code.
Step 1: Install Chameleon
Add Chameleon to your application. Visit the Install page in your dashboard to get your personalized snippet and choose your installation method. Installation methods:| Method | Best for |
|---|---|
| npm | React, Vue, Angular, and other SPAs |
| JavaScript | Direct script tag in your HTML |
| Segment | If you use Segment as your CDP |
| Google Tag Manager | If you manage scripts via GTM |
| Freshpaint | If you use Freshpaint as your CDP |
Replace YOUR_ACCOUNT_TOKEN with the token from your Install page. For Segment, GTM, and Freshpaint setup, follow the instructions on the Install page.
Step 2: Identify your users
Once the snippet is installed, identify users so Chameleon can target them with Experiences. Callchmln.identify when the user is known (e.g., after login).
Step 3: Make your first REST API call
Use the REST API to read data from Chameleon. Let’s list your Tours.
Replace YOUR_API_SECRET with your API Secret from Settings → Tokens.
For the full REST API reference, see REST API Overview.
Step 4: Trigger an Experience via API
Use the Deliveries API to trigger a Tour for a specific user on their next page load:Step 5: Set up a webhook
Receive real-time notifications when users interact with your Experiences. Register a webhook endpoint:POST a JSON payload to your endpoint. See Webhooks Overview for payload schemas and verification.

