Docs

Authentication

API key types and how to authenticate requests

Last updated:

API Key Types

SessionSight uses two types of API keys:

Key TypePrefixWhere to UseSecurity
Publicsessionsight_pub_...Client-side (browser)Safe to expose
Secretsessionsight_sec_...Server-side onlyMust stay secret

Public API Key

Used by the Insights and Split Testing SDKs for sending data from the browser. It’s safe to include in client-side code because it can only write session and experiment data to your property.

Secret API Key

Used for server-side operations: goal tracking, feature flag evaluation, and reading data from the API. Never expose this key in client-side code.

Authenticating Requests

Include your API key in the x-api-key header:

bash
curl -X GET "https://api.sessionsight.com/v1/sessions?propertyId=YOUR_PROPERTY_ID" \
  -H "x-api-key: YOUR_SECRET_API_KEY"

Which Key for Which Endpoint

EndpointKey Type
GET /v1/split-testing/configPublic
POST /v1/split-testing/exposePublic
POST /v1/goals/incrementSecret
POST /v1/goals/decrementSecret
POST /v1/flags/evaluateSecret
GET /v1/flags/listSecret
POST /v1/feedback/submitSecret

Managing API Keys

You can create, view, and delete API keys from the API Keys page in the dashboard, or use the API key selector in the navigation bar above to auto-fill keys into code examples.