← OthviaFor developers

React SDK

Drop-in sign-in, sign-up, organization switcher and profile components, and a server helper that verifies the session in one call.

Install

bash
pnpm add @othvia/sdk-react

Wrap your app

OthviaProvider takes the realm and keeps the signed-in user, the active organization and the tokens for the components below. It renders nothing of its own.

typescript
import { OthviaProvider } from "@othvia/sdk-react";

<OthviaProvider realm="larkspur">
  {children}
</OthviaProvider>

Components

  • SignIn: passkeys, email routing to the right company SSO, and MFA when the realm asks for it.

  • SignUp: account creation with the methods your realm allows.

  • OrganizationSwitcher: lets a person who belongs to several customers choose which one they are working in.

  • UserProfile: the person's own details, passkeys and sessions.

On your server

The server helper verifies the access token, checks its audience and expiry, and returns the user and the active organization. If the token is DPoP-bound, it also checks the proof that came with the request.

Standard protocols underneath

The components use OAuth 2.1 and OpenID Connect. Nothing proprietary sits between your app and your users, so you can use any compliant library instead of the SDK.