Next.js

Core state

Read deployment, client, session, user, and navigation state from the shared hook layer.

useDeployment()

useDeployment() is the root hook for the shared client layer. It reads the deployment context created by <DeploymentProvider /> and gives the rest of the client hooks their deployment-aware behavior.

export default function DeploymentDebug() {  const { deployment, loading, adapter } = useDeployment();  if (loading) {    return <div>Loading deployment...</div>;  }  return (    <div>      <p>{deployment.ui_settings.app_name}</p>      <p>{deployment.frontend_host}</p>      <p>{adapter.useNavigate() ? 'Adapter ready' : 'No adapter'}</p>    </div>  );}
loading: boolean;
Whether the deployment request is still in flight.
deployment: Deployment | null;
The resolved deployment object from `DeploymentProvider`.
backend_host?: string | undefined;
The backend host resolved from the public key and used for client requests.
frontend_host?: string | undefined;
The frontend host configured for the deployment.
mode?: "production" | "staging" | undefined;
The deployment mode, used for staging-only behaviors like the development session handshake.
auth_settings?: AuthSettings | undefined;
The deployment-level authentication settings that drive the shared auth UI and flows.
first_factor?: FirstFactor | undefined;
The default first-factor strategy for sign-in.
second_factor_policy?: SecondFactorPolicy | undefined;
Whether second-factor auth is disabled, optional, or enforced.
multi_session_support?: MultiSessionSupport | undefined;
Controls whether the deployment allows multiple signed-in accounts in one session.
enabled?: boolean | undefined;
Whether multi-session support is enabled.
max_accounts_per_session?: number | undefined;
The maximum number of accounts allowed in one browser session.
passkey?: PasskeySettings | undefined;
Passkey availability and prompting rules.
enabled?: boolean | undefined;
Whether passkeys are enabled for the deployment.
prompt_registration_on_auth?: boolean | undefined;
Whether users are prompted to register a passkey after signing in.
b2b_settings?: B2BSettings | undefined;
The deployment-level organization and workspace settings.
organizations_enabled?: boolean | undefined;
Whether organizations are enabled for the deployment.
workspaces_enabled?: boolean | undefined;
Whether workspaces are enabled under organizations.
allow_users_to_create_orgs?: boolean | undefined;
Whether end users can create organizations without operator intervention.
custom_org_role_enabled?: boolean | undefined;
Whether custom organization roles are enabled.
custom_workspace_role_enabled?: boolean | undefined;
Whether custom workspace roles are enabled.
enterprise_sso_enabled?: boolean | undefined;
Whether enterprise SSO is enabled for organizations.
ui_settings?: DeploymentUISettings | undefined;
The UI settings for hosted routes, redirects, and embedded auth configuration.
deployment_id?: number | undefined;
Override the deployment UI settings record identifier.
app_name?: string | undefined;
Override the product or application name shown in shared auth UI.
privacy_policy_url?: string | undefined;
Override the privacy policy URL shown in auth surfaces.
tos_page_url?: string | undefined;
Override the terms of service URL shown in auth surfaces.
sign_in_page_url?: string | undefined;
Override the sign-in route used by shared navigation helpers and hosted auth redirects.
sign_up_page_url?: string | undefined;
Override the sign-up route used by shared navigation helpers and sign-up entry points.
waitlist_page_url?: string | undefined;
Override the waitlist page URL used by waitlist flows.
support_page_url?: string | undefined;
Override the support page URL linked from auth and recovery flows.
after_logo_click_url?: string | undefined;
Override the URL used when a user clicks the logo in shared auth UI.
user_profile_url?: string | undefined;
Override the user profile page URL used by account navigation.
organization_profile_url?: string | undefined;
Override the organization profile page URL used by organization management flows.
create_organization_url?: string | undefined;
Override the create-organization page URL used by organization creation flows.
after_sign_out_one_page_url?: string | undefined;
Override the redirect target after signing out only the active sign-in.
after_sign_out_all_page_url?: string | undefined;
Override the redirect target after signing out the whole session.
after_signup_redirect_url?: string | undefined;
Override the default redirect target after sign-up completes.
after_signin_redirect_url?: string | undefined;
Override the default redirect target after sign-in completes.
after_create_organization_redirect_url?: string | undefined;
Override the redirect target after creating an organization.
favicon_image_url?: string | undefined;
Override the favicon image URL used by shared auth pages.
default_user_profile_image_url?: string | undefined;
Override the default user profile image URL.
default_organization_profile_image_url?: string | undefined;
Override the default organization profile image URL.
default_workspace_profile_image_url?: string | undefined;
Override the default workspace profile image URL.
use_initials_for_user_profile_image?: boolean | undefined;
Whether shared UI should use initials when a user profile image is missing.
use_initials_for_organization_profile_image?: boolean | undefined;
Whether shared UI should use initials when an organization profile image is missing.
logo_image_url?: string | undefined;
Override the logo image URL used in shared auth UI.
signup_terms_statement?: string | undefined;
Override the sign-up terms statement shown during registration.
signup_terms_statement_shown?: boolean | undefined;
Whether the sign-up terms statement should be shown.
light_mode_settings?: LightModeSettings | undefined;
Override the light mode theme settings used by the embedded UI.
primary_color?: string | undefined;
Override the light mode primary color.
background_color?: string | undefined;
Override the light mode background color.
text_color?: string | undefined;
Override the light mode text color.
token_overrides?: UITokenOverrides | undefined;
Fine-grained light mode token overrides for the embedded UI theme.
space_unit?: string | undefined;
Override the base spacing unit used by the shared UI theme.
card?: string | undefined;
Override the card background color.
card_foreground?: string | undefined;
Override the card foreground color.
popover?: string | undefined;
Override the popover background color.
popover_foreground?: string | undefined;
Override the popover foreground color.
primary_foreground?: string | undefined;
Override the foreground color used on primary surfaces.
secondary?: string | undefined;
Override the secondary surface color.
secondary_foreground?: string | undefined;
Override the foreground color used on secondary surfaces.
accent?: string | undefined;
Override the accent surface color.
accent_foreground?: string | undefined;
Override the foreground color used on accent surfaces.
ring?: string | undefined;
Override the focus ring color.
foreground?: string | undefined;
Override the main foreground color.
foreground_inverse?: string | undefined;
Override the inverse foreground color.
secondary_text?: string | undefined;
Override the secondary text color.
muted?: string | undefined;
Override the muted text or surface color.
border?: string | undefined;
Override the default border color.
border_hover?: string | undefined;
Override the border color used on hover states.
divider?: string | undefined;
Override the divider color.
input_background?: string | undefined;
Override the input background color.
input_border?: string | undefined;
Override the input border color.
input_focus_border?: string | undefined;
Override the input border color used on focus.
background_subtle?: string | undefined;
Override the subtle background color.
background_hover?: string | undefined;
Override the background color used on hover states.
primary_hover?: string | undefined;
Override the hover color for primary actions.
error?: string | undefined;
Override the error text or accent color.
error_background?: string | undefined;
Override the error background color.
error_border?: string | undefined;
Override the error border color.
warning?: string | undefined;
Override the warning text or accent color.
warning_background?: string | undefined;
Override the warning background color.
warning_border?: string | undefined;
Override the warning border color.
warning_text?: string | undefined;
Override the warning text color.
success?: string | undefined;
Override the success text or accent color.
success_background?: string | undefined;
Override the success background color.
success_border?: string | undefined;
Override the success border color.
info?: string | undefined;
Override the info text or accent color.
info_background?: string | undefined;
Override the info background color.
radius_md?: string | undefined;
Override the medium radius token.
radius_lg?: string | undefined;
Override the large radius token.
radius_xl?: string | undefined;
Override the extra-large radius token.
radius_2xl?: string | undefined;
Override the 2xl radius token.
radius_2xs?: string | undefined;
Override the 2xs radius token.
radius_xs?: string | undefined;
Override the extra-small radius token.
radius_full?: string | undefined;
Override the fully rounded radius token.
border_width_thin?: string | undefined;
Override the thin border width token.
border_width_regular?: string | undefined;
Override the regular border width token.
scrollbar_track?: string | undefined;
Override the scrollbar track color.
scrollbar_thumb?: string | undefined;
Override the scrollbar thumb color.
scrollbar_thumb_hover?: string | undefined;
Override the scrollbar thumb hover color.
shadow_color?: string | undefined;
Override the base shadow color.
shadow_light_color?: string | undefined;
Override the light shadow color.
shadow_medium_color?: string | undefined;
Override the medium shadow color.
success_shadow?: string | undefined;
Override the success shadow color.
success_background_light?: string | undefined;
Override the light success background color.
button_ripple?: string | undefined;
Override the button ripple color.
dialog_backdrop?: string | undefined;
Override the dialog backdrop color.
space_0u?: string | undefined;
Override the 0u spacing token.
space_1u?: string | undefined;
Override the 1u spacing token.
space_2u?: string | undefined;
Override the 2u spacing token.
space_3u?: string | undefined;
Override the 3u spacing token.
space_4u?: string | undefined;
Override the 4u spacing token.
space_5u?: string | undefined;
Override the 5u spacing token.
space_6u?: string | undefined;
Override the 6u spacing token.
space_7u?: string | undefined;
Override the 7u spacing token.
space_8u?: string | undefined;
Override the 8u spacing token.
space_10u?: string | undefined;
Override the 10u spacing token.
space_12u?: string | undefined;
Override the 12u spacing token.
space_14u?: string | undefined;
Override the 14u spacing token.
space_16u?: string | undefined;
Override the 16u spacing token.
space_24u?: string | undefined;
Override the 24u spacing token.
font_size_2xs?: string | undefined;
Override the 2xs font size token.
font_size_xs?: string | undefined;
Override the xs font size token.
font_size_sm?: string | undefined;
Override the sm font size token.
font_size_md?: string | undefined;
Override the md font size token.
font_size_lg?: string | undefined;
Override the lg font size token.
font_size_xl?: string | undefined;
Override the xl font size token.
font_size_2xl?: string | undefined;
Override the 2xl font size token.
font_size_3xl?: string | undefined;
Override the 3xl font size token.
size_8u?: string | undefined;
Override the 8u size token.
size_10u?: string | undefined;
Override the 10u size token.
size_12u?: string | undefined;
Override the 12u size token.
size_18u?: string | undefined;
Override the 18u size token.
size_20u?: string | undefined;
Override the 20u size token.
size_24u?: string | undefined;
Override the 24u size token.
size_32u?: string | undefined;
Override the 32u size token.
size_36u?: string | undefined;
Override the 36u size token.
size_40u?: string | undefined;
Override the 40u size token.
size_45u?: string | undefined;
Override the 45u size token.
size_50u?: string | undefined;
Override the 50u size token.
shadow_sm?: string | undefined;
Override the small shadow token.
shadow_md?: string | undefined;
Override the medium shadow token.
shadow_lg?: string | undefined;
Override the large shadow token.
shadow_xl?: string | undefined;
Override the xl shadow token.
shadow_success?: string | undefined;
Override the success shadow token.
ring_primary?: string | undefined;
Override the primary ring color token.
letter_spacing_tight?: string | undefined;
Override the tight letter spacing token.
dark_mode_settings?: DarkModeSettings | undefined;
Override the dark mode theme settings used by the embedded UI.
primary_color?: string | undefined;
Override the dark mode primary color.
background_color?: string | undefined;
Override the dark mode background color.
text_color?: string | undefined;
Override the dark mode text color.
token_overrides?: UITokenOverrides | undefined;
Fine-grained dark mode token overrides for the embedded UI theme.
space_unit?: string | undefined;
Override the base spacing unit used by the shared UI theme.
card?: string | undefined;
Override the card background color.
card_foreground?: string | undefined;
Override the card foreground color.
popover?: string | undefined;
Override the popover background color.
popover_foreground?: string | undefined;
Override the popover foreground color.
primary_foreground?: string | undefined;
Override the foreground color used on primary surfaces.
secondary?: string | undefined;
Override the secondary surface color.
secondary_foreground?: string | undefined;
Override the foreground color used on secondary surfaces.
accent?: string | undefined;
Override the accent surface color.
accent_foreground?: string | undefined;
Override the foreground color used on accent surfaces.
ring?: string | undefined;
Override the focus ring color.
foreground?: string | undefined;
Override the main foreground color.
foreground_inverse?: string | undefined;
Override the inverse foreground color.
secondary_text?: string | undefined;
Override the secondary text color.
muted?: string | undefined;
Override the muted text or surface color.
border?: string | undefined;
Override the default border color.
border_hover?: string | undefined;
Override the border color used on hover states.
divider?: string | undefined;
Override the divider color.
input_background?: string | undefined;
Override the input background color.
input_border?: string | undefined;
Override the input border color.
input_focus_border?: string | undefined;
Override the input border color used on focus.
background_subtle?: string | undefined;
Override the subtle background color.
background_hover?: string | undefined;
Override the background color used on hover states.
primary_hover?: string | undefined;
Override the hover color for primary actions.
error?: string | undefined;
Override the error text or accent color.
error_background?: string | undefined;
Override the error background color.
error_border?: string | undefined;
Override the error border color.
warning?: string | undefined;
Override the warning text or accent color.
warning_background?: string | undefined;
Override the warning background color.
warning_border?: string | undefined;
Override the warning border color.
warning_text?: string | undefined;
Override the warning text color.
success?: string | undefined;
Override the success text or accent color.
success_background?: string | undefined;
Override the success background color.
success_border?: string | undefined;
Override the success border color.
info?: string | undefined;
Override the info text or accent color.
info_background?: string | undefined;
Override the info background color.
radius_md?: string | undefined;
Override the medium radius token.
radius_lg?: string | undefined;
Override the large radius token.
radius_xl?: string | undefined;
Override the extra-large radius token.
radius_2xl?: string | undefined;
Override the 2xl radius token.
radius_2xs?: string | undefined;
Override the 2xs radius token.
radius_xs?: string | undefined;
Override the extra-small radius token.
radius_full?: string | undefined;
Override the fully rounded radius token.
border_width_thin?: string | undefined;
Override the thin border width token.
border_width_regular?: string | undefined;
Override the regular border width token.
scrollbar_track?: string | undefined;
Override the scrollbar track color.
scrollbar_thumb?: string | undefined;
Override the scrollbar thumb color.
scrollbar_thumb_hover?: string | undefined;
Override the scrollbar thumb hover color.
shadow_color?: string | undefined;
Override the base shadow color.
shadow_light_color?: string | undefined;
Override the light shadow color.
shadow_medium_color?: string | undefined;
Override the medium shadow color.
success_shadow?: string | undefined;
Override the success shadow color.
success_background_light?: string | undefined;
Override the light success background color.
button_ripple?: string | undefined;
Override the button ripple color.
dialog_backdrop?: string | undefined;
Override the dialog backdrop color.
space_0u?: string | undefined;
Override the 0u spacing token.
space_1u?: string | undefined;
Override the 1u spacing token.
space_2u?: string | undefined;
Override the 2u spacing token.
space_3u?: string | undefined;
Override the 3u spacing token.
space_4u?: string | undefined;
Override the 4u spacing token.
space_5u?: string | undefined;
Override the 5u spacing token.
space_6u?: string | undefined;
Override the 6u spacing token.
space_7u?: string | undefined;
Override the 7u spacing token.
space_8u?: string | undefined;
Override the 8u spacing token.
space_10u?: string | undefined;
Override the 10u spacing token.
space_12u?: string | undefined;
Override the 12u spacing token.
space_14u?: string | undefined;
Override the 14u spacing token.
space_16u?: string | undefined;
Override the 16u spacing token.
space_24u?: string | undefined;
Override the 24u spacing token.
font_size_2xs?: string | undefined;
Override the 2xs font size token.
font_size_xs?: string | undefined;
Override the xs font size token.
font_size_sm?: string | undefined;
Override the sm font size token.
font_size_md?: string | undefined;
Override the md font size token.
font_size_lg?: string | undefined;
Override the lg font size token.
font_size_xl?: string | undefined;
Override the xl font size token.
font_size_2xl?: string | undefined;
Override the 2xl font size token.
font_size_3xl?: string | undefined;
Override the 3xl font size token.
size_8u?: string | undefined;
Override the 8u size token.
size_10u?: string | undefined;
Override the 10u size token.
size_12u?: string | undefined;
Override the 12u size token.
size_18u?: string | undefined;
Override the 18u size token.
size_20u?: string | undefined;
Override the 20u size token.
size_24u?: string | undefined;
Override the 24u size token.
size_32u?: string | undefined;
Override the 32u size token.
size_36u?: string | undefined;
Override the 36u size token.
size_40u?: string | undefined;
Override the 40u size token.
size_45u?: string | undefined;
Override the 45u size token.
size_50u?: string | undefined;
Override the 50u size token.
shadow_sm?: string | undefined;
Override the small shadow token.
shadow_md?: string | undefined;
Override the medium shadow token.
shadow_lg?: string | undefined;
Override the large shadow token.
shadow_xl?: string | undefined;
Override the xl shadow token.
shadow_success?: string | undefined;
Override the success shadow token.
ring_primary?: string | undefined;
Override the primary ring color token.
letter_spacing_tight?: string | undefined;
Override the tight letter spacing token.
adapter: PlatformAdapter;
The adapter object injected by the framework package. This is what gives the shared hooks framework-aware navigation.

useClient()

useClient() gives you the low-level fetch wrapper that the shared hooks use for browser-side API calls. It builds requests from the current deployment instead of from a separate client configuration layer.

export default function PrivateData() {  const { client, loading } = useClient();  async function load() {    const response = await client('/me');    const data = await response.json();    console.log(data);  }  if (loading) {    return null;  }  return <button onClick={load}>Load profile</button>;}
client: Client;
A deployment-aware fetch function that prefixes the backend host, merges headers, and applies the correct environment-specific request behavior.
loading: boolean;
Whether the deployment is still loading. While this is true, the client will throw if you try to call it.

useSession()

useSession() is the core auth-state hook. It exposes the current session object plus the mutations that change active sign-ins, change organization or workspace scope, sign out, exchange tickets, and fetch session tokens.

export default function SessionSummary() {  const { session, loading } = useSession();  if (loading) {    return null;  }  return <div>{session.active_signin?.user.email_address}</div>;}
loading: boolean;
Whether the session request is still in flight.
error?: unknown | undefined;
The session-loading error, if one occurred.
refetch: () => Promise<void>;
Revalidate the current session state.
session?: Session | undefined;
The loaded session object. This is only available once loading has completed successfully.
active_signin?: SignIn | null | undefined;
The sign-in currently active in the session.
id?: string | undefined;
The active sign-in identifier.
active_organization_membership_id?: string | undefined;
The active organization membership attached to this sign-in.
active_workspace_membership_id?: string | undefined;
The active workspace membership attached to this sign-in.
expiresAt?: string | undefined;
When the current sign-in expires.
lastActiveAt?: string | undefined;
When the sign-in was last active.
user?: CurrentUser | undefined;
The current user attached to the active sign-in.
id?: string | undefined;
The current user identifier.
first_name?: string | undefined;
The user first name.
last_name?: string | undefined;
The user last name.
username?: string | undefined;
The username if one is set.
primary_email_address?: UserEmailAddress | undefined;
The primary email address for the current user.
email?: string | undefined;
The email address value.
verified?: boolean | undefined;
Whether the primary email address has been verified.
primary_phone_number?: UserPhoneNumber | undefined;
The primary phone number when one is available.
phone_number?: string | undefined;
The phone number value.
verified?: boolean | undefined;
Whether the primary phone number has been verified.
has_password?: boolean | undefined;
Whether the current user has a password set.
has_passkeys?: boolean | undefined;
Whether the current user has registered passkeys.
signins?: SignIn[] | undefined;
All sign-ins attached to the current session, including inactive ones in multi-session mode.
signin_attempts?: SigninAttempt[] | undefined;
Incomplete or resumable sign-in attempts attached to the current session.
id?: string | undefined;
The sign-in attempt identifier.
method?: SignInMethod | undefined;
The current sign-in method for the attempt.
current_step?: CurrentSessionStep | undefined;
The current step that still needs to be completed.
completed?: boolean | undefined;
Whether the sign-in attempt has completed.
second_method_authentication_required?: boolean | undefined;
Whether a second factor is still required.
available_2fa_methods?: string[] | undefined;
The second-factor methods available to this attempt.
requires_completion?: boolean | undefined;
Whether the attempt still needs profile completion.
missing_fields?: string[] | undefined;
The fields still missing from an incomplete profile.
profile_completion_data?: ProfileCompletionData | undefined;
The profile fields that can be prefilled during completion.
first_name?: string | undefined;
The suggested first name.
last_name?: string | undefined;
The suggested last name.
username?: string | undefined;
The suggested username.
email?: string | undefined;
The suggested email address.
phone_number?: string | undefined;
The suggested phone number.
signup_attempts?: SignupAttempt[] | undefined;
Incomplete or resumable sign-up attempts attached to the current session.
id?: string | undefined;
The sign-up attempt identifier.
current_step?: SignupAttemptStep | undefined;
The verification step the sign-up attempt is currently on.
remaining_steps?: SignupAttemptStep[] | undefined;
The verification steps that still remain.
completed?: boolean | undefined;
Whether the sign-up attempt has completed.
required_fields?: string[] | undefined;
The fields the sign-up flow requires.
missing_fields?: string[] | undefined;
The required fields still missing from the sign-up attempt.
switchSignIn?: (signInId: string) => Promise<void> | undefined;
Switch the active account inside a multi-sign-in session.
switchOrganization?: (organizationId?: string) => Promise<void> | undefined;
Change the active organization scope in the current session.
switchWorkspace?: (workspaceId: string) => Promise<void> | undefined;
Change the active workspace scope in the current session.
signOut?: (signInId?: string) => Promise<void> | undefined;
Sign out one sign-in when an ID is provided, or sign out the entire session when it is omitted.
getToken?: (template?: string) => Promise<string> | undefined;
Read a bearer token for the current session. Tokens are cached by template until expiry and cleared when session state changes.
exchangeTicket?: (ticket: string) => Promise<void> | undefined;
Exchange a ticket for session state during redirect or handshake flows.

useUser()

useUser() is the broadest user-management hook in the shared client layer. It owns the current user record together with the mutations for profile updates, contact methods, authenticators, backup codes, passwords, social connections, and passkeys.

export default function ProfileSettings() {  const { user, loading, updateProfile } = useUser();  if (loading) {    return null;  }  async function save() {    await updateProfile({      first_name: user.first_name,      last_name: user.last_name,    });  }  return <button onClick={save}>Save profile</button>;}
user: CurrentUser & { refetch: () => Promise<CurrentUser | undefined> };
The current user record together with a `refetch()` helper from the underlying SWR cache.
id?: string | undefined;
The current user identifier.
first_name?: string | undefined;
The user first name.
last_name?: string | undefined;
The user last name.
username?: string | undefined;
The username when one is set.
primary_email_address?: UserEmailAddress | undefined;
The primary email address record.
email?: string | undefined;
The email address value.
verified?: boolean | undefined;
Whether the email address has been verified.
primary_phone_number?: UserPhoneNumber | undefined;
The primary phone number record when one exists.
phone_number?: string | undefined;
The phone number value.
verified?: boolean | undefined;
Whether the phone number has been verified.
user_email_addresses?: UserEmailAddress[] | undefined;
All email addresses attached to the current user.
user_phone_numbers?: UserPhoneNumber[] | undefined;
All phone numbers attached to the current user.
social_connections?: SocialConnection[] | undefined;
The currently linked social accounts.
user_authenticator?: UserAuthenticator | undefined;
The current authenticator record when one exists.
backup_codes_generated?: boolean | undefined;
Whether backup codes have already been generated.
has_password?: boolean | undefined;
Whether the current user has a password set.
has_passkeys?: boolean | undefined;
Whether the current user has passkeys registered.
refetch?: () => Promise<CurrentUser | undefined> | undefined;
Refreshes the current user record.
loading: boolean;
Whether the user record is still loading.
error: Error | null;
The user-loading error, if one occurred.
updateProfile: (data: ProfileUpdateData) => Promise<ApiResult<unknown>>;
Updates the core profile fields, primary contact IDs, second-factor policy, or profile-picture removal flag.
first_name?: string | undefined;
The new first name.
last_name?: string | undefined;
The new last name.
username?: string | undefined;
The new username.
primary_email_address_id?: string | undefined;
The email address to make primary.
primary_phone_number_id?: string | undefined;
The phone number to make primary.
second_factor_policy?: "none" | "optional" | "enforced" | undefined;
The second-factor policy for the current user.
remove_profile_picture?: boolean | undefined;
Whether the current profile picture should be removed.
getEmailAddresses: () => Promise<ApiResult<UserEmailAddress[]>>;
Loads all email addresses attached to the current user.
[].id?: string | undefined;
Email-address record identifier.
[].email?: string | undefined;
Email address value.
[].is_primary?: boolean | undefined;
Whether the address is currently primary.
[].verified?: boolean | undefined;
Whether the address has been verified.
[].verified_at?: string | undefined;
Verification timestamp when the address has been verified.
[].verification_strategy?: "otp" | "oath_google" | "oath_github" | "oauth_microsoft" | "oauth_facebook" | "oauth_linkedin" | "oauth_discord" | "oauth_apple" | undefined;
Verification strategy attached to the address.
getEmailAddress: (id: string) => Promise<ApiResult<UserEmailAddress>>;
Loads one specific email-address record for the current user.
id?: string | undefined;
Email-address record identifier.
email?: string | undefined;
Email address value.
is_primary?: boolean | undefined;
Whether the address is currently primary.
verified?: boolean | undefined;
Whether the address has been verified.
verified_at?: string | undefined;
Verification timestamp when the address has been verified.
verification_strategy?: "otp" | "oath_google" | "oath_github" | "oauth_microsoft" | "oauth_facebook" | "oauth_linkedin" | "oauth_discord" | "oauth_apple" | undefined;
Verification strategy attached to the address.
createEmailAddress: (email: string) => Promise<ApiResult<UserEmailAddress>>;
Creates a new email address for the current user.
id?: string | undefined;
Email-address record identifier.
email?: string | undefined;
Email address value.
is_primary?: boolean | undefined;
Whether the address is currently primary.
verified?: boolean | undefined;
Whether the address has been verified.
verified_at?: string | undefined;
Verification timestamp when the address has been verified.
verification_strategy?: "otp" | "oath_google" | "oath_github" | "oauth_microsoft" | "oauth_facebook" | "oauth_linkedin" | "oauth_discord" | "oauth_apple" | undefined;
Verification strategy attached to the address.
deleteEmailAddress: (id: string) => Promise<ApiResult<unknown>>;
Deletes an existing email address.
prepareEmailVerification: (id: string) => Promise<ApiResult<unknown>>;
Starts verification for an email address.
attemptEmailVerification: (id: string, otp: string) => Promise<ApiResult<unknown>>;
Submits an email verification code.
makeEmailPrimary: (id: string) => Promise<ApiResult<unknown>>;
Makes an email address primary.
createPhoneNumber: (phone_number: string, country_code: string) => Promise<ApiResult<UserPhoneNumber>>;
Creates a new phone number for the current user.
id?: string | undefined;
Phone-number record identifier.
phone_number?: string | undefined;
Phone number value.
country_code?: string | undefined;
Phone country code stored with the number.
verified?: boolean | undefined;
Whether the number has been verified.
verified_at?: string | undefined;
Verification timestamp when the number has been verified.
deletePhoneNumber: (id: string) => Promise<ApiResult<unknown>>;
Deletes an existing phone number.
preparePhoneVerification: (id: string) => Promise<ApiResult<unknown>>;
Starts verification for a phone number.
attemptPhoneVerification: (id: string, otp: string) => Promise<ApiResult<unknown>>;
Submits a phone verification code.
makePhonePrimary: (id: string) => Promise<ApiResult<unknown>>;
Makes a phone number primary.
setupAuthenticator: () => Promise<UserAuthenticator>;
Creates an authenticator enrollment and returns the TOTP setup data.
id?: string | undefined;
Authenticator identifier.
created_at?: string | undefined;
Creation timestamp for the authenticator record.
totp_secret?: string | undefined;
TOTP secret when the setup flow exposes it.
otp_url?: string | undefined;
OTP provisioning URL for authenticator apps.
verifyAuthenticator: (id: string, codes: string[]) => Promise<ApiResult<unknown>>;
Verifies an authenticator using one or more codes.
deleteAuthenticator: (id: string) => Promise<ApiResult<unknown>>;
Deletes an authenticator enrollment.
generateBackupCodes: () => Promise<string[]>;
Generates backup codes for the current user.
regenerateBackupCodes: () => Promise<string[]>;
Regenerates backup codes for the current user.
updateProfilePicture: (file: File) => Promise<ApiResult<unknown>>;
Uploads a new profile picture for the current user.
updatePassword: (currentPassword: string, newPassword: string) => Promise<ApiResult<unknown>>;
Changes the current password.
removePassword: (currentPassword: string) => Promise<ApiResult<unknown>>;
Removes the current password when the deployment allows it.
connectSocialAccount: (params: { provider: string; redirectUri?: string }) => Promise<ApiResult<{ oauth_url: string }>>;
Starts a social-account connection flow in a new browser window.
oauth_url?: string | undefined;
Provider URL that the browser opens to continue the connection flow.
disconnectSocialConnection: (id: string) => Promise<ApiResult<unknown>>;
Disconnects an existing social connection.
getPasskeys: () => Promise<ApiResult<UserPasskey[]>>;
Lists the registered passkeys for the current user.
[].id?: string | undefined;
Passkey identifier.
[].name?: string | undefined;
Display name for the passkey.
[].created_at?: string | undefined;
Creation timestamp.
[].last_used_at?: string | null | undefined;
Last-used timestamp, or `null` when the passkey has not been used yet.
[].device_type?: string | undefined;
Device classification for the passkey.
[].backed_up?: boolean | undefined;
Whether the passkey is backed up by the platform authenticator.
registerPasskey: (name?: string) => Promise<ApiResult<unknown>>;
Starts and completes the browser WebAuthn registration flow for a new passkey.
renamePasskey: (id: string, name: string) => Promise<ApiResult<unknown>>;
Renames an existing passkey.
deletePasskey: (id: string) => Promise<ApiResult<unknown>>;
Deletes an existing passkey.
deleteAccount: (password: string) => Promise<ApiResult<unknown>>;
Deletes the current account after password confirmation.

useNavigation()

useNavigation() gives shared auth components one navigation surface across Next.js, React Router, and TanStack Router. It uses the active adapter when one is available, and it builds the hosted sign-in and sign-up targets from the current deployment settings.

export default function AuthActions() {  const { navigateToSignIn, navigateToSignUp } = useNavigation();  return (    <div className="flex gap-3">      <button onClick={() => navigateToSignIn()}>Sign in</button>      <button onClick={() => navigateToSignUp()}>Create account</button>    </div>  );}
navigate?: (to: string, options?: { replace?: boolean; state?: any }) => void | undefined;
Calls the adapter navigation function when the current framework exposes one. If there is no adapter navigate function, it falls back to assigning `window.location.href`.
replace?: boolean | undefined | undefined;
Replaces the current history entry when the adapter supports it.
state?: any | undefined;
Framework-specific navigation state passed through to the adapter.
navigateToSignIn?: (redirectUri?: string) => void | undefined;
Sends the user to the hosted sign-in page from the deployment UI settings and carries the current redirect target forward.
navigateToAccountSelection?: (redirectUri?: string) => void | undefined;
Sends the user to the hosted account-selection surface on the deployment frontend host.
navigateToSignUp?: (redirectUri?: string) => void | undefined;
Sends the user to the hosted sign-up page from the deployment UI settings and carries the current redirect target forward.