# Sandbox mode (/docs/api/sandbox)

Build and test Rainbow Six Siege integrations against fixed Strave test data with zero quota usage.

The Strave Sandbox API lets you build and test tournament, broadcast,
statistics, and esports integrations without a paid organisation plan and
without using your monthly API quota. Every sandbox route returns fixed
Rainbow Six Siege data that matches the production Public API v2 schemas.

## Base URL and token [#base-url-and-token]

Point your HTTP client or `@strave/sdk` at the sandbox base URL. Sandbox routes
require no private credentials and return `x-strave-sandbox: true` on every
response.

```text
https://strave.gg/api/v2/sandbox
```

When using `@strave/sdk`, set `sandbox: true`:

```ts
import { createStraveClient } from "@strave/sdk";

const strave = createStraveClient({ sandbox: true });
const { data: overview } = await strave.sandbox.overview();
console.log(overview.ids);
```

## Resource IDs [#resource-ids]

The sandbox serves a fixed snapshot of a real Strave match: the final of
`Voltage Series | S7 – EML Secondary Tournament` between Lenovo Legion Honvéd
and Camaron, taken during map 4. Player IDs are Sandbox IDs. The esports routes
still use synthetic data. Use these stable IDs in your tests:

| Resource      | Sandbox ID                       |
| ------------- | -------------------------------- |
| Organisation  | `org_sbx_voltage`                |
| Event         | `event_sbx_eml_s7`               |
| Stage         | `stage_sbx_playoffs`             |
| Group         | `group_sbx_bracket_a`            |
| Live match    | `match_sbx_llh_vs_camaron`       |
| Playday       | `playday_sbx_day_1`              |
| Team          | `team_sbx_llh`                   |
| Esports event | `esports_event_sbx_invitational` |

## Generate signed test webhooks [#generate-signed-test-webhooks]

Call `POST /api/v2/sandbox/webhooks/sample` to generate an HMAC SHA-256 signed
webhook payload and `strave-webhook-*` headers for any public event type.

```bash
curl --request POST https://strave.gg/api/v2/sandbox/webhooks/sample \
  --header "Content-Type: application/json" \
  --data '{ "eventType": "match.result_accepted" }'
```

You can also run a full offline copy of the sandbox on `localhost` with
`bunx @strave/cli mock`.

## Switch to production [#switch-to-production]

Because the sandbox mirrors the production paths and response shapes, switching
an integration to live data only requires replacing `sandbox: true` with an
[OIDC Trusted Workload](/docs/api/guides/oidc-trusted-workloads) credential:

```ts
import { getVercelOidcToken } from "@vercel/oidc";

const strave = createStraveClient({
	oidcWorkload: {
		clientId: process.env.STRAVE_CLIENT_ID!,
		getAssertion: () =>
			getVercelOidcToken({ audience: "https://strave.gg/api/auth" }),
		scopes: ["event:read"],
	},
	installationId: process.env.STRAVE_INSTALLATION_ID,
});
```

## Test 2D replay embeds in Sandbox [#test-2d-replay-embeds-in-sandbox]

Sandbox also mints short-lived viewer sessions for `/embed/replay`. Every
Sandbox session plays all 12 rounds of one recorded map from a real Strave
match, whatever match ID you send. See the
[2D replay viewer guide](/docs/api/embeds/replay-viewer).

## Next steps [#next-steps]

- Stream simulated live score updates with [Live streams](/docs/api/live-streams).
- Embed the 2D viewer with [2D replay viewer](/docs/api/embeds/replay-viewer).
- Run the offline mock server with the [Strave CLI](/docs/api/cli).
- Read [Developer controls](/docs/api/developer-controls) to register an
  organisation Application for production.