Integrating with ReactJS
Using @authaction/web-sdk
Section titled “Using @authaction/web-sdk”The official SDK replaces react-oidc-context with a drop-in API. Install once and you’re done — no JWKS wiring, no separate jwks-rsa dependency.
npm install @authaction/web-sdkimport { AuthActionProvider } from "@authaction/web-sdk/react";
<AuthActionProvider domain="myapp.eu.authaction.com" clientId="your-client-id" redirectUri={`${window.location.origin}/`} postLogoutRedirectUri={`${window.location.origin}/`} authorizationParams={{ audience: "https://api.myapp.com" }}> <App /></AuthActionProvider>;import { useAuthAction } from "@authaction/web-sdk/react";
function App() { const { isLoading, isAuthenticated, user, loginWithRedirect, logout } = useAuthAction(); if (isLoading) return <Spinner />; if (!isAuthenticated) return <button onClick={() => loginWithRedirect()}>Login</button>; return <button onClick={() => logout()}>Hello {user?.name}</button>;}Full SDK reference: github.com/authaction/authaction-web-sdk