import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const entitlement = await client.v1.addons.entitlements.create('addonId', { entitlements: [{}] });
console.log(entitlement.data);{
"data": [
{
"id": "<string>",
"type": "FEATURE",
"description": "<string>",
"isGranted": true,
"isCustom": true,
"order": 123,
"behavior": "Increment",
"hiddenFromWidgets": [
"PAYWALL"
],
"displayNameOverride": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"featureId": "<string>",
"usageLimit": 123,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"resetPeriod": "YEAR",
"resetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"enumValues": [
"<string>"
],
"customCurrencyId": "<string>",
"amount": 123,
"cadence": "MONTH"
}
]
}Creates one or more entitlements (feature or credit) on a draft addon.
import Stigg from '@stigg/typescript';
const client = new Stigg({
apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});
const entitlement = await client.v1.addons.entitlements.create('addonId', { entitlements: [{}] });
console.log(entitlement.data);{
"data": [
{
"id": "<string>",
"type": "FEATURE",
"description": "<string>",
"isGranted": true,
"isCustom": true,
"order": 123,
"behavior": "Increment",
"hiddenFromWidgets": [
"PAYWALL"
],
"displayNameOverride": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"featureId": "<string>",
"usageLimit": 123,
"hasUnlimitedUsage": true,
"hasSoftLimit": true,
"resetPeriod": "YEAR",
"resetPeriodConfiguration": {
"accordingTo": "SubscriptionStart"
},
"enumValues": [
"<string>"
],
"customCurrencyId": "<string>",
"amount": 123,
"cadence": "MONTH"
}
]
}Server API Key
Server API Key
The addon ID
255Request to create one or more entitlements on an addon
Entitlements to create
1Show child attributes
The newly created addon entitlement objects.
Response object
Show child attributes