A subscription wall prevents unsubscribed customers from accessing paid features. You enforce it server-side with ArcenClient for authoritative access control, and optionally gate the UI with React hooks for a better experience.
Prerequisites
- A published subscription plan in your ArcenPay dashboard
@arcenpay/react installed in your frontend
@arcenpay/node installed in your backend
- Your API key set as
ARCENPAY_API_KEY in your server environment
Server-side enforcement
Always enforce subscription access on the server. Client-side checks are for UI optimization — they can be bypassed.
In a Next.js API route or middleware:
UI gating with React
Show upgrade prompts instead of gated content when the customer lacks access:
Using FeatureFlagGuard
For simpler cases, wrap gated content with FeatureFlagGuard:
Checking multiple features at once
Use useFlags or the server-side checkEntitlement for the full company entitlement state:
Handling upgrade flow
When a customer hits a subscription wall, guide them to upgrade:
The embed handles plan selection, payment, on-chain activation, and success states — no additional checkout code needed.
Metered consumption behind the wall
For features with usage limits, consume the entitlement after each use:
Next steps
- Feature gating — gate individual features rather than entire routes
- Entitlements — deep dive on how access is resolved
- Webhooks — listen for subscription changes to update access state
Last modified on September 9, 2026