Configure Features
Define capabilities with boolean, metered, and seat feature types in Commet.
Features are reusable building blocks that define the capabilities you sell. Create a feature once and add it to multiple plans with different configurations.
Feature types
| Type | Description | Examples |
|---|---|---|
| Boolean | On/off access to a capability | SSO, Custom Branding, Priority Support |
| Metered | Usage-based with included amounts | API Calls, Storage GB, Emails Sent |
| Seats | Per-user licenses | Editor Seats, Admin Seats, Viewer Seats |
Consumption is defined at the plan level, not the feature level. When you add a feature to a plan, you specify how much is included, whether there's overage, and at what price.
Create features in the dashboard
Go to Features and click Create Feature. Every feature needs a Name (customer-facing) and a Code (internal identifier for the SDK, e.g., api_calls). Feature codes only accept lowercase letters, numbers, and underscores (^[a-z0-9_]+$) and must be unique within your organization.
Metered features also require an Event Code and Unit Name (e.g., "calls", "GB"). Seat features optionally accept a Seat Type (e.g., "Editor", "Admin").
Check feature access
Gate features based on the customer's plan.
const { data } = await commet.features.check({
code: 'custom_branding',
customerId: 'user_123',
})
if (!data.allowed) {
redirect('/upgrade')
}Get feature details
Returns usage numbers, limits, and overage info.
const { data } = await commet.features.get({
code: 'api_calls',
customerId: 'user_123',
})
// data.current — usage this period
// data.included — included in plan
// data.remaining — units left
// data.overage — units over the limit
// data.unlimited — true if no capPre-flight check
Check if a customer can use a feature and whether they'll be charged extra.
const { data } = await commet.features.canUse({
code: 'team_members',
customerId: 'user_123',
})
if (!data.allowed) {
return { error: 'Upgrade to add more members' }
}
if (data.willBeCharged) {
// Show overage confirmation
}List all features
const { data } = await commet.features.list('user_123')Related
- Track Usage — Send usage events for metered features
- Manage Plans — Add features to pricing plans
- Consumption Models — How features behave in each model
- Seat Management — Manage seat-based licenses
How is this guide?