Skip to main content
@kerne/react manages the signed-in user’s session and adapts your UI to what they can access. It never holds a secret key: every call acts as the signed-in user, on their own data. It works in any React app.

Install

string
required
Your project’s app id.
boolean
default:"true"
Refresh the session before it expires.
number
default:"60"
How many seconds before expiry to refresh.
(user) => void
Called when the user signs in or out.
(error) => void
A sign-in coming from your hosted portal couldn’t be completed. See Session handoff.
KerneAppearance
Styling for every prebuilt component. See Styling & language.
object
Text overrides for the prebuilt components.
string
default:"https://api.kerne.io"

Hooks and components

Ready-made sign-in, account and pricing screens are in @kerne/react/ui: see Prebuilt screens.

Guard components

<Protected> requires a session, a feature, or both:
The single-purpose guards are with their hooks: <Authenticated>, <Access> and <HasSubscription>.

Error boundary

error.code is set when the error came from the Kerne API.

Browser checks are for display

The browser runs on the user’s machine, so anything it checks or records can be skipped. Use this SDK to adapt your UI, and check access or record usage from your backend with @kerne/server for anything you enforce or bill.