Breaking changes — aligns entitlement types and evaluation behavior with
@stigg/node-server-sdk:| Change | Migration |
|---|---|
entitlementsUpdated event payload changed from Map<string, CachedEntitlement> to CustomerEntitlementsResultV2 | Update listeners to iterate .entitlements (an EntitlementV2[] array) instead of a Map. |
EntitlementsState type removed | Replace imports with CustomerEntitlementsResult from @stigg/js-client-sdk. |
resetSettings on MeteredEntitlement removed (was @deprecated) | Use the top-level resetPeriod and usagePeriodEnd fields directly on the entitlement. |
getNumericEntitlement() called on a metered feature now returns a FeatureTypeMismatch fallback instead of granting access | Use getMeteredEntitlement() for metered features. |
isGranted on credit entitlements removed | Use hasAccess — same semantics, aligned with the shared decision model. |
Logger interface second parameter type widened to LoggerExtra (Record<string, any> | Error | Error['stack']) | Widen the second parameter of any custom Logger implementation to accept LoggerExtra. No behavior change needed — type-signature only. |
Entitlement union type now includes EnumEntitlement | Add an EnumEntitlement branch to any exhaustive switch/case on Entitlement. |
CreditEntitlementCurrency named export removed | Use CreditEntitlement['currency'] inline type instead. Shape is unchanged. |
- Added:
billingCycleAnchorproperty when provisioning and updating subscriptions. AcceptsSubscriptionBillingCycleAnchor.UNCHANGED(default) to keep the existing billing cycle anchor, orSubscriptionBillingCycleAnchor.NOWto reset it to the current timestamp.
- Deprecated:
getCreditBalance()(please usegetCreditEntitlement()instead).getCreditEntitlement()reads directly from the SDK’s local cache, significantly reducing latency and removing rate-limit concerns. It returns the same data:currentBalance,totalConsumed,totalGranted, andcurrency.
- Added:
getCreditEntitlement()method for low-latency retrieval of customer credit balance. - Added: Support for provisioning subscriptions with variable recurring credit grant entitlements.
- Enhanced
getCreditEntitlementto return currency information.
- Added: Support for configuring and managing credit auto-recharge settings, including trigger balance, target top-up amount, and monthly spend limit.
- Added support for subscriptions filter by resourceId and plan (planId/displayName).
- Updated SDK to prevent dependency on compromised NPM packages
- Added:
AccessDeniedReason.Revokedfor determining when an entitlement has been explicitly revoked.
- Added:
getSubscriptionsendpoint that allows retrieving all of customers’ subscriptions
- Added: ability to determine the number of attempts that were made to collect payment for a generated invoice when Stigg is integrated with Stripe using the
latestInvoice.attemptCountproperty of thegetActiveSubscriptions()andgetSubscription()endpoints
- Added: support for offline mode
- Added:
GetUsageHistoryV2 - ⚠️ Deprecated:
GetUsageHistory(please useGetUsageHistoryV2instead) - Changed:
- Input Object:
customerRefIdrenamed tocustomerIdresourceRefIdrenamed toresourceIdfeatureRefIdrenamed tofeatureIdresetPeriodremovedyearlyResetPeriodConfigurationremovedmonthlyResetPeriodConfigurationremovedweeklyResetPeriodConfigurationremoved
- Output Object
startDateremovedendDateremovedusageMeasurements[i].daterenamed toseries[0].point[i].timestampusageMeasurements[i].valuerenamed toseries[0].point[i].valueusageMeasurements[i].isResetPointrenamed toseries[0].point[i].isResetPoint- Old Value:
trueif and only if usage was reset due to periodic reset. - New Value:
trueif and only if usage was reset due to periodic reset or due to a plan transition.
- Old Value:
groups[i].groupInfo[j].keyrenamed toseries[i].tags[j].keygroups[i].groupInfo[j].valuerenamed toseries[i].tags[j].valuegroups[i].usageMeasurements[j].daterenamed toseries[i].point[j].timestampgroups[i].usageMeasurements[j].valuerenamed toseries[i].point[j].valuegroups[i].usageMeasurements[j].isResetPointrenamed toseries[i].point[j].isResetPoint- Old Value:
trueif and only if usage was reset due to periodic reset. - New Value:
trueif and only if usage was reset due to periodic reset or due to a plan transition.
- Old Value:
- Input Object:
- Added: ability to override prices when there’s a scheduled update in place
- Added: support for price localization in fixed fee coupons
- Added: ability to estimate the subscription cost when the payment of the subscription is delegated to a different customer using:
PreviewSubscription.payingCustomerIdEstimateSubscription.payingCustomerIdEstimateSubscriptionUpdate.payingCustomerId
- Added: ability to more easily determine the usage period of metered entitlements using:
MeteredEntitlement.usagePeriodStartMeteredEntitlement.usagePeriodEnd
- 🛑 Removed:
MeteredEntitlement.nextResetDate
- Added: ability to get the list of active subscriptions from Edge using
getActiveSubscriptionsList()
- Added: ability to get the details of a specific subscription using
getSubscription()
