Skip to main content

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

PrefixModeWhere to use
dv_sk_test_…testLocal dev, CI, integration tests, demos
dv_sk_live_…liveProduction traffic
dv_tok_test_…testReturned by Sessions.Create when called with a dv_sk_test_…
dv_tok_live_…liveReturned 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 exposes mode so you can guard rails in your app: refuse live tokens on debug builds.