Features

Check feature access and usage for customers

Check

Quick boolean check - use for gating features.

const { data } = await commet.features.check('custom_branding', 'user_123')

if (!data.allowed) {
  redirect('/upgrade')
}

Get

Full details including usage numbers.

const feature = await commet.features.get('team_members', 'user_123')

Can Use

Pre-flight check before adding seats - tells you if they'll be charged extra.

const { data } = await commet.features.canUse('team_members', 'user_123')

if (!data.allowed) {
  return { error: 'Upgrade to add more members' }
}

if (data.willBeCharged) {
  // Show overage confirmation
}

List

const features = await commet.features.list('user_123')

How is this guide?