Skip to main content
Flux uses API keys to authenticate requests. You can view and manage your API keys in the dashboard.

API Key Types

TypePrefixUse Case
Livesk_live_Production environment
Testsk_test_Development and testing
Test keys only work with test data and don’t trigger real webhooks or affect production resources.

Using Your API Key

Include your API key in the Authorization header:
curl https://api.flux.dev/v1/events \
  -H "Authorization: Bearer sk_live_your_api_key"
Or use the SDK, which handles authentication automatically:
const flux = new Flux('sk_live_your_api_key');
Keep your API keys secure. Never commit them to version control or expose them in client-side code.

Environment Variables

We recommend storing your API key in an environment variable:
# .env
FLUX_API_KEY=sk_live_your_api_key
import Flux from '@flux/node';
const flux = new Flux(process.env.FLUX_API_KEY);

Key Rotation

To rotate an API key:
  1. Create a new key in the dashboard
  2. Update your application to use the new key
  3. Delete the old key
Create a new key before deleting the old one to avoid downtime.

Scoped Keys

Enterprise plans support scoped API keys with limited permissions:
const scopedKey = await flux.apiKeys.create({
  name: 'Analytics Service',
  scopes: ['events:read'],
  expiresAt: '2025-01-01T00:00:00Z'
});
Available scopes:
ScopeDescription
events:readList and retrieve events
events:writeCreate events
webhooks:readList webhooks
webhooks:writeCreate and delete webhooks

Rate Limits

API requests are rate limited based on your plan:
PlanRequests per second
Free10
Pro100
EnterpriseCustom
When rate limited, you’ll receive a 429 response with a Retry-After header.