Feature gating
Gate access to a feature based on the customer’s plan.
Kinde · Const
Entitlements are billing-plan capabilities that describe what a customer is allowed to use. Kinde SDK helpers can read all entitlements, retrieve one by key, or check billing-entitlement membership for a user.
Entitlements represents billing-plan capabilities available to a customer. SDK helpers read entitlement data from Kinde’s Account API so an application can retrieve all entitlements, inspect one by key, or test whether named plan entitlements are present.
result, err := token.GetEntitlements(ctx, accountClient)
entitlement, err := token.GetEntitlement(ctx, accountClient, "seats")
ok, err := token.HasBillingEntitlements(ctx, accountClient, []string{"pro_plan"}, jwt.HasBillingEntitlementsOptions{})const entitlement = await getEntitlement('seats');
if (entitlement.isEntitled) {
enableSeatManagement();
}Read one billing entitlement and enable the related feature when the current user is entitled.
Gate access to a feature based on the customer’s plan.
Show a user which capabilities their current plan provides.
Determine whether a user has one of the required billing plans.
Entitlements describe what a customer may use based on their billing plan. In the Go SDK, GetEntitlements reads the complete set from the Account API, while GetEntitlement retrieves one entitlement by key.
Follow-up: How would you check whether a customer has any of several plans? Use HasBillingEntitlements and pass the plan keys plus its options value.
Use the SDK’s entitlement helper rather than parsing billing data manually. For example, the Go SDK exposes GetEntitlements(ctx, accountClient) and GetEntitlement(ctx, accountClient, "seats").
Follow-up: What data source do these helpers use? They read billing-entitlement data through the Kinde Account API using the user’s access token.
Individual users can access their plan entitlements through the Account API. Organization plan-entitlement information is intentionally excluded because browser-accessible token data is less secure; use the Management API for secure data.
Follow-up: Why is the distinction significant? It prevents sensitive organization billing information from being exposed through a browser-scoped user token.
GetEntitlementsGetEntitlementHasBillingEntitlementsAccount APIManagement APIbilling plansfeatures