Skip to main content
The @orvlin/node package is the server-side SDK for Node.js. Use it in the request path of your API to check entitlements and report usage.

Install

Create a client

Use the smallest API key role that works. A viewer key can check entitlements. Reporting usage needs a developer key.

Options

Check an entitlement

check returns: To read all of a customer’s entitlements:
To check synchronously from the cache only, use checkCached. It returns null when there is no cached answer yet.

Cache management

Track usage

Pass an array to send several events in one call:
track returns the number accepted and the rejected events, with their index and the reason. Using the same idempotencyKey for retries counts the event once.

Credits

See Prepaid credits for how these fit together.

Errors

Failed calls throw OrvlinError, which has a status property for the HTTP status code when there is one.

Next steps

Usage metering

Design events so the numbers are right.

Errors

What each status code means.