Authentication
PlayVideo uses API keys for authentication. Simple, secure, no OAuth complexity.
Getting Your API Key
- Log in to your PlayVideo dashboard
- Go to API Keys
- Click “Create API Key”
- Copy the key - it’s only shown once!
API Key Format
play_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
play_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
play_live_- Production keys, use in productionplay_test_- Test keys, use in development (coming soon)
Using Your API Key
HTTP Header (Recommended)
curl https://api.playvideo.dev/v1/videos \
-H "Authorization: Bearer play_live_xxx"
SDK Initialization
import PlayVideo from '@playvideo/playvideo-sdk';
// Simple
const bb = new PlayVideo('play_live_xxx');
// From environment variable (recommended)
const bb = new PlayVideo(process.env.BLOCKBUSTER_API_KEY);
Security Best Practices
Never expose API keys in client-side code
// BAD - API key exposed to browsers
const bb = new PlayVideo('play_live_xxx'); // In React component
// GOOD - API key only on server
// pages/api/upload.ts (Next.js API route)
export default async function handler(req, res) {
const bb = new PlayVideo(process.env.BLOCKBUSTER_API_KEY);
// ... handle upload server-side
}
Use environment variables
# .env.local
BLOCKBUSTER_API_KEY=play_live_xxx
// Your code
const bb = new PlayVideo(process.env.BLOCKBUSTER_API_KEY);
Rotate keys periodically
Create a new key, update your applications, then delete the old key.
Use separate keys per environment
play_live_xxx_prod- Productionplay_live_xxx_staging- Stagingplay_live_xxx_dev- Development
Key Permissions
All API keys have full access to your account. Scoped permissions coming soon.
Rate Limits
| Plan | Rate Limit |
|---|---|
| Free | 60 requests/minute |
| Pro | 300 requests/minute |
| Business | 1000 requests/minute |
Rate limit headers are included in responses:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1704067200
Error Responses
Invalid API Key
{
"error": "Invalid API key",
"message": "The provided API key is invalid or has been revoked"
}
Missing API Key
{
"error": "Missing API key",
"message": "Provide API key in Authorization header: Bearer play_live_xxx"
}
Rate Limited
{
"error": "Rate limit exceeded",
"message": "Too many requests. Please retry after 60 seconds"
}
Self-Hosted Authentication
When self-hosting PlayVideo, you manage your own API keys through the admin interface or database directly.
const bb = new PlayVideo({
apiKey: 'your-self-hosted-key',
baseUrl: 'https://video.yourdomain.com'
});