Skip to content

Authentication ​

Secure your API requests with API keys.

API Keys ​

Generate API keys in your dashboard under Settings → API Keys.

Key Types ​

TypeUse Case
ServerBackend services (full access)
ClientFrontend apps (read-only)

Using API Keys ​

Include your key in the Authorization header:

bash
curl -X GET https://api.experimentplus.io/v1/flags \
  -H "Authorization: Bearer sk_live_abc123..."

Key Prefixes ​

PrefixEnvironment
sk_live_Production server key
sk_test_Test server key
pk_live_Production client key
pk_test_Test client key

Security Best Practices ​

WARNING

Never expose server keys in client-side code!

  1. Use environment variables
  2. Rotate keys regularly
  3. Use test keys during development
  4. Monitor key usage in dashboard

SDK Authentication ​

typescript
// Server-side (Node.js)
const client = new ExperimentPlus({
  apiKey: process.env.EXPERIMENT_PLUS_SERVER_KEY
})

// Client-side (Browser)
const client = new ExperimentPlus({
  apiKey: 'pk_live_...' // Client key only
})

Built with VitePress