What differs (everything that can move money)
- DOKU mode: production vs
sandbox. Sandbox top-ups use DOKU’s sandbox — no real money ever moves. - Database (users, identities, apps, ledger) is separate.
- JWT secrets, cookie domain (
.sandbox.pid.peridotvault.com), and WebAuthn RP id are separate — a session or passkey from one env never works in the other. - App registrations:
client_id, allowed origins, backend secret, fees, and webhook are per environment.
client_id differs).
There is no per-app environment switch.
Use the sandbox
- Open the sandbox workspace and register your app there (separate
client_id). - Your test build points at the sandbox automatically: the SDK selects the
environment from
NODE_ENV—production→ production, anything else (unset,development,staging,test, …) → sandbox. A staging build that runs withNODE_ENV=productionjust addsenv: 'sandbox': - Top up / send with test flows — DOKU runs in sandbox, so nothing is real.
- When it works, register the same app in production and build with
NODE_ENV=production— same code, production hosts.
Never point a sandbox build at the production API, or a production build at the sandbox. The SDK derives the environment fromFees, the fiat ledger, and webhooks behave identically in both environments; only the DOKU mode and data differ. See Fiat & payments and Apps & workspace.NODE_ENV; if you overridebaseUrl, you own staying on the right environment.