Authentication
The SDK authenticates using an API key issued from your Decrackle dashboard.
Getting an API key
- Log in at dashboard.decrackle.io
- Go to Settings → API Keys
- Click Create Key and select the appropriate scope
Key prefixes
| Prefix | Scope |
|---|---|
decrackle_sdk_ | Standard SDK access (transcription, denoising) |
decrackle_api_ | Full API access |
decrackle_svc_ | Service-to-service access |
The SDK validates the key format on initialization and throws immediately if the prefix is unrecognised.
Passing the key
Option 1 — Constructor (explicit)
import { Decrackle } from '@decrackle/sdk';
const client = new Decrackle({ apiKey: 'decrackle_sdk_...' });
Option 2 — Environment variable (recommended for production)
Set DECRACKLE_API_KEY in your environment and omit apiKey from the constructor:
export DECRACKLE_API_KEY=decrackle_sdk_...
const client = new Decrackle(); // picks up DECRACKLE_API_KEY automatically
Security guidelines
warning
Never hardcode API keys in source files or commit them to version control.
- Use environment variables or a secrets manager (AWS Secrets Manager, GCP Secret Manager, Vault).
- Rotate keys immediately if they are accidentally exposed.
- Give each service its own key so you can revoke one without affecting others.