Skip to content

Authentication

Every SDK requires three identifiers to authenticate with the API:

HeaderFieldDescription
X-PROJECT-IDprojectIdYour project identifier
X-AGENT-IDagentIdThe agent (app/service) identifier
X-ENVIRONMENT-IDenvironmentIdThe environment identifier

These are sent as HTTP headers on every request to the API.

  1. Log in to flags.gg
  2. Navigate to your project
  3. Select the agent and environment
  4. Copy the IDs from the settings panel

Every SDK accepts auth credentials during client initialization:

// Go
client := flags.NewClient(
flags.WithAuth(flags.Auth{
ProjectID: "your-project-id",
AgentID: "your-agent-id",
EnvironmentID: "your-environment-id",
}),
)
# Python
client = new_client(
project_id="your-project-id",
agent_id="your-agent-id",
environment_id="your-environment-id",
)
// React / Next.js
<FlagsProvider options={{
projectId: "your-project-id",
agentId: "your-agent-id",
environmentId: "your-environment-id",
}}>

See individual SDK pages for the complete setup.

  • Credentials identify which flags to serve — they do not grant write access
  • Use different environment IDs for production, staging, and development
  • Never commit credentials to version control; use environment variables or secret managers