Skip to main content
The SDK supports two built-in environments and an optional custom URL override.

Environment URLs

Custom URL

Override the built-in URL by passing customUrl. This is useful for local development or self-hosted API instances:
When customUrl is set, it takes priority over the environment’s default URL. The environment field is still required — it controls sandbox-only behavior regardless of the URL.

Environment utilities

The SDK exports helper functions for environment checks:

Sandbox-only restrictions

Some SDK operations are restricted to the sandbox environment using the @SandboxOnly decorator. If you call a sandbox-only method with environment: 'production', the SDK returns an EnvironmentViolationError in the Result without making a network request.

How it works

The @SandboxOnly decorator (and its function equivalent sandboxOnlyFn) checks the environment field on the client config before executing the method:
  • If environment === 'sandbox' — the method runs normally
  • If environment === 'production' — an EnvironmentViolationError is returned (for async methods) or thrown (for sync methods)
This prevents test operations from accidentally running against production data.
For the full error type reference, see Error Handling.