import "keycloak-headless/provider"; import { useKeycloakAuth } from "keycloak-headless/solid"; import { Show, createMemo } from "solid-js"; import { realmRolesAttr } from "./realm-roles-attr.js"; export function App() { let host: HTMLDivElement | undefined; const auth = useKeycloakAuth(() => host ?? null); const keycloak = createMemo(() => auth().keycloak); const authenticated = createMemo(() => auth().authenticated); const error = createMemo(() => auth().error); return (

kc-provider + Solid

Initializing Keycloak…

Init error (expected if Keycloak is not running):{" "} {String((error() as Error)?.message ?? error())}

Authenticated: {String(authenticated())}

Members-only: you are signed in (via{" "} kc-render-authenticated).

{" "} — via kc-account-link{" "} {" "} — via kc-logout-button

You have the configured realm role (via{" "} kc-render-roles).

{" "} — login via kc-login-button inside{" "} kc-render-guest

); }