Skip to main content

API Key Authentication

BrowserTest SDK uses API key authentication for all requests. You need a valid API key to use any SDK features.

Getting Your API Key

  1. Visit BrowserTest Dashboard
  2. Sign up or log in to your account
  3. Navigate to the API Keys section
  4. Generate a new API key
Keep your API key secure! Never commit it to version control or share it publicly.

Initializing the SDK

Environment Variables

Always use environment variables for API keys:

Configuration Options

Testing Authentication

Error Handling

The SDK throws specific errors for authentication issues:

Rate Limits & Quotas

Each API key has associated quotas based on your plan:
  • Starter: 1,000 screenshots/month, 100 agentic tests/month
  • Pro: 10,000 screenshots/month, 500 agentic tests/month
  • Enterprise: Custom limits

Checking Usage

API Key Security Best Practices

  1. Never commit API keys to version control
  2. Use environment variables in production
  3. Rotate keys regularly for security
  4. Use different keys for different environments (dev/staging/prod)
  5. Monitor usage to detect unauthorized access

Multiple Environments