API Keys
API keys authenticate your SDK, CLI, and GitHub Action requests to the LaunchGate API.
Creating an API key
- Sign in to the LaunchGate dashboard
- Navigate to Settings → API Keys
- Click Create API Key
- Copy the key immediately — it will only be displayed once
API keys are shown in plaintext only at creation time. After that, only the first 8 characters (key_prefix) are visible. Store your key securely.
Key format
All LaunchGate API keys follow this format:
lg_live_a1b2c3d4e5f6...- Prefix:
lg_live_(live keys) orlg_test_(test keys) - The key is bcrypt-hashed before storage — LaunchGate never stores your key in plaintext
Setting your API key
Environment variable (recommended)
export LAUNCHGATE_API_KEY=lg_live_your_key_hereThe SDK and CLI automatically read from the LAUNCHGATE_API_KEY environment variable.
SDK configuration
const lg = new LaunchGate({
apiKey: "lg_live_your_key_here",
});CLI flag
launchgate run my-suite --api-key lg_live_your_key_here --output "..."Configuration file
Create a .launchgaterc file in your project root or home directory:
.launchgaterc
{
"apiKey": "lg_live_your_key_here",
"baseUrl": "https://api.launchgate.ai"
}Resolution order
The API key is resolved in this priority order:
- Explicit parameter (SDK constructor or CLI
--api-keyflag) LAUNCHGATE_API_KEYenvironment variable.launchgatercfile in current directory.launchgatercfile in home directory
Security best practices
- Never commit API keys to version control
- Use environment variables or secret managers in CI/CD
- Rotate keys periodically in Settings → API Keys
- Use separate keys for development and production environments
- Revoke compromised keys immediately from the dashboard
Last updated on