Installation
NPM
Yarn
PNPM
Requirements
- Node.js 18.0.0 or higher
- Next.js 13.0.0 or higher
Basic Setup
Import and initialize the SDK:Configuration Options
The SDK accepts the following configuration options:Your Limitly API key. You can find this in your Limitly dashboard.
The base URL for the Limitly API. Defaults to
https://api.limitly.dev
.Request timeout in milliseconds. Defaults to 30000 (30 seconds).
Example Configuration
Next.js Specific Features
The Next.js SDK includes additional features optimized for Next.js applications:- Middleware Support: Built-in middleware for API routes
- Server-Side Optimization: Optimized for server-side rendering
- TypeScript Support: Full TypeScript support with proper types
- Error Handling: Enhanced error handling for Next.js environments
Next Steps
- Authentication - Learn how to authenticate with the API
- Request Validation - Validate user requests
- Middleware - Use built-in middleware for API routes
- API Key Management - Manage API keys for your users