# Sandbox

tiun has two environments: **live** and **sandbox**. Live is the default and serves real customers and real money. Sandbox is an isolated copy you use for development and testing.

***

## What sandbox isolates

Sandbox is a separate slice of tiun — products, customers, sessions, and transactions in sandbox never cross over into live data.

| What           | Live                    | Sandbox                           |
| -------------- | ----------------------- | --------------------------------- |
| Products       | Real catalog            | Test catalog (separate from live) |
| Product IDs    | Prefixed `p-live-...`   | Prefixed `p-test-...`             |
| Customers      | Real users              | Test users only                   |
| Payments       | Real money              | Simulated payments                |
| Dashboard data | Live analytics          | Sandbox analytics                 |
| API base URL   | `https://api.tiun.live` | `https://api-sandbox.tiun.live`   |

Checkout, events, paywall behavior, and access control work the same way in both environments — only the data and payment processing differ.

***

## Enabling sandbox

Sandbox mode has to be enabled in **two places**: the SDK and the dashboard. If only one side is in sandbox, IDs and sessions won't line up.

In the SDK, pass `sandbox: true` when initializing tiun:

```javascript
tiun.init({
  snippetId: 'YOUR_SNIPPET_ID',
  language: 'en',
  sandbox: true,
});
```

In the dashboard, toggle sandbox mode in the sidebar — this switches the dashboard view to your sandbox catalog and customer data.

For a step-by-step walkthrough including first-time domain setup, see the [Set up your environment](/guides/getting-started/setting-up-testing-environment.md) guide.

***

## Going live

Live is the default — if you never set `sandbox: true`, you are already on live. To ship a sandbox integration:

1. Remove `sandbox: true` from `tiun.init` (or set it to `false`).
2. Swap any sandbox product IDs (`p-test-...`) for the matching live IDs (`p-live-...`).

No other code changes are needed; the SDK surface is identical across environments.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tiun.io/reference/generic/sandbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
