Overview
Vouch uses API keys for authentication. Every request must include:- Authorization header with your API key
- X-Project-Id header with your project ID
API Key Types
Vouch provides two types of API keys, each with different use cases and security characteristics:Client Keys
For browser and mobile apps
- Restricted to allowed domains
- 1,000 requests/hour
- Safe to expose in client code
- Automatic device fingerprinting
- Cannot override IP/User-Agent
Server Keys
For backend services
- No domain restrictions
- 5,000 requests/hour
- Must be kept secret
- Can override IP/User-Agent
- Blocked from browsers
Test vs Live Environments
Each project gets 4 API keys:| Environment | Key Type | Purpose |
|---|---|---|
| Test | Client | Development in browsers |
| Test | Server | Development on servers |
| Live | Client | Production in browsers |
| Live | Server | Production on servers |
Test keys don’t count against your monthly quota. Use them during development.
Security Features
Server Key Browser Protection
Server keys are automatically blocked when used from browsers to prevent accidental exposure. Detection happens via:Originheader presenceRefererheader presenceUser-Agentindicating browser
Client Key Domain Validation
Client keys are validated against your allowed domains list. Configure allowed domains in your dashboard: Allowed Domain Patterns:example.com- Exact match*.example.com- Wildcard subdomainlocalhost:3000- Development domains
Authentication Examples
- JavaScript (Client)
- Node.js (Server)
- cURL
- Python
Managing API Keys
Finding Your Keys
- Go to vouch.expert/dashboard
- Select your project
- Navigate to Settings → API Keys
- Copy the appropriate key for your environment
Regenerating Keys
If a key is compromised:- Navigate to API Keys in your project settings
- Click Regenerate next to the compromised key
- Update your application with the new key
- Old key is immediately invalidated
Best Practices
Never commit API keys to version control
Never commit API keys to version control
Use environment variables instead:
Use test keys during development
Use test keys during development
Test keys don’t count against quota:
Rotate keys periodically
Rotate keys periodically
For security, rotate API keys every 90 days:
- Generate new key
- Deploy with new key
- Verify everything works
- Delete old key
Use client keys in browsers
Use client keys in browsers
Never use server keys in client-side code:
Restrict client key domains
Restrict client key domains
Configure allowed domains to prevent unauthorized use:
- Add
localhost:*for development - Add your production domains
- Use wildcards carefully (
*.example.com)