TypeScript SDK
Track usage, manage quotas, and enforce rate limits with TypeScript
The Limitry TypeScript SDK provides a simple, type-safe way to integrate usage tracking and quota management into your Node.js and TypeScript applications.
Quick Links
Installation
Install the TypeScript SDK
Quickstart
Track your first event
SDK Reference
Complete API documentation
Common Tasks
Track Events
Send usage data to Limitry
Check Quotas
Enforce usage limits
Analytics
Query usage data
Error Handling
Handle errors gracefully
Quick Start
import { Limitry } from 'limitry';
const client = new Limitry({ apiKey: 'your-api-key' });
// Track usage
await client.track({
customerId: 'cust_123',
event: 'api_call',
value: 1,
});
// Check quota
const result = await client.checkQuota({
customerId: 'cust_123',
quotaId: 'api_calls',
});
if (result.allowed) {
// Proceed with the operation
}Learn the Concepts
New to usage metering? Start with the fundamentals:
- Core Concepts - Understand events, quotas, and rate limits
- Event Types - Types of events you can track
- Quota Dimensions - How quotas are calculated