Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev guideRecipesAPI Reference
Dev guideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev guide

Manage environments

How to manage and run Optimizely Feature Experimentation in isolated environments, like development or staging.

Optimizely Feature Experimentation lets you confirm behavior and run flags in isolated environments, like development or staging. This makes it easier to deploy targeted deliveries and experiments in production safely. For example, you could run a single experiment in some contexts and pause it in others, or you could turn an experiment to test it for your team and leave it off for visitors.

Every Optimizely Feature Experimentation project starts with two environments (and two datafiles):

  • Production – Primary environment.
  • Development – Secondary environment.

Environments have the following attributes:

AttributeGenerationDescription
Environment-specific datafileAutomatically generatedShows the state of the experiments within that environment. If you created flags and experiments in other environments in your project, they appear "not running" until you start them in this environment.
Unique SDK keyAutomatically generatedThis determines the URL of the environment's datafile, which ensures that the URL will not be easily guessed. You can use the SDK key to initialize the SDK with the corresponding environment's datafile.
Datafile access tokenAutomatically generatedIf you create a secure environment, then you can fetch the datafile for that secure environment from an authenticated endpoint using this access token.

For information, see the initialization topic for your SDK language (server-side only).
Environment keyUser-providedThis key is used for programmatic access to the environment: for example, if you were to modify your environments using Optimizely's REST API.

You should also add a Staging environment to your project to use for QA testing before running experiments in your Production environment.

Environment permissions

📘

Note

If your organization migrated to Opti ID, you must manage users in Opti ID. See the
Opti ID user documentation.

You can control which collaborators have permission to start and stop experiments in an environment. This limits the number of people who can change your experiments' statuses or move them from one environment to another.

You should keep access open to everyone in local or development environments and limit access in production environments. By default, the production environment is limited to Publishers and above.

Secure environments

You can choose to secure your environments. When this setting is enabled, you must pass a datafile authentication token when you send requests to the datafile URL via the SDK. This can provide an additional layer of security and privacy to your flag rules (such as A/B tests) on top of the uniqueness and obscurity of the SDK key.

📘

Note

Server-side only

Optimizely Feature Experimentation recommends using this feature only in projects that exclusively use server-side SDKs and implementation. If you fetch the datafiles in a client-side environment, they may become accessible to end users.

Create environments

To create an environment:

  1. Navigate to Settings > Environments.

    Settings > Environment
  2. Click Create New Environment and choose Environment or Secure Environment.

  3. Enter the environment name and key. The key must contain only numbers, letters and underscores. Specify the permission level you want to set for experiments in the environment.

    create secure environment
  4. Click Create Environment.

The SDK Key and Datafile URL for the new environment are displayed on the Settings page.

Secure environments - generate an access token

If you created a secure environment, you need to generate an access token. This token will need to be passed into the SDK to access the datafile. Secure environments are recommended for server-side SDKs only. See Secure environments.

🚧

Important

Once you have made an environment secure, you cannot go back to an unsecured environment.

  1. Click Add access token for the newly created environment.

    Add access token
  2. Add a Token Name for your access token and click Generate Token.

    name access token
  3. Copy the token value from the Settings page. It will not be visible once you leave the page.

🚧

Warning

If you do not copy the token value, you will have to create a new token.

  1. Use the generated token as the access_token parameter when initializing the SDK. Select your SDK for more information:

📘

Note

Experiments are paused by default in any new environments you create, even if they were already running in the default environment.

Convert to a secure environment

You can convert an existing unsecured environment to a secure one from the actions menu. You can tell if an environment is secure by referencing the lock icon on the Settings page.

An unlocked icon indicates a un-secured environment:

unsecured environment

unsecured

A locked icon indicates a secure environment:

secured environment

secured

  1. Click Actions for the environment you want to secure.

  2. Click Secure.

    secure environment
  3. Click Secure on the confirmation screen.

  4. Follow the instructions for Secure environments - generate access token to complete your secure environment.

🚧

Important

Update your SDK implementation

Once you convert to a secure environment you need to update your SDK implementation to initialize with the access token before you can continue to get updates from Optimizely.

(Optional) Remove unsecured datafile

After you have secured your datafile and updated your application to initialize the SDK with the datafile access token created in the previous step, you can manually remove the cached copy of the datafile for your environment from Optimizely's public CDN.

Warning

You MUST complete steps 1 through 4 in Secure environments - generate access token before removing the unsecured datafile. Failure to do so will break your SDK implementation as the SDK will no longer be able to fetch the datafile.

  1. Click Actions for the environment you want to remove the public datafile.

  2. Click Remove Public Datafile.

    Remove public datafile from secure environment
  3. Click Remove on the confirmation screen.

Rename an environment

To rename an environment:

  1. Navigate to Settings > Datafile.

  2. Click Actions for the environment you want to rename.

  3. Click Settings.

  4. Enter the new name for the environment and click Save Environment.

🚧

Important

Be careful changing the datafile's environment key as it will impact the datafile URL your code loads.

The environment key displays on the Settings > Datafile page; see the image in View the datafile via the app.

Archive an environment

You can archive environments if they are not being used anymore (except the primary environment, which cannot be archived). Archiving deactivates all the datafiles in an environment, replacing them with an empty file, and removes the environment as an option for experiments.

If experiments are running in the environment when you archive it, they will stop because archiving empties the datafile.

To archive an environment:

  1. Go to Settings > Datafile.

  2. Click Actions for the environment you want to archive.

  3. Click Archive.

    Archive environment

Results by environment

Each environment will have its own reports page. You can switch between your environments to view results for each. Refer to reports for more information.

reports for each envrionment