GrowthRailDocs

Credentials Overview

CredentialPrefixHeaderWhere to use
Project Secretsk_X-GrowthRail-ProjectSecretClient-side SDK only (@growth-rail/react, @growth-rail/core)
API KeyServer-to-server (Public REST API)Authorization: Bearergrak_

Project Secret

The Project Secret is a publishable key that identifies your project from the client. Pass it during SDK initialization and the SDK attaches it to every request via the X-GrowthRail-ProjectSecret header.

X-GrowthRail-ProjectSecret: sk_a1b2c3d4e5f6g7h8...

Because it ships inside your client bundle, the Project Secret is not a private credential. Instead, Growth Rail validates the Origin header against your project's Allowed Origins list. Requests from unlisted domains are rejected with 401 Unauthorized.

Safe to ship: The Project Secret is meant to live in client-side code. Lock down which sites can use it by keeping your Allowed Origins list tight. For private, server-to-server access, use an API Key instead.

API Keys

API Keys (prefixed grak_) are used for server-to-server REST API calls. Create and manage them in the dashboard under Organisation → API Keys. Include the key in the Authorization header using the Bearer scheme.

Authorization: Bearer grak_your_api_key_here

Generate and manage API keys in the dashboard under Organisation Settings. You can create keys with custom expiry (30 days, 90 days, 1 year, no expiry, or custom date) and revoke them at any time.

Never expose API keys in client-side code. API keys are for server-to-server use only. Keep them in environment variables on your backend.