Skip to main content

React

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Hooks and components to drop Choreo Identity & Access Management into a React + Vite app in minutes. The provider restores an existing session on mount, handles the redirect callback, and refreshes tokens in the background, so your components only ever read state.

  • @thunderid/react
  • Apache 2.0 licence

Quickstart · Source

API reference​

Every export is fully typed. The signatures and props below come from the package's own reference documentation, so what is listed here is what the installed version ships.

See the full API reference for every export, its signature and an example.

Hooks​

  • useThunderID() (hook): The useChoreo Identity & Access Management hook provides access to the Choreo Identity & Access Management authentication context in React applications.

Contexts​

  • <ThunderIDProvider /> (context): The ThunderIDProvider is the root context provider component that configures @thunderid/react and provides Choreo Identity & Access Management context to your entire React application.

Components​

  • <ChangeCredential /> (component): The ChangeCredential component renders a form that lets a signed-in user set a new value for one of their own credentials.

  • <Loading /> (component): The Loading component renders its children while the authentication state is being determined.

  • <SignInButton /> (component): The SignInButton component initiates the sign-in flow when clicked.

  • <SignOutButton /> (component): The SignOutButton component signs out the current user, clears their session, and revokes authentication tokens when clicked.

  • <SignUpButton /> (component): The SignUpButton component triggers the sign-up (registration) flow when clicked.

  • <SignedIn /> (component): The SignedIn component conditionally renders its children only when the user is authenticated with Choreo Identity & Access Management.

  • <SignedOut /> (component): The SignedOut component conditionally renders its children only when the user is not authenticated with Choreo Identity & Access Management.

  • <User /> (component): The User component is a declarative way to access the authenticated user object from the Choreo Identity & Access Management authentication context.

  • <UserDropdown /> (component): The UserDropdown component renders a dropdown menu with user information and common actions like viewing profile, settings, and signing out.

  • <UserProfile /> (component): The UserProfile component renders a complete user profile management interface where users can view and edit their personal information, change passwords, manage sessions, and more.

Get started​

Provider, session, and a protected route, start to finish.

Connect your application: Getting started / Connect your application / React (about 5 minutes)

The quickstart is maintained alongside the rest of the getting-started guides so it stays in step with the platform. This page covers the package itself: its API surface, guides, and compatibility.

Guides​

Task-focused walkthroughs maintained alongside the SDK.

  • Protecting routes: Guard a route tree so unauthenticated visitors are sent through sign-in, covering React Router, TanStack Router, and a hand-rolled guard.

  • Accessing protected APIs: Attach an access token to requests against your own resource server.

  • Using a Backend for Frontend (BFF): Keep the tokens on a server of your own and support single logout, with an Express BFF that signs users in for your React app.

Was this page helpful?