Search docs…⌘K
Dashboard →
Getting Started
Environments
Organize your API targets and API keys using environment labels.

Overview

Relay supports three environment types: development, staging, and production. When you create an API target or an API key, you must assign it to one of these environments.

Currently, environments act primarily as metadata labels to help you organize your resources. You can filter resources by environment in the dashboard to clearly distinguish your production keys from your development keys.

API Keys and Environments

The environment field is required when generating a new API key. The prefix of the raw key generated reflects the environment to help you quickly identify it in your source code:

  • production generates keys starting with relay_live_
  • staging generates keys starting with relay_test_
  • development generates keys starting with relay_dev_

Routing and Enforcement

While environments help you organize keys, the Relay Gateway does not currently enforce strict routing isolations between environments out-of-the-box (e.g. automatically blocking a relay_test_ key from hitting a production API target). However, you can use these labels to manage separate API targets (e.g. my-api-prod vs my-api-dev) and issue the appropriately labeled keys for each.