Migrate a project from the fixed development, staging, and production environments to the environments system, which starts with main and lets you create additional environments. Existing projects keep their original behavior until you opt in.
After migration, the legacy aliases stop working. Update every integration that addresses those aliases as part of the migration.
Migrating without updating your integrations will break your live agent for users. Update every integration that uses the legacy aliases before, or immediately after, you migrate.
Update the chat widget
If you’ve embedded the chat widget on your website, replace your snippet with the new default below (don’t forget to fill in your project’s ID). The new snippet doesn’t include versionID, which means the widget routes each new session according to the traffic split configured in Settings → Environments. For most projects, this is exactly what you want: it automatically respects A/B tests and gradual rollouts.
You can also find your project’s code snippet in the Widget tab.
If you’d rather pin the widget to a specific environment (for example, to load a non-production environment on a staging site), set versionID to that environment’s alias. See our chat widget API documentation for more information.
Update your Agent runtime calls
If you’re calling the Agent runtime directly, update any request that passes environment: 'production' by choose one of these options:
- Updating it to use
environment: 'main'instead. - Using the traffic split feature by migrating to the new start session and interact endpoints. This is a more intensive process than switching the environment to
main, but will give you the ability to A/B test changes prior to release.
For requests that pass 'staging' or 'development', choose whichever option fits best:
- Point them at
'main'to keep using the same default. - Point them at a new environment you create for staging or development work.
Migrate your project
Once your integrations are ready, open Settings → General in your project and scroll to the Danger zone section. Click Migrate next to Migrate to environments to switch your project over.

After you migrate
Your agent keeps serving users from main by default. Now you can:
- Iterate without disturbing live traffic by cloning
maininto a new environment and editing freely. - Split traffic across environments to A/B test a change against
mainon real conversations. - Compare versions side by side and revert, clone, or merge from any point in history.