Skip to main content
The SDK authenticates every request to api.deepidv.com with an x-api-key header. This guide covers setup, security, and advanced configurations.
Need a key? Generate one from the API Authentication page. Keys are owned by a user in your organization and carry that user’s permissions.

Basic setup

apiKey is the only required configuration field:
Every HTTP request then automatically includes:

Security best practices

Use environment variables

Never hardcode API keys in source control:

Never log the full key

The SDK automatically redacts API keys in error output. If you need to log which key was used, log the redacted form from AuthenticationError:

Rotate keys

If a key is compromised:
  1. Generate a new API key in the deepidv dashboard.
  2. Update your environment variable.
  3. Revoke the old key.
No code changes are needed — the key is externalized.

Use a key per environment

API key redaction

When an AuthenticationError is thrown, the SDK stores only a redacted version of the key. When serialized with JSON.stringify(), the full key is never included:
This makes it safe to forward SDK errors to Sentry, Datadog, or any error-tracking service. See Error Handling for the full error model.

Custom fetch for proxy / mTLS

To route requests through a proxy or attach mutual-TLS certificates, provide a custom fetch implementation:

Cloudflare Workers service binding

See Configuration for more fetch injection patterns.

Validation

The SDK validates the API key synchronously at construction time, before any network call:
This surfaces configuration mistakes immediately rather than on the first request.