Skip to main content
API key authentication is the simplest auth type in Corsair. You provide a static credential — an API key, personal access token, or bot token — and Corsair stores it encrypted in your database, then injects it into every request automatically.

How it works

Corsair stores your key using envelope encryption. Your KEK encrypts a per-connection DEK, which encrypts the key itself. The key is never stored in plaintext.
corsair.ts
Store your key once with the CLI:
Every corsair.linear.api.* call will use the stored key automatically.

Solo setup

Solo mode means one API key shared across your entire application. This is the default — no extra configuration needed.
corsair.ts
Store the key:
All API calls use this key:
usage.ts

Multi-tenant setup

In multi-tenant mode, each user supplies their own API key. Keys are stored and encrypted separately per tenant.
corsair.ts
Store each tenant’s key — for example, after collecting it during onboarding:
onboarding.ts
Or via the CLI during development:
Use withTenant to scope all API calls to a specific user:
usage.ts
Each tenant’s key is independently encrypted. Compromising one does not expose others.

Bring Your Own Key

If you manage your own decryption (e.g., AWS KMS or Google Cloud KMS), pass the decrypted key directly instead of using database storage:
corsair.ts
See Authentication for details.