# Test mode

Use test mode to build your integration without real viewers and without a bill. Every tenant has test keys from the first minute, with no approval.

Use a `vk_test_`, `rk_test_` or `vpk_test_` key. Objects you create return `"livemode": false` and stay in the test environment. Test and live data never mix.

## What works in test mode

| Area | Test mode behaviour |
|---|---|
| Keys, customers and webhook endpoints | Work as in live mode. Webhooks are delivered to your test endpoints for test events only. |
| Access | Entitlements, checks, sessions, device limits and customer tokens all work. Everything you create is test data. |
| Streams | Calls run on a simulated network that cannot bill. Assets are ready at once. Live streams stay `idle` and take no video. Playback links look real but do not play. |
| Vabu ID | Sign-in routes work with a test publishable key. Test mode never sends a code to a real phone. |
| Event browsing | `GET /v1/events` and `GET /v1/events/{event}` work with a test key. |
| Other products | Routes for booking, orders, organizers, merch and messaging do not take test keys yet. They answer `403 test_mode_unavailable`. See [which credentials each endpoint takes](https://docs.vabu.live/concepts/keys-and-scopes.md#which-credentials-each-endpoint-takes). |

Test mode for payments, with scripted outcomes, and a hosted test stream you can send video to are on [What's coming](https://docs.vabu.live/whats-coming.md).

## A good test run for Streams

1. Create a live stream, grant an entitlement, sign a customer token and open a session. The [quickstart](https://docs.vabu.live/guides/streams/quickstart.md) walks through it.
2. Check what your page does when access is denied, when a second device takes over and when access is revoked.
3. Check that your webhook handler [verifies signatures](https://docs.vabu.live/concepts/webhooks.md#verify-the-signature) and ignores duplicates.
4. To see a real picture, run the same steps with live keys. A live key reaches a real video network.

## Going live

1. Run your whole flow in test mode.
2. Replace `vk_test_` with `vk_live_` in your secret store, and `vpk_test_` with `vpk_live_` in your pages.
3. Make the things that belong to an environment again in live mode: customer token keys, webhook endpoints and any live streams. Create live webhook endpoints and use their new secrets.

Live and test data never mix, so nothing you created in test mode carries over.
