@unitpay/react exchanges it for a customer-scoped billing UI — no secret key ever leaves your backend.
The token is a short-lived JWT scoped to one customer. Pass it to
<UnitPayProvider portalToken={…}>; every hook and component in the React SDK reads the customer from it.unitpay.portalSessions.create
Mints a portal session for one customer and returns the token to embed in your frontend. Parameters —CreatePortalSessionParams:
Returns — Promise<PortalSession>:
Mint the token in a server route and return only the token to the browser:
app/api/portal-session/route.ts
unitpay.portalSessions.revoke
Invalidates portal tokens before they expire — for logout, or when a customer’s access changes. Revoke a single session by itsjti, or every active session for a customer.
Parameters — RevokePortalSessionParams (one of):
Returns — Promise<void>.
See also
React SDK
Build the customer-facing billing UI the token powers.
UnitPayProvider
Where the portal token is consumed.