Getting Started

Authentication

Every SDK request is authenticated using an API key pair (clientId + secret). Keys are scoped to a specific project and environment.

API Key Pair

Each API key consists of two parts:

FieldFormatDescription
clientIdpk_live_xxxPublic identifier. Safe to embed in client-side code.
secretsk_live_xxxPrivate secret. Keep server-side only when possible.

Authentication Methods

The SDK supports two authentication methods. Both are handled automatically by the SDK — you just provide credentials during initialization.

Method 1: Bearer Token (Recommended)

Combines both credentials into a single Authorization header.

http
Authorization: Bearer <clientId>:<secret>

# Example:
Authorization: Bearer pk_live_abc123:sk_live_xyz789

Method 2: Separate Headers

Pass credentials as two individual headers. Useful for proxies or API gateways.

http
X-Client-ID: pk_live_abc123
X-Client-Secret: sk_live_xyz789

Scopes & Permissions

API keys are scoped to control what the SDK can access. Scopes are configured when creating the key in the dashboard.

ScopeGrants Access To
flags:readFetch flag definitions and evaluate flags
configs:readFetch remote configuration values
logs:writeIngest log events and error reports
adminFull access (all scopes). Use with caution.

Rate Limiting

Every API key is subject to rate limiting. The SDK handles rate-limit responses automatically by using locally cached data.

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRemaining requests in current window
X-RateLimit-ResetUnix timestamp when the window resets
Retry-AfterSeconds to wait before retrying (only on 429)

Security Features

Origin Allow-List

Restrict which domains can use this API key. Requests from unlisted origins receive a 403.

IP Allow-List

Restrict which IP addresses can use this API key. Ideal for server-side SDKs.

Key Revocation

Instantly revoke a key from the dashboard. Revoked keys return 410 Gone.

Audit Trail

Every key validation is logged. Track which keys are used and from where.