Skip to main content
This guide shows how to enforce a usage limit on a metered feature, such as “10,000 API calls per month”, using the check, act, track pattern: check the entitlement before the operation, run it, then report the usage. The examples use the Node.js SDK. The same operations are available in every backend SDK and in the REST API.
1

Check the metered entitlement

Pass requestedUsage to verify that the customer can consume the amount the operation needs, not just that they have some usage left.
2

Perform the operation

Run the operation in your application.
3

Report usage or events to Stigg

Report either calculated usage or raw events. Calculated usage is reflected in the next check immediately; raw events are aggregated by the metering pipeline and suit high-volume streams.