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.

1

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.

1

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.
1

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.

Danger zone settings with Migrate to environments
Migrate the project after updating integrations to use the new environments.

After you migrate

Your agent keeps serving users from main by default. Now you can:

Use the up and down arrow keys to select a result, Enter to open it, and Escape to close the search.