Chameleon supports multiple environments so you can build and test Experiences in staging before they reach your production users. This article covers how environments work, how to set up staging correctly, and how to test on localhost.
How environments work in Chameleon
The same Chameleon code snippet works on any domain or subdomain with no additional configuration required. When a domain with the snippet installed generates user activity, it is automatically added to your account's saved domains list.
You can group these domains into Environments from the Domains page in your Dashboard. Environments let you publish Experiences to staging domains separately from production, so you can test without affecting real users.
💡 Install the Chameleon snippet in all your environments — including staging and production. The snippet is invisible to end-users until you explicitly publish an Experience. This saves engineering time and lets you always test a new Experience in staging before going live.
How to set up your staging environment
Install your Chameleon snippet on your staging domain (the same snippet used in production).
Go to Settings > Domains in the Chameleon Dashboard.
Find your staging domain in the list and assign it to a Staging Environment.
When building an Experience, set the target Environment to Staging to publish only to that domain.
⚠️ If you install Chameleon on a domain with a different root domain from your account's email address, it will be automatically disabled. You will need to manually enable it on the Domains page. The same applies to new subdomains added to an already-enabled parent domain.
ℹ️ Subdomains and inheritance: New subdomains inherit the enabled or disabled state of their parent domain. If your production domain is enabled, new subdomains detected under it will also be enabled by default. Check your Domains page if staging subdomains are showing up as active unexpectedly.
How to test on localhost
You can test Chameleon locally before deploying to any server.
Add your Chameleon code snippet to your local development environment.
Reload the page.
⚠️ HTTPS is required: For security reasons, Chameleon only loads on secure HTTPS connections. Your local environment must serve pages over HTTPS.
Three ways to achieve this:
Method | Best for |
mkcert | macOS — creates a trusted local HTTPS certificate |
ngrok | Exposing your locally hosted pages on a public HTTPS domain |
Chrome HTTPS flag | Forcing Chrome to treat a specific local domain as secure (quick testing) |
Chrome cookie settings for localhost: Due to updates in Chrome, you may also need to disable two Chrome flags for local testing to work correctly:
Open
chrome://flagsin Chrome.Search for and disable "SameSite by default cookies".
Search for and disable "Cookies without SameSite must be secure".
ℹ️ Chameleon stores admin authentication in an encrypted, HttpOnly, secure cookie that is only served over HTTPS. This is why the HTTPS requirement exists even for local development.
How to open a specific Experience while testing locally
You can open and test any Experience directly on your local environment without publishing it broadly.
Press Shift three times in quick succession on the page.
An input field will appear. Enter the Experience ID.
Press Enter. The Builder will load that Experience.
Press Escape to exit the dialogue.
💡 To find your Experience ID, read How to find the ID of a Chameleon Experience.
Who can use the Builder across environments
All Admin users on your Chameleon account have access to the Builder on every domain where the snippet is installed. If you want to limit who can build on certain domains, review your account's admin settings.
Still stuck?
If your domain is not appearing in the Domains list, check that the snippet is installed and that a user has loaded the page.
If you can't test Chameleon on localhost, read our article here on troubleshooting localhost issues
If your staging subdomains are showing Experiences to users unexpectedly, check the Domains page and verify that staging subdomains are assigned to the correct Environment or are disabled.
Read Installation verification checklist for a complete setup check.
