Skip to main content
The @orvlin/react package provides React components and hooks for your customer-facing app. It reads a signed-in customer’s entitlements and credit balances, so you can show or hide features in the UI.
The React SDK does not use your API key. It authenticates with a portal token for one customer. Your backend creates that token with a portal session and passes it to the browser. Never put your API key in browser code.

Install

Provide the client

Wrap your app in OrvlinProvider:

Show a feature

The <Feature> component renders its children only if the customer can use the feature:

Hooks

Each hook returns loading so you can render a placeholder while data arrives. useEntitlements and useCredits also return error.

Refresh after a change

Entitlements and balances refresh on the interval you set. To refresh straight after the customer does something, call refresh() from useEntitlements or useCredits.

Next steps

Customer portal

Create the portal session your app needs.

Entitlements

How checks and limits work.