ArcenEmbed is allowed to show. Understanding when to use server-minted tokens versus the standard publishable key flow lets you choose the right security model for your integration.
Two identity paths
ArcenPay supports two ways to establish the customer’s identity in the browser. Publishable key +identify() — the standard path. You initialise ArcenPayProvider with your publishable key and call identify() from the React SDK once the customer’s wallet is resolved. This is the recommended path for most integrations.
Server-minted access token — you call client.identify() on your backend to mint a short-lived token, then pass it to ArcenEmbed via the accessToken prop. Use this path when you need stronger server-side control over which billing surface a specific customer can access, or when you are integrating into a context where the publishable key + identify() flow is not suitable.
The publishable key +
identify() path is the default and is sufficient for most apps. You only need to mint server-side tokens when you require explicit backend control over the embed session.Minting a session token on the server
Useclient.identify() from the Node SDK to create a session. Pass the company and user identifiers along with an optional expiresIn value in seconds.
session object contains the access token. Return this token from your API route and pass it to the frontend.
Passing the token to ArcenEmbed
Once you have the token on the client, pass it directly toArcenEmbed via the accessToken prop. You can also specify a componentId here if you are not relying on the value set in ArcenPayProvider.
Token expiry and refresh
Tokens expire after the duration set inexpiresIn (in seconds). Once a token expires, ArcenEmbed will no longer be able to authenticate the session. To handle this:
- Set
expiresInto a value that covers the expected time the customer will spend on the billing surface (for example,3600for one hour). - If your application supports long-lived billing pages, implement a refresh mechanism that fetches a new token from your backend and updates the
accessTokenprop before the current one expires.
When to use each path
Next steps
- Quickstart — see both identity paths in the context of a full integration.
- Feature entitlements and flags — control access to features after the session is established.

