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

# Sandbox testing

> Test widget embeds with sandbox API clients and widgets before production.

Use the **sandbox environment** to develop and QA widget embeds without affecting live review data.

## Sandbox credentials

Create a sandbox API client in **Integrations → API Clients** with environment set to **Sandbox**.

| Credential      | Sandbox format |
| --------------- | -------------- |
| Publishable key | `pk_test_*`    |
| Secret key      | `sk_test_*`    |

Sandbox clients return mock review data from the EthioReview API — no production reviews are exposed.

## Sandbox widgets

Create widgets with environment **Sandbox** in **Integrations → Widgets**.

Rules:

* `pk_test_*` only resolves sandbox widgets
* `pk_live_*` only resolves production widgets
* Mixing keys and widget environments returns `403 Forbidden`

## Local development

1. Create a sandbox API client
2. Add `http://localhost:3000` (and your dev port) to **allowedOrigins**
3. Create a sandbox widget and copy `widgetId`
4. Embed with sandbox credentials:

```tsx theme={null}
<ReviewWidget
  baseUrl="https://api.ethioreview.com"
  publicKey="pk_test_YOUR_KEY"
  widgetId="YOUR_SANDBOX_WIDGET_ID"
/>
```

## Environment variables

```bash theme={null}
VITE_ETHIOREVIEW_API_URL=https://api.ethioreview.com
VITE_ETHIOREVIEW_PUBLIC_KEY=pk_test_YOUR_KEY
VITE_ETHIOREVIEW_WIDGET_ID=YOUR_SANDBOX_WIDGET_ID
```

```tsx theme={null}
import { createReviewWidgetConfig, ReviewWidget } from "@ethioreview/review-widget-react";

const config = createReviewWidgetConfig({
  baseUrl: import.meta.env.VITE_ETHIOREVIEW_API_URL,
  publicKey: import.meta.env.VITE_ETHIOREVIEW_PUBLIC_KEY,
  widgetId: import.meta.env.VITE_ETHIOREVIEW_WIDGET_ID,
});

<ReviewWidget {...config} />
```

## Go live

1. Create a production API client (`pk_live_*`)
2. Add production domains to **allowedOrigins**
3. Create production widgets or clone sandbox config
4. Swap env vars to `pk_live_*` and production `widgetId`
5. Remove sandbox keys from production builds

[Credentials →](/integrations/widget/credentials) · [Widget registry →](/integrations/widget/registry)
