Environments

Every organization gets develop, staging and production. What each one keeps separate, and how to move tests between them.

Every organization has three environments: develop, staging and production. Build a test in develop, check it on staging, then run it on production, without touching live traffic along the way.

What each environment has of its own

  • Tests and flags
  • Events and analytics, so test traffic never shows up in production results
  • API tokens and allowed origins
  • Usage
  • The datafile: /config/:organizationId/:environment
  • A Shopify store connection

What they share

  • Audiences
  • Members and their roles
  • The organization's name and settings

Switching environments

The organization and environment selector in the dashboard navigation decides which environment you are working in. Tests, flags, events and results all follow it.

In your code, set the environment when you set up the SDK:

import { ImproveClientSDK } from '@obelism/improve-sdk/client'

const client = new ImproveClientSDK({
	organizationId: process.env.IMPROVE_ORGANIZATION_ID,
	environment: process.env.IMPROVE_ENVIRONMENT, // 'develop' | 'staging' | 'production'
})

Point each deploy at its own environment, for example develop locally, staging on preview deploys and production on your live site.

Moving tests between environments

  1. On the Tests page, click Sync tests.
  2. Select the tests you want to copy.
  3. Pick the environment to copy them to.

To copy a single test, use Sync on that test's page. Each test keeps its current state. Tests that already exist in the target environment (matched by slug) are listed first, so you can confirm before they are overwritten.

Security

Each environment has its own list of allowed origins for browser requests and its own API tokens for server requests. Manage them on the Organization page. See Improve API.

Keep your production tokens out of develop and staging builds.

On this page