> ## Documentation Index
> Fetch the complete documentation index at: https://docs.observerbee.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Live and test environments, selected by API key prefix.

Every Observerbee project has two environments: **live** and **test**. They are fully partitioned end to end: sessions, states, goals, and insights in one environment never mix with the other.

## Selecting an environment

The environment is chosen by the API key you initialize the SDK with:

| Key prefix | Environment | Use for                             |
| ---------- | ----------- | ----------------------------------- |
| `ob_live_` | Live        | Production traffic from real users. |
| `ob_test_` | Test        | Local development, staging, and CI. |

```ts theme={null}
// Staging build
await SessionRecorder.init({ apiKey: 'ob_test_...' });

// Production build
await SessionRecorder.init({ apiKey: 'ob_live_...' });
```

There is no separate environment flag; the key is the switch. Inject the right key through your build's environment configuration.

## Why use the test environment

* Verify your SDK setup, masking rules, and `identify()` calls without polluting production analytics.
* Let developers and staging traffic record freely; none of it will ever appear in live states, journeys, or agent analysis.

## Notes

* Keys are validated server-side together with the page origin, so a leaked key does not let arbitrary sites record into your project. Keep your allowed domains list accurate for both environments.
* Both environments run the same pipeline, so what you see in test (states forming, sessions appearing) behaves the same way live.
