Skip to main content
ArcenPay resolves access from the commercial state you manage in the dashboard: active plans, add-ons, overrides, and usage-aware entitlement rules. Rather than hardcoding plan logic in your application, you read the resolved answer from the SDK. This means your access control stays in sync with plan changes automatically, without a code deploy.

Entitlements vs. feature flags

Feature flags are boolean on/off access checks tied to a feature key. A flag answers a single question: does this company currently have access to this feature? Entitlements carry richer state — they include the enabled status, remaining usage quota, and other metadata associated with a feature on the active plan. Use entitlements when you need to show usage limits or enforce metered consumption.

How access is resolved

ArcenPay evaluates access in the following order:
  1. Company-specific overrides are checked first.
  2. Active subscription plan entitlements are applied next.
  3. Purchased add-ons and one-time grants are merged in.
  4. Optional usage rules or traits can further refine the final result.
Your application always receives the final resolved answer — you do not need to replicate this logic.

Checking access in React

The React SDK provides hooks for reading flags and entitlements inside your components.
A typical gating pattern in a component:
React hooks reflect the customer’s current session state. They are suitable for UI gating but should not be used as the sole guard on sensitive or billable server operations.

Consuming entitlements in React

Call consume() when the customer performs an action that should decrement a usage-based entitlement:

Tracking metered usage in React

Use useTrack to emit a usage event without directly consuming an entitlement counter:

Checking access on the server

Use the Node SDK to enforce access in your API routes and backend handlers. Server-side checks are authoritative and should guard any operation that is sensitive, billable, or has side effects.

Consuming entitlements on the server

When a billable operation completes on the server, consume the entitlement with an idempotency key to prevent double-counting:
Always provide a unique idempotencyKey per logical operation. This ensures that retries or duplicate requests do not consume additional quota.

Using FeatureFlagGuard

The React SDK exports a FeatureFlagGuard component that conditionally renders children based on a flag:

Next steps

  • Subscriptions — understand the lifecycle behind entitlement state.
  • Plans — see how plan definitions control which entitlements are granted.
Last modified on May 15, 2026