# Go live

Move your integration from the sandbox to live with a live key, a public webhook endpoint, your own sending number and a check of your plan, limits and key handling.

Use this checklist to move an integration that works in the sandbox to live. Your code changes only the key and the base URL; the paths, the SDKs and the responses stay the same.

**Before you begin:** your integration runs against the [sandbox](https://provenanceauth.com/docs/get-started/sandbox.md), you've sent yourself a [test webhook](https://provenanceauth.com/docs/integrate/test-webhooks.md), and, if you send texts, you've checked them with [test texts in the sandbox](https://provenanceauth.com/docs/messaging/test-texts.md).

## 1. Sign up and get a live key

**Sign up** on the site opens the live console. Once your email is verified, the account starts on the Free plan with a live key, bounded by the Free trial's limits; [pricing](https://provenanceauth.com/pricing) lists the plans.

Live keys start `prv_live_`, sandbox keys `prv_test_`, and each reaches only its own environment. Create one key per service under **Developers → API keys**, with only the products that service uses ([scopes](https://provenanceauth.com/docs/get-started/authentication.md#scopes)). A live key's scopes follow the products your account has: a call to a product the account doesn't have answers `403` [`product_not_enabled`](https://provenanceauth.com/docs/platform/errors.md#product_not_enabled).

## 2. Point your code at live

Set `PROVENANCE_API` to the live base URL and `PROVENANCE_KEY` to the live key, from your secret store. Keep the sandbox values for your tests. A sandbox ID used with a live key, or the other way round, answers `403` [`environment_mismatch`](https://provenanceauth.com/docs/platform/errors.md#environment_mismatch).

## 3. Register a public webhook endpoint

In the sandbox an endpoint can be `http://localhost`; in live it must be a public `https` URL. Register it, store its signing secret and verify every delivery's signature, as in [receive webhook events](https://provenanceauth.com/docs/integrate/webhooks.md). The events you can subscribe to are listed in [webhook events](https://provenanceauth.com/docs/reference/webhook-events.md).

## 4. Set up texts, if you send them

Live texts to your customers go from a number registered to your company. Save your business details and follow the carrier review in [your own sending number](https://provenanceauth.com/docs/messaging/sending-numbers.md), and record each person's agreement as in [get consent to text](https://provenanceauth.com/docs/messaging/text-consent.md). Texts start on Pro.

## 5. Check your plan and limits

- [Plans and usage](https://provenanceauth.com/docs/account/plans-and-usage.md): what counts toward your plan, the Free trial's counters, seats and spend caps.
- [Rate limits](https://provenanceauth.com/docs/integrate/rate-limits.md): the same as in the sandbox. Back off on `429` as the `Retry-After` header says.
- [Errors](https://provenanceauth.com/docs/platform/errors.md): branch on `error.code`, and log `request_id` for support.

## 6. Plan for a leaked key

Keep keys out of code, logs and browsers; browsers and apps use a publishable key ([embeds](https://provenanceauth.com/docs/embeds.md)). Know how to [rotate a key](https://provenanceauth.com/docs/get-started/authentication.md#rotate-a-key), and what Provenance does when a key turns up in public: [if a key leaks](https://provenanceauth.com/docs/account/if-a-key-leaks.md).

## Errors you might see

| Code | Status | What it means |
| --- | --- | --- |
| `product_not_enabled` | 403 | The account doesn't have the product this route belongs to. |
| `insufficient_scope` | 403 | The key doesn't carry the product's scope. Create a key for that product. |
| `environment_mismatch` | 403 | A sandbox ID with a live key, or a live ID with a sandbox key. |
| `beta_access_required` | 403 | The operator limits console sign-in to a list of emails, and yours isn't on it. |
| `trial_ended` | 402 | A Free trial counter is used up, or the 30 days have ended. Choose a plan. |
| `service_unavailable_maintenance` | 503 | The API is in maintenance mode. Retry after the `Retry-After` header. |

## See also

- [Sandbox and test keys](https://provenanceauth.com/docs/get-started/sandbox.md)
- [Authentication and API keys](https://provenanceauth.com/docs/get-started/authentication.md)
- [Test webhooks](https://provenanceauth.com/docs/integrate/test-webhooks.md)
- [Test texts in the sandbox](https://provenanceauth.com/docs/messaging/test-texts.md)
