Auth
This is the main module to interact with Nhost’s Auth service. Typically you would use this module via the main Nhost client but you can also use it directly if you have a specific use case.
Import
Section titled “Import”You can import and use this package with:
import { createClient } from '@nhost/nhost-js/auth'import { createClient } from '@nhost/nhost-js'
const nhost = createClient({ subdomain, region})
await nhost.auth.signUpEmailPassword({ email, password})Error handling
Section titled “Error handling”The SDK will throw errors in most operations if the request returns a status >=300 or
if the request fails entirely (i.e., due to network errors). The type of the error
will be a FetchError<ErrorResponse>:
import { createClient } from '@nhost/nhost-js'import { FetchError } from '@nhost/nhost-js/fetch'
const nhost = createClient({ subdomain, region})
try { await nhost.auth.signInEmailPassword({ email, password })} catch (err) { if (!(err instanceof FetchError)) { throw err // Re-throw if it's not a FetchError }
console.log('Error:', err) // Error: { // body: { // error: 'invalid-email-password', // message: 'Incorrect email or password', // status: 401 // }, // status: 401, // headers: { // 'content-length': '88', // 'content-type': 'application/json', // date: 'Mon, 12 May 2025 08:08:28 GMT' // } // }
// error handling...}This type extends the standard Error type so if you want to just log the error you can
do so like this:
import { createClient } from '@nhost/nhost-js'import { FetchError } from '@nhost/nhost-js/fetch'
const nhost = createClient({ subdomain, region})
try { await nhost.auth.signInEmailPassword({ email, password })} catch (err) { if (!(err instanceof Error)) { throw err // Re-throw if it's not an Error }
console.log('Error:', err.message) // Error: Incorrect email or password}Interfaces
Section titled “Interfaces”AuthenticationExtensionsClientOutputs
Section titled “AuthenticationExtensionsClientOutputs”Map of extension outputs from the client
Properties
Section titled “Properties”appid?
Section titled “appid?”optional appid: boolean;Application identifier extension output
credProps?
Section titled “credProps?”optional credProps: CredentialPropertiesOutput;Credential properties extension output
hmacCreateSecret?
Section titled “hmacCreateSecret?”optional hmacCreateSecret: boolean;HMAC secret extension output
AuthenticatorAssertionResponse
Section titled “AuthenticatorAssertionResponse”Properties
Section titled “Properties”authenticatorData
Section titled “authenticatorData”authenticatorData: string(string) - Base64url encoded authenticator data
clientDataJSON
Section titled “clientDataJSON”clientDataJSON: string(string) - Base64url encoded client data JSON
signature
Section titled “signature”signature: string(string) - Base64url encoded assertion signature
userHandle?
Section titled “userHandle?”optional userHandle: string;Base64url encoded user handle
AuthenticatorAttestationResponse
Section titled “AuthenticatorAttestationResponse”Properties
Section titled “Properties”attestationObject
Section titled “attestationObject”attestationObject: string(string) - Base64url-encoded binary data
- Format - byte
authenticatorData?
Section titled “authenticatorData?”optional authenticatorData: string;Base64url-encoded binary data Format - byte
clientDataJSON
Section titled “clientDataJSON”clientDataJSON: string(string) - Base64url-encoded binary data
- Format - byte
publicKey?
Section titled “publicKey?”optional publicKey: string;Base64url-encoded binary data Format - byte
publicKeyAlgorithm?
Section titled “publicKeyAlgorithm?”optional publicKeyAlgorithm: number;The public key algorithm identifier Format - int64
transports?
Section titled “transports?”optional transports: string[];The authenticator transports
AuthenticatorSelection
Section titled “AuthenticatorSelection”Properties
Section titled “Properties”authenticatorAttachment?
Section titled “authenticatorAttachment?”optional authenticatorAttachment: AuthenticatorAttachment;The authenticator attachment modality
requireResidentKey?
Section titled “requireResidentKey?”optional requireResidentKey: boolean;Whether the authenticator must create a client-side-resident public key credential source
residentKey?
Section titled “residentKey?”optional residentKey: ResidentKeyRequirement;The resident key requirement
userVerification?
Section titled “userVerification?”optional userVerification: UserVerificationRequirement;A requirement for user verification for the operation
Client
Section titled “Client”Properties
Section titled “Properties”baseURL
Section titled “baseURL”baseURL: stringMethods
Section titled “Methods”addSecurityKey()
Section titled “addSecurityKey()”addSecurityKey(options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialCreationOptions>>;Summary: Initialize adding of a new webauthn security key Start the process of adding a new WebAuthn security key to the user’s account. Returns a challenge that must be completed by the user’s authenticator device. Requires elevated permissions.
This method may return different T based on the response code:
- 200: PublicKeyCredentialCreationOptions
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<PublicKeyCredentialCreationOptions>>
changeUserEmail()
Section titled “changeUserEmail()”changeUserEmail(body: UserEmailChangeRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Change user email Request to change the authenticated user’s email address. A verification email will be sent to the new address to confirm the change. Requires elevated permissions.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | UserEmailChangeRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
changeUserMfa()
Section titled “changeUserMfa()”changeUserMfa(options?: RequestInit): Promise<FetchResponse<TotpGenerateResponse>>;Summary: Generate TOTP secret Generate a Time-based One-Time Password (TOTP) secret for setting up multi-factor authentication
This method may return different T based on the response code:
- 200: TotpGenerateResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<TotpGenerateResponse>>
changeUserPassword()
Section titled “changeUserPassword()”changeUserPassword(body: UserPasswordRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Change user password Change the user’s password. The user must be authenticated with elevated permissions or provide a valid password reset ticket.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | UserPasswordRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
createPAT()
Section titled “createPAT()”createPAT(body: CreatePATRequest, options?: RequestInit): Promise<FetchResponse<CreatePATResponse>>;Summary: Create a Personal Access Token (PAT) Generate a new Personal Access Token for programmatic API access. PATs are long-lived tokens that can be used instead of regular authentication for automated systems. Requires elevated permissions.
This method may return different T based on the response code:
- 200: CreatePATResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | CreatePATRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<CreatePATResponse>>
deanonymizeUser()
Section titled “deanonymizeUser()”deanonymizeUser(body: UserDeanonymizeRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Deanonymize an anonymous user Convert an anonymous user to a regular user by adding email and optionally password credentials. A confirmation email will be sent if the server is configured to do so.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | UserDeanonymizeRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
elevateWebauthn()
Section titled “elevateWebauthn()”elevateWebauthn(options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialRequestOptions>>;Summary: Elevate access for an already signed in user using FIDO2 Webauthn Generate a Webauthn challenge for elevating user permissions
This method may return different T based on the response code:
- 200: PublicKeyCredentialRequestOptions
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<PublicKeyCredentialRequestOptions>>
getJWKs()
Section titled “getJWKs()”getJWKs(options?: RequestInit): Promise<FetchResponse<JWKSet>>;Summary: Get public keys for JWT verification in JWK Set format Retrieve the JSON Web Key Set (JWKS) containing public keys used to verify JWT signatures. This endpoint is used by clients to validate access tokens.
This method may return different T based on the response code:
- 200: JWKSet
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<JWKSet>>
getProviderTokens()
Section titled “getProviderTokens()”getProviderTokens(provider: SignInProvider, options?: RequestInit): Promise<FetchResponse<ProviderSession>>;Summary: Retrieve OAuth2 provider tokens from callback After successful OAuth2 authentication, retrieve the provider session containing access token, refresh token, and expiration information for the specified provider. To ensure the data isn’t stale this endpoint must be called immediately after the OAuth callback to obtain the tokens. The session is cleared from the database during this call, so subsequent calls will fail without going through the sign-in flow again. It is the user’s responsibility to store the session safely (e.g., in browser local storage).
This method may return different T based on the response code:
- 200: ProviderSession
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
provider | SignInProvider |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<ProviderSession>>
getUser()
Section titled “getUser()”getUser(options?: RequestInit): Promise<FetchResponse<User>>;Summary: Get user information Retrieve the authenticated user’s profile information including roles, metadata, and account status.
This method may return different T based on the response code:
- 200: User
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<User>>
getVersion()
Section titled “getVersion()”getVersion(options?: RequestInit): Promise<FetchResponse<GetVersionResponse200>>;Summary: Get service version Retrieve version information about the authentication service
This method may return different T based on the response code:
- 200: GetVersionResponse200
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<GetVersionResponse200>>
healthCheckGet()
Section titled “healthCheckGet()”healthCheckGet(options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Health check (GET) Verify if the authentication service is operational using GET method
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
healthCheckHead()
Section titled “healthCheckHead()”healthCheckHead(options?: RequestInit): Promise<FetchResponse<void>>;Summary: Health check (HEAD) Verify if the authentication service is operational using HEAD method
This method may return different T based on the response code:
- 200: void
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<void>>
linkIdToken()
Section titled “linkIdToken()”linkIdToken(body: LinkIdTokenRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Link a user account with the provider’s account using an id token Link the authenticated user’s account with an external OAuth provider account using an ID token. Requires elevated permissions.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | LinkIdTokenRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
pushChainFunction()
Section titled “pushChainFunction()”pushChainFunction(chainFunction: ChainFunction): void;Add a middleware function to the fetch chain
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
chainFunction | ChainFunction | The middleware function to add |
Returns
Section titled “Returns”void
refreshProviderToken()
Section titled “refreshProviderToken()”refreshProviderToken( provider: SignInProvider, body: RefreshProviderTokenRequest, options?: RequestInit): Promise<FetchResponse<ProviderSession>>;Summary: Refresh OAuth2 provider tokens Refresh the OAuth2 provider access token using a valid refresh token. Returns a new provider session with updated access token, refresh token (if rotated by provider), and expiration information. This endpoint allows maintaining long-lived access to provider APIs without requiring the user to re-authenticate.
This method may return different T based on the response code:
- 200: ProviderSession
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
provider | SignInProvider |
body | RefreshProviderTokenRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<ProviderSession>>
refreshToken()
Section titled “refreshToken()”refreshToken(body: RefreshTokenRequest, options?: RequestInit): Promise<FetchResponse<Session>>;Summary: Refresh access token Generate a new JWT access token using a valid refresh token. The refresh token used will be revoked and a new one will be issued.
This method may return different T based on the response code:
- 200: Session
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | RefreshTokenRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<Session>>
sendPasswordResetEmail()
Section titled “sendPasswordResetEmail()”sendPasswordResetEmail(body: UserPasswordResetRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Request password reset Request a password reset for a user account. An email with a verification link will be sent to the user’s email address to complete the password reset process.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | UserPasswordResetRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
sendVerificationEmail()
Section titled “sendVerificationEmail()”sendVerificationEmail(body: UserEmailSendVerificationEmailRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Send verification email Send an email verification link to the specified email address. Used to verify email addresses for new accounts or email changes.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | UserEmailSendVerificationEmailRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
signInAnonymous()
Section titled “signInAnonymous()”signInAnonymous(body?: SignInAnonymousRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Sign in anonymously Create an anonymous user session without providing credentials. Anonymous users can be converted to regular users later via the deanonymize endpoint.
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body? | SignInAnonymousRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
signInEmailPassword()
Section titled “signInEmailPassword()”signInEmailPassword(body: SignInEmailPasswordRequest, options?: RequestInit): Promise<FetchResponse<SignInEmailPasswordResponse>>;Summary: Sign in with email and password Authenticate a user with their email and password. Returns a session object or MFA challenge if two-factor authentication is enabled.
This method may return different T based on the response code:
- 200: SignInEmailPasswordResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInEmailPasswordRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SignInEmailPasswordResponse>>
signInIdToken()
Section titled “signInIdToken()”signInIdToken(body: SignInIdTokenRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Sign in with an ID token Authenticate using an ID token from a supported OAuth provider (Apple or Google). Creates a new user account if one doesn’t exist.
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInIdTokenRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
signInOTPEmail()
Section titled “signInOTPEmail()”signInOTPEmail(body: SignInOTPEmailRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Sign in with email OTP Initiate email-based one-time password authentication. Sends an OTP to the specified email address. If the user doesn’t exist, a new account will be created with the provided options.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInOTPEmailRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
signInPasswordlessEmail()
Section titled “signInPasswordlessEmail()”signInPasswordlessEmail(body: SignInPasswordlessEmailRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Sign in with magic link email Initiate passwordless authentication by sending a magic link to the user’s email. If the user doesn’t exist, a new account will be created with the provided options.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInPasswordlessEmailRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
signInPasswordlessSms()
Section titled “signInPasswordlessSms()”signInPasswordlessSms(body: SignInPasswordlessSmsRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Sign in with SMS OTP Initiate passwordless authentication by sending a one-time password to the user’s phone number. If the user doesn’t exist, a new account will be created with the provided options.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInPasswordlessSmsRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
signInPAT()
Section titled “signInPAT()”signInPAT(body: SignInPATRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Sign in with Personal Access Token (PAT) Authenticate using a Personal Access Token. PATs are long-lived tokens that can be used for programmatic access to the API.
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInPATRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
signInProviderURL()
Section titled “signInProviderURL()”signInProviderURL( provider: SignInProvider, params?: SignInProviderParams, options?: RequestInit): string;Summary: Sign in with an OAuth2 provider Initiate OAuth2 authentication flow with a social provider. Redirects the user to the provider’s authorization page.
As this method is a redirect, it returns a URL string instead of a Promise
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
provider | SignInProvider |
params? | SignInProviderParams |
options? | RequestInit |
Returns
Section titled “Returns”string
signInWebauthn()
Section titled “signInWebauthn()”signInWebauthn(body?: SignInWebauthnRequest, options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialRequestOptions>>;Summary: Sign in with Webauthn Initiate a Webauthn sign-in process by sending a challenge to the user’s device. The user must have previously registered a Webauthn credential.
This method may return different T based on the response code:
- 200: PublicKeyCredentialRequestOptions
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body? | SignInWebauthnRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<PublicKeyCredentialRequestOptions>>
signOut()
Section titled “signOut()”signOut(body: SignOutRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Sign out End the current user session by invalidating refresh tokens. Optionally sign out from all devices.
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignOutRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
signUpEmailPassword()
Section titled “signUpEmailPassword()”signUpEmailPassword(body: SignUpEmailPasswordRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Sign up with email and password Register a new user account with email and password. Returns a session if email verification is not required, otherwise returns null session.
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignUpEmailPasswordRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
signUpWebauthn()
Section titled “signUpWebauthn()”signUpWebauthn(body: SignUpWebauthnRequest, options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialCreationOptions>>;Summary: Sign up with Webauthn Initiate a Webauthn sign-up process by sending a challenge to the user’s device. The user must not have an existing account.
This method may return different T based on the response code:
- 200: PublicKeyCredentialCreationOptions
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignUpWebauthnRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<PublicKeyCredentialCreationOptions>>
verifyAddSecurityKey()
Section titled “verifyAddSecurityKey()”verifyAddSecurityKey(body: VerifyAddSecurityKeyRequest, options?: RequestInit): Promise<FetchResponse<VerifyAddSecurityKeyResponse>>;Summary: Verify adding of a new webauthn security key Complete the process of adding a new WebAuthn security key by verifying the authenticator response. Requires elevated permissions.
This method may return different T based on the response code:
- 200: VerifyAddSecurityKeyResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | VerifyAddSecurityKeyRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<VerifyAddSecurityKeyResponse>>
verifyChangeUserMfa()
Section titled “verifyChangeUserMfa()”verifyChangeUserMfa(body: UserMfaRequest, options?: RequestInit): Promise<FetchResponse<"OK">>;Summary: Manage multi-factor authentication Activate or deactivate multi-factor authentication for the authenticated user
This method may return different T based on the response code:
- 200: OKResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | UserMfaRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<"OK">>
verifyElevateWebauthn()
Section titled “verifyElevateWebauthn()”verifyElevateWebauthn(body: SignInWebauthnVerifyRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Verify FIDO2 Webauthn authentication using public-key cryptography for elevation Complete Webauthn elevation by verifying the authentication response
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInWebauthnVerifyRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
verifySignInMfaTotp()
Section titled “verifySignInMfaTotp()”verifySignInMfaTotp(body: SignInMfaTotpRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Verify TOTP for MFA Complete the multi-factor authentication by verifying a Time-based One-Time Password (TOTP). Returns a session if validation is successful.
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInMfaTotpRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
verifySignInOTPEmail()
Section titled “verifySignInOTPEmail()”verifySignInOTPEmail(body: SignInOTPEmailVerifyRequest, options?: RequestInit): Promise<FetchResponse<SignInOTPEmailVerifyResponse>>;Summary: Verify email OTP Complete email OTP authentication by verifying the one-time password. Returns a session if validation is successful.
This method may return different T based on the response code:
- 200: SignInOTPEmailVerifyResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInOTPEmailVerifyRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SignInOTPEmailVerifyResponse>>
verifySignInPasswordlessSms()
Section titled “verifySignInPasswordlessSms()”verifySignInPasswordlessSms(body: SignInPasswordlessSmsOtpRequest, options?: RequestInit): Promise<FetchResponse<SignInPasswordlessSmsOtpResponse>>;Summary: Verify SMS OTP Complete passwordless SMS authentication by verifying the one-time password. Returns a session if validation is successful.
This method may return different T based on the response code:
- 200: SignInPasswordlessSmsOtpResponse
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInPasswordlessSmsOtpRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SignInPasswordlessSmsOtpResponse>>
verifySignInWebauthn()
Section titled “verifySignInWebauthn()”verifySignInWebauthn(body: SignInWebauthnVerifyRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Verify Webauthn sign-in Complete the Webauthn sign-in process by verifying the response from the user’s device. Returns a session if validation is successful.
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignInWebauthnVerifyRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
verifySignUpWebauthn()
Section titled “verifySignUpWebauthn()”verifySignUpWebauthn(body: SignUpWebauthnVerifyRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;Summary: Verify Webauthn sign-up Complete the Webauthn sign-up process by verifying the response from the user’s device. Returns a session if validation is successful.
This method may return different T based on the response code:
- 200: SessionPayload
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body | SignUpWebauthnVerifyRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<SessionPayload>>
verifyTicketURL()
Section titled “verifyTicketURL()”verifyTicketURL(params?: VerifyTicketParams, options?: RequestInit): string;Summary: Verify email and authentication tickets Verify tickets created by email verification, magic link authentication, or password reset processes. Redirects the user to the appropriate destination upon successful verification.
As this method is a redirect, it returns a URL string instead of a Promise
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
params? | VerifyTicketParams |
options? | RequestInit |
Returns
Section titled “Returns”string
verifyToken()
Section titled “verifyToken()”verifyToken(body?: VerifyTokenRequest, options?: RequestInit): Promise<FetchResponse<string>>;Summary: Verify JWT token Verify the validity of a JWT access token. If no request body is provided, the Authorization header will be used for verification.
This method may return different T based on the response code:
- 200: string
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
body? | VerifyTokenRequest |
options? | RequestInit |
Returns
Section titled “Returns”Promise<FetchResponse<string>>
CreatePATRequest
Section titled “CreatePATRequest”Properties
Section titled “Properties”expiresAt
Section titled “expiresAt”expiresAt: string(string) - Expiration date of the PAT
- Format - date-time
metadata?
Section titled “metadata?”optional metadata: Record<string, unknown>;Example - {"name":"my-pat","used-by":"my-app-cli"}
CreatePATResponse
Section titled “CreatePATResponse”Properties
Section titled “Properties”id: string(string) - ID of the PAT
- Example -
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24" - Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
personalAccessToken
Section titled “personalAccessToken”personalAccessToken: string(string) - PAT
- Example -
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24" - Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
CredentialAssertionResponse
Section titled “CredentialAssertionResponse”Properties
Section titled “Properties”authenticatorAttachment?
Section titled “authenticatorAttachment?”optional authenticatorAttachment: string;The authenticator attachment
clientExtensionResults?
Section titled “clientExtensionResults?”optional clientExtensionResults: AuthenticationExtensionsClientOutputs;Map of extension outputs from the client
id: string(string) - The credential’s identifier
rawId: string(string) - Base64url-encoded binary data
- Format - byte
response
Section titled “response”response: AuthenticatorAssertionResponse(AuthenticatorAssertionResponse) -
type: string(string) - The credential type represented by this object
CredentialCreationResponse
Section titled “CredentialCreationResponse”Properties
Section titled “Properties”authenticatorAttachment?
Section titled “authenticatorAttachment?”optional authenticatorAttachment: string;The authenticator attachment
clientExtensionResults?
Section titled “clientExtensionResults?”optional clientExtensionResults: AuthenticationExtensionsClientOutputs;Map of extension outputs from the client
id: string(string) - The credential’s identifier
rawId: string(string) - Base64url-encoded binary data
- Format - byte
response
Section titled “response”response: AuthenticatorAttestationResponse(AuthenticatorAttestationResponse) -
type: string(string) - The credential type represented by this object
CredentialParameter
Section titled “CredentialParameter”Properties
Section titled “Properties”alg: number(number) - The cryptographic algorithm identifier
type: 'public-key'(CredentialType) - The valid credential types
CredentialPropertiesOutput
Section titled “CredentialPropertiesOutput”Credential properties extension output
Properties
Section titled “Properties”optional rk: boolean;Indicates if the credential is a resident key
ErrorResponse
Section titled “ErrorResponse”Standardized error response
Properties
Section titled “Properties”error: ErrorResponseError(ErrorResponseError) - Error code identifying the specific application error
message
Section titled “message”message: string(string) - Human-friendly error message
- Example -
"Invalid email format"
status
Section titled “status”status: number(number) - HTTP status error code
- Example -
400
GetVersionResponse200
Section titled “GetVersionResponse200”Properties
Section titled “Properties”version
Section titled “version”version: string(string) - The version of the authentication service
- Example -
"1.2.3"
JSON Web Key for JWT verification
Properties
Section titled “Properties”alg: string(string) - Algorithm used with this key
- Example -
"RS256"
e: string(string) - RSA public exponent
- Example -
"AQAB"
kid: string(string) - Key ID
- Example -
"key-id-1"
kty: string(string) - Key type
- Example -
"RSA"
n: string(string) - RSA modulus
- Example -
"abcd1234..."
use: string(string) - Key usage
- Example -
"sig"
JWKSet
Section titled “JWKSet”JSON Web Key Set for verifying JWT signatures
Properties
Section titled “Properties”keys: JWK[];(JWK[]) - Array of public keys
LinkIdTokenRequest
Section titled “LinkIdTokenRequest”Properties
Section titled “Properties”idToken
Section titled “idToken”idToken: string(string) - Apple ID token
nonce?
Section titled “nonce?”optional nonce: string;Nonce used during sign in process
provider
Section titled “provider”provider: IdTokenProvider(IdTokenProvider) -
MFAChallengePayload
Section titled “MFAChallengePayload”Challenge payload for multi-factor authentication
Properties
Section titled “Properties”ticket
Section titled “ticket”ticket: string(string) - Ticket to use when completing the MFA challenge
- Example -
"mfaTotp:abc123def456"
OptionsRedirectTo
Section titled “OptionsRedirectTo”Properties
Section titled “Properties”redirectTo?
Section titled “redirectTo?”optional redirectTo: string;Example - "https://my-app.com/catch-redirection"
Format - uri
ProviderSession
Section titled “ProviderSession”OAuth2 provider session containing access and refresh tokens
Properties
Section titled “Properties”accessToken
Section titled “accessToken”accessToken: string(string) - OAuth2 provider access token for API calls
- Example -
"ya29.a0AfH6SMBx..."
expiresAt
Section titled “expiresAt”expiresAt: string(string) - Timestamp when the access token expires
- Example -
"2024-12-31T23:59:59Z" - Format - date-time
expiresIn
Section titled “expiresIn”expiresIn: number(number) - Number of seconds until the access token expires
- Example -
3599
refreshToken?
Section titled “refreshToken?”optional refreshToken: string;OAuth2 provider refresh token for obtaining new access tokens (if provided by the provider)
Example - "1//0gK8..."
ProviderSpecificParams
Section titled “ProviderSpecificParams”Properties
Section titled “Properties”connection?
Section titled “connection?”optional connection: string;(workos) Specifies the connection to use for authentication
organization?
Section titled “organization?”optional organization: string;(workos) Specifies the organization to use for authentication
PublicKeyCredentialCreationOptions
Section titled “PublicKeyCredentialCreationOptions”Properties
Section titled “Properties”attestation?
Section titled “attestation?”optional attestation: ConveyancePreference;The attestation conveyance preference
attestationFormats?
Section titled “attestationFormats?”optional attestationFormats: AttestationFormat[];The preferred attestation statement formats
authenticatorSelection?
Section titled “authenticatorSelection?”optional authenticatorSelection: AuthenticatorSelection;challenge
Section titled “challenge”challenge: string(string) - Base64url-encoded binary data
- Format - byte
excludeCredentials?
Section titled “excludeCredentials?”optional excludeCredentials: PublicKeyCredentialDescriptor[];A list of PublicKeyCredentialDescriptor objects representing public key credentials that are not acceptable to the caller
extensions?
Section titled “extensions?”optional extensions: Record<string, unknown>;Additional parameters requesting additional processing by the client and authenticator
hints?
Section titled “hints?”optional hints: PublicKeyCredentialHints[];Hints to help guide the user through the experience
pubKeyCredParams
Section titled “pubKeyCredParams”pubKeyCredParams: CredentialParameter[];(CredentialParameter[]) - The desired credential types and their respective cryptographic parameters
rp: RelyingPartyEntity(RelyingPartyEntity) -
timeout?
Section titled “timeout?”optional timeout: number;A time, in milliseconds, that the caller is willing to wait for the call to complete
user: UserEntity(UserEntity) -
PublicKeyCredentialDescriptor
Section titled “PublicKeyCredentialDescriptor”Properties
Section titled “Properties”id: string(string) - Base64url-encoded binary data
- Format - byte
transports?
Section titled “transports?”optional transports: AuthenticatorTransport[];The authenticator transports that can be used
type: 'public-key'(CredentialType) - The valid credential types
PublicKeyCredentialRequestOptions
Section titled “PublicKeyCredentialRequestOptions”Properties
Section titled “Properties”allowCredentials?
Section titled “allowCredentials?”optional allowCredentials: PublicKeyCredentialDescriptor[];A list of CredentialDescriptor objects representing public key credentials acceptable to the caller
challenge
Section titled “challenge”challenge: string(string) - Base64url-encoded binary data
- Format - byte
extensions?
Section titled “extensions?”optional extensions: Record<string, unknown>;Additional parameters requesting additional processing by the client and authenticator
hints?
Section titled “hints?”optional hints: PublicKeyCredentialHints[];Hints to help guide the user through the experience
optional rpId: string;The RP ID the credential should be scoped to
timeout?
Section titled “timeout?”optional timeout: number;A time, in milliseconds, that the caller is willing to wait for the call to complete
userVerification?
Section titled “userVerification?”optional userVerification: UserVerificationRequirement;A requirement for user verification for the operation
RefreshProviderTokenRequest
Section titled “RefreshProviderTokenRequest”Request to refresh OAuth2 provider tokens
Properties
Section titled “Properties”refreshToken
Section titled “refreshToken”refreshToken: string(string) - OAuth2 provider refresh token obtained from previous authentication
- Example -
"1//0gK8..."
RefreshTokenRequest
Section titled “RefreshTokenRequest”Request to refresh an access token
Properties
Section titled “Properties”refreshToken
Section titled “refreshToken”refreshToken: string(string) - Refresh token used to generate a new access token
- Example -
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24" - Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
RelyingPartyEntity
Section titled “RelyingPartyEntity”Properties
Section titled “Properties”id: string(string) - A unique identifier for the Relying Party entity, which sets the RP ID
name: string(string) - A human-palatable name for the entity
Session
Section titled “Session”User authentication session containing tokens and user information
Extended by
Section titled “Extended by”Properties
Section titled “Properties”accessToken
Section titled “accessToken”accessToken: string(string) - JWT token for authenticating API requests
- Example -
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
accessTokenExpiresIn
Section titled “accessTokenExpiresIn”accessTokenExpiresIn: number(number) - Expiration time of the access token in seconds
- Example -
900 - Format - int64
refreshToken
Section titled “refreshToken”refreshToken: string(string) - Token used to refresh the access token
- Example -
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24" - Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
refreshTokenId
Section titled “refreshTokenId”refreshTokenId: string(string) - Identifier for the refresh token
- Example -
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24" - Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
optional user: User;User profile and account information
SessionPayload
Section titled “SessionPayload”Container for session information
Properties
Section titled “Properties”session?
Section titled “session?”optional session: Session;User authentication session containing tokens and user information
SignInAnonymousRequest
Section titled “SignInAnonymousRequest”Properties
Section titled “Properties”displayName?
Section titled “displayName?”optional displayName: string;Example - "John Smith"
locale?
Section titled “locale?”optional locale: string;A two or three characters locale
Example - "en"
MinLength - 2
MaxLength - 3
metadata?
Section titled “metadata?”optional metadata: Record<string, unknown>;Example - {"firstName":"John","lastName":"Smith"}
SignInEmailPasswordRequest
Section titled “SignInEmailPasswordRequest”Request to authenticate using email and password
Properties
Section titled “Properties”email: string(string) - User’s email address
- Example -
"[email protected]" - Format - email
password
Section titled “password”password: string(string) - User’s password
- Example -
"Str0ngPassw#ord-94|%" - MinLength - 3
- MaxLength - 50
SignInEmailPasswordResponse
Section titled “SignInEmailPasswordResponse”Response for email-password authentication that may include a session or MFA challenge
Properties
Section titled “Properties”optional mfa: MFAChallengePayload;Challenge payload for multi-factor authentication
session?
Section titled “session?”optional session: Session;User authentication session containing tokens and user information
SignInIdTokenRequest
Section titled “SignInIdTokenRequest”Properties
Section titled “Properties”idToken
Section titled “idToken”idToken: string(string) - Apple ID token
nonce?
Section titled “nonce?”optional nonce: string;Nonce used during sign in process
options?
Section titled “options?”optional options: SignUpOptions;provider
Section titled “provider”provider: IdTokenProvider(IdTokenProvider) -
SignInMfaTotpRequest
Section titled “SignInMfaTotpRequest”Properties
Section titled “Properties”otp: string(string) - One time password
ticket
Section titled “ticket”ticket: string(string) - Ticket
- Pattern - ^mfaTotp:.*$
SignInOTPEmailRequest
Section titled “SignInOTPEmailRequest”Properties
Section titled “Properties”email: string(string) - A valid email
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: SignUpOptions;SignInOTPEmailVerifyRequest
Section titled “SignInOTPEmailVerifyRequest”Properties
Section titled “Properties”email: string(string) - A valid email
- Example -
"[email protected]" - Format - email
otp: string(string) - One time password
SignInOTPEmailVerifyResponse
Section titled “SignInOTPEmailVerifyResponse”Properties
Section titled “Properties”session?
Section titled “session?”optional session: Session;User authentication session containing tokens and user information
SignInPasswordlessEmailRequest
Section titled “SignInPasswordlessEmailRequest”Properties
Section titled “Properties”email: string(string) - A valid email
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: SignUpOptions;SignInPasswordlessSmsOtpRequest
Section titled “SignInPasswordlessSmsOtpRequest”Properties
Section titled “Properties”otp: string(string) - One-time password received by SMS
phoneNumber
Section titled “phoneNumber”phoneNumber: string(string) - Phone number of the user
- Example -
"+123456789"
SignInPasswordlessSmsOtpResponse
Section titled “SignInPasswordlessSmsOtpResponse”Properties
Section titled “Properties”optional mfa: MFAChallengePayload;Challenge payload for multi-factor authentication
session?
Section titled “session?”optional session: Session;User authentication session containing tokens and user information
SignInPasswordlessSmsRequest
Section titled “SignInPasswordlessSmsRequest”Properties
Section titled “Properties”options?
Section titled “options?”optional options: SignUpOptions;phoneNumber
Section titled “phoneNumber”phoneNumber: string(string) - Phone number of the user
- Example -
"+123456789"
SignInPATRequest
Section titled “SignInPATRequest”Properties
Section titled “Properties”personalAccessToken
Section titled “personalAccessToken”personalAccessToken: string(string) - PAT
- Example -
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24" - Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
SignInProviderParams
Section titled “SignInProviderParams”Parameters for the signInProvider method.
Properties
Section titled “Properties”allowedRoles?
Section titled “allowedRoles?”optional allowedRoles: string[];Array of allowed roles for the user
connect?
Section titled “connect?”optional connect: string;If set, this means that the user is already authenticated and wants to link their account. This needs to be a valid JWT access token.
defaultRole?
Section titled “defaultRole?”optional defaultRole: string;Default role for the user
displayName?
Section titled “displayName?”optional displayName: string;Display name for the user
locale?
Section titled “locale?”optional locale: string;A two or three characters locale
metadata?
Section titled “metadata?”optional metadata: Record<string, unknown>;Additional metadata for the user (JSON encoded string)
providerSpecificParams?
Section titled “providerSpecificParams?”optional providerSpecificParams: ProviderSpecificParams;Additional provider-specific parameters
redirectTo?
Section titled “redirectTo?”optional redirectTo: string;URI to redirect to
state?
Section titled “state?”optional state: string;Opaque state value to be returned by the provider
SignInWebauthnRequest
Section titled “SignInWebauthnRequest”Properties
Section titled “Properties”email?
Section titled “email?”optional email: string;A valid email
Example - "[email protected]"
Format - email
SignInWebauthnVerifyRequest
Section titled “SignInWebauthnVerifyRequest”Properties
Section titled “Properties”credential
Section titled “credential”credential: CredentialAssertionResponse(CredentialAssertionResponse) -
email?
Section titled “email?”optional email: string;A valid email. Deprecated, no longer used
Example - "[email protected]"
Format - email
SignOutRequest
Section titled “SignOutRequest”Properties
Section titled “Properties”optional all: boolean;Sign out from all connected devices
refreshToken?
Section titled “refreshToken?”optional refreshToken: string;Refresh token for the current session
SignUpEmailPasswordRequest
Section titled “SignUpEmailPasswordRequest”Request to register a new user with email and password
Properties
Section titled “Properties”email: string(string) - Email address for the new user account
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: SignUpOptions;password
Section titled “password”password: string(string) - Password for the new user account
- Example -
"Str0ngPassw#ord-94|%" - MinLength - 3
- MaxLength - 50
SignUpOptions
Section titled “SignUpOptions”Properties
Section titled “Properties”allowedRoles?
Section titled “allowedRoles?”optional allowedRoles: string[];Example - ["me","user"]
defaultRole?
Section titled “defaultRole?”optional defaultRole: string;Example - "user"
displayName?
Section titled “displayName?”optional displayName: string;Example - "John Smith"
Pattern - ^[\p{L}\p{N}\p{S} ,.’-]+$
MaxLength - 32
locale?
Section titled “locale?”optional locale: string;A two or three characters locale
Example - "en"
MinLength - 2
MaxLength - 3
metadata?
Section titled “metadata?”optional metadata: Record<string, unknown>;Example - {"firstName":"John","lastName":"Smith"}
redirectTo?
Section titled “redirectTo?”optional redirectTo: string;Example - "https://my-app.com/catch-redirection"
Format - uri
SignUpWebauthnRequest
Section titled “SignUpWebauthnRequest”Properties
Section titled “Properties”email: string(string) - A valid email
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: SignUpOptions;SignUpWebauthnVerifyRequest
Section titled “SignUpWebauthnVerifyRequest”Properties
Section titled “Properties”credential
Section titled “credential”credential: CredentialCreationResponse(CredentialCreationResponse) -
nickname?
Section titled “nickname?”optional nickname: string;Nickname for the security key
options?
Section titled “options?”optional options: SignUpOptions;TotpGenerateResponse
Section titled “TotpGenerateResponse”Response containing TOTP setup information for MFA
Properties
Section titled “Properties”imageUrl
Section titled “imageUrl”imageUrl: string(string) - URL to QR code image for scanning with an authenticator app
- Example -
"data:image/png;base64,iVBORw0KGg..."
totpSecret
Section titled “totpSecret”totpSecret: string(string) - TOTP secret key for manual setup with an authenticator app
- Example -
"ABCDEFGHIJK23456"
User profile and account information
Properties
Section titled “Properties”activeMfaType?
Section titled “activeMfaType?”optional activeMfaType: string;Active MFA type for the user
avatarUrl
Section titled “avatarUrl”avatarUrl: string(string) - URL to the user’s profile picture
- Example -
"https://myapp.com/avatars/user123.jpg"
createdAt
Section titled “createdAt”createdAt: string(string) - Timestamp when the user account was created
- Example -
"2023-01-15T12:34:56Z" - Format - date-time
defaultRole
Section titled “defaultRole”defaultRole: string(string) - Default authorization role for the user
- Example -
"user"
displayName
Section titled “displayName”displayName: string(string) - User’s display name
- Example -
"John Smith"
email?
Section titled “email?”optional email: string;User’s email address
Example - "[email protected]"
Format - email
emailVerified
Section titled “emailVerified”emailVerified: boolean(boolean) - Whether the user’s email has been verified
- Example -
true
id: string(string) - Unique identifier for the user
- Example -
"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24" - Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
isAnonymous
Section titled “isAnonymous”isAnonymous: boolean(boolean) - Whether this is an anonymous user account
- Example -
false
locale
Section titled “locale”locale: string(string) - User’s preferred locale (language code)
- Example -
"en" - MinLength - 2
- MaxLength - 3
metadata
Section titled “metadata”metadata: Record<string, unknown>(Record<string, unknown>) - Custom metadata associated with the user
- Example -
{"firstName":"John","lastName":"Smith"}
phoneNumber?
Section titled “phoneNumber?”optional phoneNumber: string;User’s phone number
Example - "+12025550123"
phoneNumberVerified
Section titled “phoneNumberVerified”phoneNumberVerified: boolean(boolean) - Whether the user’s phone number has been verified
- Example -
false
roles: string[];(string[]) - List of roles assigned to the user
- Example -
["user","customer"]
UserDeanonymizeRequest
Section titled “UserDeanonymizeRequest”Properties
Section titled “Properties”connection?
Section titled “connection?”optional connection: string;Deprecated, will be ignored
email: string(string) - A valid email
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: SignUpOptions;password?
Section titled “password?”optional password: string;A password of minimum 3 characters
Example - "Str0ngPassw#ord-94|%"
MinLength - 3
MaxLength - 50
signInMethod
Section titled “signInMethod”signInMethod: UserDeanonymizeRequestSignInMethod(UserDeanonymizeRequestSignInMethod) - Which sign-in method to use
UserEmailChangeRequest
Section titled “UserEmailChangeRequest”Properties
Section titled “Properties”newEmail
Section titled “newEmail”newEmail: string(string) - A valid email
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: OptionsRedirectTo;UserEmailSendVerificationEmailRequest
Section titled “UserEmailSendVerificationEmailRequest”Properties
Section titled “Properties”email: string(string) - A valid email
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: OptionsRedirectTo;UserEntity
Section titled “UserEntity”Properties
Section titled “Properties”displayName
Section titled “displayName”displayName: string(string) - A human-palatable name for the user account, intended only for display
id: string(string) - The user handle of the user account entity
name: string(string) - A human-palatable name for the entity
UserMfaRequest
Section titled “UserMfaRequest”Request to activate or deactivate multi-factor authentication
Properties
Section titled “Properties”activeMfaType?
Section titled “activeMfaType?”optional activeMfaType: UserMfaRequestActiveMfaType;Type of MFA to activate. Use empty string to disable MFA.
Example - "totp"
code: string(string) - Verification code from the authenticator app when activating MFA
- Example -
"123456"
UserPasswordRequest
Section titled “UserPasswordRequest”Properties
Section titled “Properties”newPassword
Section titled “newPassword”newPassword: string(string) - A password of minimum 3 characters
- Example -
"Str0ngPassw#ord-94|%" - MinLength - 3
- MaxLength - 50
ticket?
Section titled “ticket?”optional ticket: string;Ticket to reset the password, required if the user is not authenticated Pattern - ^passwordReset:.*$
UserPasswordResetRequest
Section titled “UserPasswordResetRequest”Properties
Section titled “Properties”email: string(string) - A valid email
- Example -
"[email protected]" - Format - email
options?
Section titled “options?”optional options: OptionsRedirectTo;VerifyAddSecurityKeyRequest
Section titled “VerifyAddSecurityKeyRequest”Properties
Section titled “Properties”credential
Section titled “credential”credential: CredentialCreationResponse(CredentialCreationResponse) -
nickname?
Section titled “nickname?”optional nickname: string;Optional nickname for the security key
VerifyAddSecurityKeyResponse
Section titled “VerifyAddSecurityKeyResponse”Properties
Section titled “Properties”id: string(string) - The ID of the newly added security key
- Example -
"123e4567-e89b-12d3-a456-426614174000"
nickname?
Section titled “nickname?”optional nickname: string;The nickname of the security key if provided
VerifyTicketParams
Section titled “VerifyTicketParams”Parameters for the verifyTicket method.
Properties
Section titled “Properties”redirectTo
Section titled “redirectTo”redirectTo: string(RedirectToQuery) - Target URL for the redirect
- Target URL for the redirect
ticket
Section titled “ticket”ticket: string(TicketQuery) - Ticket
- Ticket
optional type: TicketTypeQuery;Type of the ticket. Deprecated, no longer used
- Type of the ticket
VerifyTokenRequest
Section titled “VerifyTokenRequest”Properties
Section titled “Properties”token?
Section titled “token?”optional token: string;JWT token to verify
Type Aliases
Section titled “Type Aliases”AttestationFormat
Section titled “AttestationFormat”type AttestationFormat = | 'packed' | 'tpm' | 'android-key' | 'android-safetynet' | 'fido-u2f' | 'apple' | 'none'The attestation statement format
AuthenticatorAttachment
Section titled “AuthenticatorAttachment”type AuthenticatorAttachment = 'platform' | 'cross-platform'The authenticator attachment modality
AuthenticatorTransport
Section titled “AuthenticatorTransport”type AuthenticatorTransport = 'usb' | 'nfc' | 'ble' | 'smart-card' | 'hybrid' | 'internal'The authenticator transports that can be used
ConveyancePreference
Section titled “ConveyancePreference”type ConveyancePreference = 'none' | 'indirect' | 'direct' | 'enterprise'The attestation conveyance preference
CredentialType
Section titled “CredentialType”type CredentialType = 'public-key'The valid credential types
ErrorResponseError
Section titled “ErrorResponseError”type ErrorResponseError = | 'default-role-must-be-in-allowed-roles' | 'disabled-endpoint' | 'disabled-user' | 'email-already-in-use' | 'email-already-verified' | 'forbidden-anonymous' | 'internal-server-error' | 'invalid-email-password' | 'invalid-request' | 'locale-not-allowed' | 'password-too-short' | 'password-in-hibp-database' | 'redirectTo-not-allowed' | 'role-not-allowed' | 'signup-disabled' | 'unverified-user' | 'user-not-anonymous' | 'invalid-pat' | 'invalid-refresh-token' | 'invalid-ticket' | 'disabled-mfa-totp' | 'no-totp-secret' | 'invalid-totp' | 'mfa-type-not-found' | 'totp-already-active' | 'invalid-state' | 'oauth-token-echange-failed' | 'oauth-profile-fetch-failed' | 'oauth-provider-error' | 'invalid-otp' | 'cannot-send-sms' | 'provider-account-already-linked'Error code identifying the specific application error
IdTokenProvider
Section titled “IdTokenProvider”type IdTokenProvider = 'apple' | 'google'OKResponse
Section titled “OKResponse”type OKResponse = 'OK'PublicKeyCredentialHints
Section titled “PublicKeyCredentialHints”type PublicKeyCredentialHints = 'security-key' | 'client-device' | 'hybrid'Hints to help guide the user through the experience
RedirectToQuery
Section titled “RedirectToQuery”type RedirectToQuery = stringTarget URL for the redirect
ResidentKeyRequirement
Section titled “ResidentKeyRequirement”type ResidentKeyRequirement = 'discouraged' | 'preferred' | 'required'The resident key requirement
SignInProvider
Section titled “SignInProvider”type SignInProvider = | 'apple' | 'github' | 'google' | 'linkedin' | 'discord' | 'spotify' | 'twitch' | 'gitlab' | 'bitbucket' | 'workos' | 'azuread' | 'entraid' | 'strava' | 'facebook' | 'windowslive' | 'twitter'TicketQuery
Section titled “TicketQuery”type TicketQuery = stringTicket
TicketTypeQuery
Section titled “TicketTypeQuery”type TicketTypeQuery = 'emailVerify' | 'emailConfirmChange' | 'signinPasswordless' | 'passwordReset'Type of the ticket
URLEncodedBase64
Section titled “URLEncodedBase64”type URLEncodedBase64 = stringBase64url-encoded binary data
UserDeanonymizeRequestSignInMethod
Section titled “UserDeanonymizeRequestSignInMethod”type UserDeanonymizeRequestSignInMethod = 'email-password' | 'passwordless'Which sign-in method to use
UserMfaRequestActiveMfaType
Section titled “UserMfaRequestActiveMfaType”type UserMfaRequestActiveMfaType = 'totp' | ''Type of MFA to activate. Use empty string to disable MFA.
UserVerificationRequirement
Section titled “UserVerificationRequirement”type UserVerificationRequirement = 'required' | 'preferred' | 'discouraged'A requirement for user verification for the operation
Functions
Section titled “Functions”createAPIClient()
Section titled “createAPIClient()”function createAPIClient(baseURL: string, chainFunctions: ChainFunction[]): ClientParameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
baseURL | string | undefined |
chainFunctions | ChainFunction[] | [] |