- @unkey/api: Manage keys, APIs, and rate limits (server-side, requires root key)
- @unkey/ratelimit: Standalone rate limiting (server-side, requires root key)
Installation
Quick Start
Initialize the client
Verify an API Key
The most common operation, check if a user’s API key is valid:Verification response
Check permissions during verification
Create API Keys
Issue new keys for your users:Update Keys
Modify an existing key’s configuration:Delete Keys
Permanently revoke a key:Rate Limiting
Use@unkey/ratelimit for standalone rate limiting:
Cost-based rate limiting
Expensive operations can consume more of the limit:Error Handling
Use try/catch to handle errors:Resilient verification
For production, handle edge cases:TypeScript Types
The SDK is fully typed. Import types as needed:Framework Guides
Next.js
withUnkey wrapper for API routes
Hono
Middleware for Hono apps
Express Quickstart
Step-by-step Express guide
Bun Quickstart
Step-by-step Bun guide
Full Reference
GitHub
Complete auto-generated API reference