Check entitlements
See how the check endpoint is implemented in our Example app ↗.
What is the /check endpoint
The /check
endpoint in the gater entitlement API is used to verify whether a user is currently entitled to a specific feature or resource.
How to use it
The /check
endpoint is useful for enforcing access control in your application.
For example, checking if a user has access to a premium feature or if they still have remaining usage for a consumable entitlement.
The response will include whether the user is entitled, and for consumables, it may also include usage and limit details.
import axios from "axios";
const gater = axios.create({
baseURL: "https://api.gater.dev",
headers: { "X-Api-Key": process.env.GATER_SECRET }, // public key also OK for check requests
});
const response = await gater.get("/check", {
params: { user: "user_123", feature: "app_tokens" },
});
console.log(response.data);
This endpoint is ideal for real-time checks before granting access to protected features or enforcing usage limits in your app.