Skip to main content
Feature gating lets you show, hide, or limit features based on the customer’s active plan and consumption. ArcenPay resolves access from the dashboard catalog so you never hardcode plan logic in your application.

Prerequisites

  • At least one published plan with entitlements configured in the dashboard
  • Features defined under Features with keys you reference in code
  • @arcenpay/react (for UI gating) and/or @arcenpay/node (for server enforcement)

Gating UI with React hooks

Hook reference

Server-side enforcement

Never trust client-side gates for sensitive operations. Always enforce access on the server:

Metered consumption

For features with usage limits (like “100 scans per month”), consume the entitlement after each use:
Always provide a unique idempotencyKey per logical operation. This prevents double-counting on retries.

Event-based feature flags

Flags can evaluate against tracked events. For example, enable a feature only after onboarding_complete is tracked:
Once tracked, any event-based flag watching for onboarding_complete resolves accordingly.

Progressive disclosure pattern

Combine server enforcement and UI gating for a complete progressive disclosure flow:

Next steps

Last modified on May 15, 2026