The Node SDK provides authoritative access checks for your server. Unlike the React hooks which are for UI gating, these methods should guard any sensitive or billable operation on your backend.
The ArcenClient automates authentication. Which key prefix you set depends on what the client needs to do:
- Access checks (
checkFlag, checkEntitlement, listEntitlements, consumeEntitlement) work with any key type (sk_, rk_, pk_).
- Company/event/payment-link/checkout/session endpoints require a secret
sk_… or restricted rk_… key. Publishable pk_… keys are read-only and rejected on writes.
For most backends, set ARCENPAY_API_KEY to a secret sk_… key so the whole client surface works:
The legacy api_… prefix has been removed from the platform. Regenerate any old keys as sk_…/rk_…/pk_….
See the endpoint auth matrix for the definitive key-per-endpoint guide.
checkFlag
Simple boolean check for a feature flag.
Signature
checkEntitlement
Full entitlement check including usage state and limits.
Signature
Response fields
consumeEntitlement
Decrement a metered entitlement with idempotency protection.
Parameters
Always provide a unique idempotencyKey per logical operation. Reusing keys across different operations will cause incorrect consumption counts. Use keys like scan-{requestId} or export-{jobId}.
Server enforcement pattern
Combine entitlement checks with usage consumption for a complete server-side enforcement pattern:
Error handling