React
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
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): TheuseChoreo Identity & Access Managementhook provides access to the Choreo Identity & Access Management authentication context in React applications.
Contexts
<ThunderIDProvider />(context): TheThunderIDProvideris the root context provider component that configures@thunderid/reactand provides Choreo Identity & Access Management context to your entire React application.
Components
-
<ChangeCredential />(component): TheChangeCredentialcomponent renders a form that lets a signed-in user set a new value for one of their own credentials. -
<Loading />(component): TheLoadingcomponent renders its children while the authentication state is being determined. -
<SignInButton />(component): TheSignInButtoncomponent initiates the sign-in flow when clicked. -
<SignOutButton />(component): TheSignOutButtoncomponent signs out the current user, clears their session, and revokes authentication tokens when clicked. -
<SignUpButton />(component): TheSignUpButtoncomponent triggers the sign-up (registration) flow when clicked. -
<SignedIn />(component): TheSignedIncomponent conditionally renders its children only when the user is authenticated with Choreo Identity & Access Management. -
<SignedOut />(component): TheSignedOutcomponent conditionally renders its children only when the user is not authenticated with Choreo Identity & Access Management. -
<User />(component): TheUsercomponent is a declarative way to access the authenticated user object from the Choreo Identity & Access Management authentication context. -
<UserDropdown />(component): TheUserDropdowncomponent renders a dropdown menu with user information and common actions like viewing profile, settings, and signing out. -
<UserProfile />(component): TheUserProfilecomponent 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?