useBridgeAuth makes the result available to your code and to every API call the SDK makes.
useBridgeAuth
Call it once, near the root of your app.true once the hook knows whether there is a user. Wait for it before calling authenticated endpoints, or the first requests go out without credentials and fail with 401.Non-null when a user is signed in. Treat it as a flag; the SDK attaches credentials to requests for you.
Basic identity of the signed-in user, available without a network round trip.
How it resolves
Sign in and sign out
Never build the auth URLs yourself; take them from the SDK.End every cskn session on this device, not just this app’s. Adds
session=all to the link.loginUrl(redirectUrl?) returns the sign-in link without navigating, for a sign-in that is a plain <a href>. It points at the auth host for the page’s own domain, so a user page on cskn.my signs in on cskn.my. @cskn/ui wraps it in SignInButton.
logoutUrl(options) returns the same link without navigating. Use it when something else has to follow the link, for example a confirmation dialog. @cskn/ui ships one: LogoutConfirm.