This guide is for direct JavaScript/TypeScript integration. If you’re using one of our supported frameworks, we recommend using their dedicated SDKs instead:
- Next.js SDK - For Next.js applications
- React SDK - For React applications
- Express SDK - For Express.js applications
Installation
Terminal
Initialization
1
Set the Atlas API key in the environment variables
You can get it from the Atlas Dashboard.
.env
2
Create the Atlas Client
To initialize the Atlas SDK, you need to instantiate the Atlas Client with your API key:
src/atlas/client.ts
Core Features
The Atlas JavaScript client provides several methods to interact with Atlas services:Feature Management
Register Features
Register features that your application uses:Check Feature Access
Check if a customer has access to specific features:Customer Management
Get Customer Features
Retrieve all features a customer may have access to:Get Customer Details
Get detailed information about a customer:Pricing Model
Get information about your pricing model:Setting up limit-based features
When initializing the Atlas client, you can configure a limit callback for a feature. This callback will be called when a limit-based feature is checked. The callback should return the number of usages for the feature. For example:src/atlas/client.ts