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

# Environments

> Development and production Partner API hosts, what is isolated between them, and which URL partners should call.

The Partner API is deployed on Cloudflare as two isolated environments. Partners call the **gateway** only. Domain workers (auth, ingest, consent, read, catalog, projection) are internal and are not public API hosts.

## Base URLs

| Environment | Cloudflare env | Gateway                                                   | Use                                         |
| ----------- | -------------- | --------------------------------------------------------- | ------------------------------------------- |
| Development | `dev`          | `https://swapnice-gateway-dev.ceo-cbc.workers.dev`        | Integration, fixtures, and pilot testing    |
| Production  | `production`   | `https://swapnice-gateway-production.ceo-cbc.workers.dev` | Live consented traffic after go-live review |
| Local       | —              | `http://localhost:8787`                                   | Swapnice-internal Worker development        |

Discovery on any host:

```bash theme={null}
curl https://swapnice-gateway-dev.ceo-cbc.workers.dev/.well-known/oauth-authorization-server
```

The issuer in that document is the gateway origin you called. Custom domains (for example `api.swapnice.com`) can be attached later; until then, use the gateway URLs above.

<Warning>
  Do not send live user traffic to Development. Do not reuse Development `client_id`, `client_secret`, or `APP_REGISTRATION_KEY` in Production.
</Warning>

## What is isolated

Each remote environment has its own Workers, Durable Objects, D1 database, and archive queue.

|                 | Development                                        | Production                    |
| --------------- | -------------------------------------------------- | ----------------------------- |
| Public Worker   | `swapnice-gateway-dev`                             | `swapnice-gateway-production` |
| D1              | `swapnice_api_dev`                                 | `swapnice_api`                |
| Archive queue   | `swapnice-archive-dev`                             | `swapnice-archive`            |
| Durable Objects | on `*-dev` scripts                                 | on `*-production` scripts     |
| Data            | Isolated fixtures and partner-generated test users | Live consented traffic        |
| Credentials     | Separate `client_id` / `client_secret`             | Separate credentials          |

OAuth tokens, consent receipts, events, and profiles created in Development never appear in Production.

## Configure the client

```text theme={null}
# Development
SWAPNICE_API_BASE_URL=https://swapnice-gateway-dev.ceo-cbc.workers.dev
SWAPNICE_ENV=development

# Production
SWAPNICE_API_BASE_URL=https://swapnice-gateway-production.ceo-cbc.workers.dev
SWAPNICE_ENV=production
```

```ts theme={null}
import { SwapniceClient } from "swapnice-sdk-ts";

const swapnice = new SwapniceClient({
  environment: process.env.SWAPNICE_ENV === "production" ? "production" : "development",
  // Or set the gateway explicitly:
  // baseUrl: process.env.SWAPNICE_API_BASE_URL,
  clientId: process.env.SWAPNICE_CLIENT_ID!,
  clientSecret: process.env.SWAPNICE_CLIENT_SECRET!,
  redirectUri: process.env.SWAPNICE_REDIRECT_URI!,
});
```

## Playground and testing

Use Development in the API reference playground and for the [request walkthrough](/partners/request-walkthrough). Production credentials are issued after the [testing checklist](/partners/sandbox) passes.

Next: [sandbox and testing process](/partners/sandbox).
