crxpay

React hooks

Your UI knows when Pro turns on.

useEntitlement and useSubscription plug into the cache the SDK already keeps. The moment Stripe confirms the charge, every component that needs to re-render, re-renders.

Zero
context setup
SSR
safe
Hooks
strictly typed
crxpay · react demo
const pro = useEntitlement('pro');
return pro ? <ProPanel /> : <Paywall/>;
Rendered output
pro = false
Free plan
Go Pro to use this
Upgrade · $9/mo
Live preview · hook flips the UI in real time

React hooks

Billing state, hooked up.

Built for the way you already write React. Typed, re-renders on change, safe on the server.

// popup.tsx
import { useEntitlement } from '@crxpay/react';
export function App() {
const pro = useEntitlement('pro');
returnpro ? <Dashboard /> : <Paywall />;
}
1

useEntitlement, one line

Pass the key you care about, get a boolean. The hook subscribes to cache updates so your component re-renders the instant the SDK hears a webhook.

useSubscription for the full picture

Plan, renewal date, trial state, seat count. Everything you need to render a real billing screen or a custom account tab. No extra fetch.

2
const sub = useSubscription();
sub.plan'pro_monthly'
sub.status'active'
sub.renewsAt'2026-05-14'
sub.trialEndsAtnull
sub.seats1
sub.entitlements['pro']
// root.tsx
<CrxPayProvider
apiKey="pk_live_…"
mode="auto"
>
<App />
</CrxPayProvider>
3

CrxPayProvider, set and forget

Wrap your root once with your public key and mode. Every child component can use the hooks. No prop drilling, no Redux adapter, no fetch wrapper.

SSR-safe and strict-mode clean

Renders a stable fallback on the server, hydrates from the signed cache on the client. Works with Next.js 14 and 15, React 18 and 19, no double-fetch in strict mode.

4
Server
fallback · loading
Client
cache hit · pro

Why React teams ship faster

Hooks that feel native.

0
Hooks to learn
useEntitlement, useSubscription
0 ms
Setup cost
provider reads the SDK cache
0 render
On state change
subscribed components only
0%
Strict-mode safe
no double fetch in dev

Ready to grow?

Our entire suite of features comes standard — and your first $2,500 in tracked revenue is free.