Test mode vs live mode
The platform encodes the environment inside the API key itself.
There is no separate sandbox.* host or --test flag.
Key prefixes
| Prefix | Mode | Where to use |
|---|---|---|
dv_sk_test_… | test | Local dev, CI, integration tests, demos |
dv_sk_live_… | live | Production traffic |
dv_tok_test_… | test | Returned by Sessions.Create when called with a dv_sk_test_… |
dv_tok_live_… | live | Returned when called with a dv_sk_live_… |
The SDK parses the prefix at construction time and exposes the mode:
client, _ := ekyc.NewClient(ekyc.Config{APIKey: "dv_sk_test_..."})
client.Mode // "test"
final sdk = EkycSdk(EkycConfig(/* tokenProvider returns dv_tok_test_... */));
sdk.mode // "test" once the first token is fetched
Behavioral differences
The same endpoints serve both modes, but the platform treats them differently:
- Billing — only live-mode requests are billable.
- Webhooks (when SP3 ships) — test-mode events are delivered to test endpoints you configure separately from live.
- Storage retention — test-mode results are short-lived (typically 7 days) regardless of tenant policy. Live-mode obeys your full retention configuration.
- Rate limits — test-mode has lower per-key rate limits than live.
Mistakes to avoid
- Don't ever log a
dv_sk_*key. Logging frameworks (zap, slog, flutter logging) often capture full HTTP headers. Configure scrubbing. - Don't use a
dv_sk_live_…in dev. Test keys exist precisely so you can iterate without polluting your live data. - Don't accept a
dv_tok_live_…from a client identifying itself as a test build. The SDK exposesmodeso you can guard rails in your app: refuse live tokens on debug builds.