Skip to main content

License check

Check whether a grantee is licensed to perform actions in your system.

Grace Period

If the customer's payment fails, and you would like to give them a grace period to rectify this — you can use the optional grace parameter to extend the license capability check by a specified number of days.

This is not currently supported on @salable/js.

import { getGrantee } from '@salable/js';

const { hasCapability } = await getGrantee({
apiKey: 'your-salable-api-key',
productUuid: 'your-products-uuid',
granteeId: 'your-grantees-id',
});

const isUserLicensedToPerformAction = hasCapability('your-capability-name');