Defined in node_modules/@auth0/auth0-auth-js/dist/index.d.ts:3582
Properties
-
+
Optionalcause
cause?:AnonymousSessionApiErrorResponse
The raw error response from Auth0, if available.
-
+
Defined in node_modules/@auth0/auth0-auth-js/dist/index.d.ts:3581
+
code
code:string
Machine-readable error code identifying the failure reason.
Maps to the error field in the Auth0 API response.
-
-
message
-
message:string
-
-
name
-
name:string
-
-
Optionalstack
-
stack?:string
-
-
StaticstackTraceLimit
-
stackTraceLimit:number
-
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
-
+
Defined in node_modules/@auth0/auth0-spa-js/dist/typings/errors.d.ts:23
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
a();
-
-
-
-
-
Parameters
-
-
targetObject: object
-
OptionalconstructorOpt: Function
-
Returns void
-
+
StaticfromPayload
-
-
+
+
fromPayload( Â Â Â Â __namedParameters:{error:string;error_description:string}, ):MfaError
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
-
+
Defined in node_modules/@auth0/auth0-spa-js/dist/typings/errors.d.ts:23
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
a();
-
-
-
-
-
Parameters
-
-
targetObject: object
-
OptionalconstructorOpt: Function
-
Returns void
-
+
StaticfromPayload
-
-
+
+
fromPayload( Â Â Â Â __namedParameters:{error:string;error_description:string}, ):MfaError
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
-
+
Defined in node_modules/@auth0/auth0-spa-js/dist/typings/errors.d.ts:23
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
a();
-
-
-
-
-
Parameters
-
-
targetObject: object
-
OptionalconstructorOpt: Function
-
Returns void
-
+
StaticfromPayload
-
-
+
+
fromPayload( Â Â Â Â __namedParameters:{error:string;error_description:string}, ):MfaError
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
-
+
Defined in node_modules/@auth0/auth0-spa-js/dist/typings/errors.d.ts:23
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
a();
-
-
-
-
-
Parameters
-
-
targetObject: object
-
OptionalconstructorOpt: Function
-
Returns void
-
+
StaticfromPayload
-
-
+
+
fromPayload( Â Â Â Â __namedParameters:{error:string;error_description:string}, ):MfaError
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
-
+
Defined in node_modules/@auth0/auth0-spa-js/dist/typings/errors.d.ts:23
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
a();
-
-
-
-
-
Parameters
-
-
targetObject: object
-
OptionalconstructorOpt: Function
-
Returns void
-
+
StaticfromPayload
-
-
+
+
fromPayload( Â Â Â Â __namedParameters:{error:string;error_description:string}, ):MfaError
Human-readable explanation specific to this occurrence
-
-
message
-
message:string
-
-
name
-
name:string
-
-
Optionalstack
-
stack?:string
-
+
Readonlystatus
status:number
HTTP status code
-
+
Readonlytitle
title:string
Short human-readable summary of the error
-
+
Readonlytype
type:string
RFC 7807 error type identifier
-
+
OptionalReadonlyvalidation_errors
validation_errors?:{ Â Â Â Â detail:string; Â Â Â Â field?:string; Â Â Â Â pointer?:string; Â Â Â Â source?:string; }[]
Field-level validation errors, if present
-
-
StaticstackTraceLimit
-
stackTraceLimit:number
-
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
The Error.stackTraceLimit property specifies the number of stack frames
-collected by a stack trace (whether generated by new Error().stack or
-Error.captureStackTrace(obj)).
-
The default value is 10 but may be set to any valid JavaScript number. Changes
-will affect any stack trace captured after the value has been changed.
-
If set to a non-number value, or set to a negative number, stack traces will
-not capture any frames.
Creates a .stack property on targetObject, which when accessed returns
-a string representing the location in the code at which
-Error.captureStackTrace() was called.
-
constmyObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack`
-
-
-
The first line of the trace will be prefixed with
-${myObject.name}: ${myObject.message}.
-
The optional constructorOpt argument accepts a function. If given, all frames
-above constructorOpt, including constructorOpt, will be omitted from the
-generated stack trace.
-
The constructorOpt argument is useful for hiding implementation
-details of error generation from the user. For instance:
-
functiona() { b(); }
functionb() { c(); }
functionc() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; consterror = newError(); Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throwerror; }
Thrown by signup() when the server requires identifier verification before
+passkey creation. Catch this error, collect OTP codes for each identifier in
+verificationRequired, then call passkey.continueSignup(codes) to complete
+the flow. The SDK retains the auth session internally — you do not need to
+pass it yourself.
createFetcher:<TOutputextendsCustomFetchMinimalOutput=Response>( Â Â Â Â config?:FetcherConfig<TOutput>, )=>Fetcher<TOutput>
-
Returns a new Fetcher class that will contain a fetchWithAuth() method.
-This is a drop-in replacement for the Fetch API's fetch() method, but will
-handle certain authentication logic for you, like building the proper auth
-headers or managing DPoP nonces and retries automatically.
-
Check the EXAMPLES.md file for a deeper look into this method.
-
-
-
Type Declaration
-
-
-
-
<TOutputextendsCustomFetchMinimalOutput=Response>( Â Â Â Â config?:FetcherConfig<TOutput>, ):Fetcher<TOutput>
-
-
Returns a new Fetcher class that will contain a fetchWithAuth() method.
-This is a drop-in replacement for the Fetch API's fetch() method, but will
-handle certain authentication logic for you, like building the proper auth
-headers or managing DPoP nonces and retries automatically.
-
Check the EXAMPLES.md file for a deeper look into this method.
true while the SDK is initialising or a redirect callback is being
+handled. Render a loading state rather than trusting isAuthenticated
+until this is false.
The authenticated user's profile, or undefined when there is no session.
+
+
+
Sub-clients
+
-
generateDpopProof
-
generateDpopProof:( Â Â Â Â params:{ Â Â Â Â Â Â Â Â accessToken:string; Â Â Â Â Â Â Â Â method:string; Â Â Â Â Â Â Â Â nonce?:string; Â Â Â Â Â Â Â Â url:string; Â Â Â Â }, )=>Promise<string>
-
Returns a string to be used to demonstrate possession of the private
-key used to cryptographically bind access tokens with DPoP.
-
It requires enabling the Auth0ClientOptions.useDpop option.
-
-
-
Type Declaration
-
-
-
-
( Â Â Â Â params:{ Â Â Â Â Â Â Â Â accessToken:string; Â Â Â Â Â Â Â Â method:string; Â Â Â Â Â Â Â Â nonce?:string; Â Â Â Â Â Â Â Â url:string; Â Â Â Â }, ):Promise<string>
-
-
Returns a string to be used to demonstrate possession of the private
-key used to cryptographically bind access tokens with DPoP.
-
It requires enabling the Auth0ClientOptions.useDpop option.
MyAccount API client for self-service account management operations.
+
Provides access to methods for managing the authenticated user's authentication
+methods and factors:
+
+
getFactors() - List available authentication factors
+
getAuthenticationMethods(type?) - List enrolled authentication methods, optionally filtered by type
+
getAuthenticationMethod(id) - Get a specific authentication method by ID
+
updateAuthenticationMethod(id, data) - Update an authentication method (e.g. rename)
+
deleteAuthenticationMethod(id) - Remove an enrolled authentication method
+
enrollmentChallenge(options) - Initiate a two-step enrollment challenge
+
enrollmentVerify(options) - Complete a two-step enrollment by verifying the challenge
+
-
-
Parameters
-
-
Optionalid: string
-
The identifier of a nonce: if absent, it will get the nonce
-used for requests to Auth0. Otherwise, it will be used to
-select a specific non-Auth0 nonce.
-
-
Returns Promise<string|undefined>
-
-
Param: nonce
The nonce value.
-
-
-
Param: id
The identifier of a nonce: if absent, it will get the nonce
-used for requests to Auth0. Otherwise, it will be used to
-select a specific non-Auth0 nonce.
+
+
Example
const { myAccount } = useAuth0();
// List all enrolled authentication methods constmethods = awaitmyAccount.getAuthenticationMethods();
Passkey API client for WebAuthn-based passwordless authentication.
+
+
signup(options) — register a new user and create a passkey credential
+
login(options?) — authenticate an existing user via passkey assertion
+
continueSignup(verification) — finish a signup that threw
+PasskeyVerificationRequiredError, passing the OTP codes the user entered
+
getSignupChallenge(options) / getLoginChallenge(options?) — request
+a challenge so you can run the WebAuthn ceremony yourself
+
getTokenWithPasskey(options) — exchange the credential from that
+ceremony for tokens
+
+
The methods that return tokens update isAuthenticated / user in the
+same way as loginWithPopup.
+
With the granular APIs, if the signup challenge has
+verificationRequired, collect the OTP codes before the WebAuthn
+ceremony and pass them as verification to getTokenWithPasskey(). A
+wrong code throws a PasskeyGetTokenError with isRetryable: true; call
+getTokenWithPasskey() again with error.authSession, the same
+credential, and new codes.
After the browser redirects back to the callback page,
+call handleRedirectCallback to handle success and error
+responses from Auth0. If the response is successful, results
+will be valid according to their expiration times.
Sets the current DPoP nonce used for making requests to Auth0.
-
It requires enabling the Auth0ClientOptions.useDpop option.
-
Parameters
-
nonce: string
-
The nonce value.
-
-
Optionalid: string
-
The identifier of a nonce: if absent, it will set the nonce
-used for requests to Auth0. Otherwise, it will be used to
-select a specific non-Auth0 nonce.
+
Optionalurl: string
+
The URL to that should be used to retrieve the state and code values. Defaults to window.location.href if not given.
-
Returns Promise<void>
-
-
-
Param: nonce
The nonce value.
-
-
-
Param: id
The identifier of a nonce: if absent, it will set the nonce
-used for requests to Auth0. Otherwise, it will be used to
-select a specific non-Auth0 nonce.
Anonymous session client for pre-authentication identity management.
+
Opens a popup with the /authorize URL using the parameters
+provided as arguments. Random and secure state and nonce
+parameters will be auto-generated. If the response is successful,
+results will be valid according to their expiration times.
+
IMPORTANT: This method has to be called from an event handler
+that was started by the user like a button click, for example,
+otherwise the popup will be blocked in most browsers.
Redirects to the /connect URL using the parameters
-provided as arguments. This then redirects to the connection's login page
-where the user can authenticate and authorize the account to be connected.
-
If connecting the account is successful onRedirectCallback will be called
-with the details of the connected account.
+
Clears the application session and performs a redirect to /v2/logout, using
+the parameters provided as arguments, to clear the Auth0 session.
+If the logoutParams.federated option is specified, it also clears the Identity Provider session.
+Read more about how Logout works at Auth0.
Opens a popup with the /authorize URL using the parameters
-provided as arguments. Random and secure state and nonce
-parameters will be auto-generated. If the response is successful,
-results will be valid according to their expiration times.
getAccessTokenSilently:{ Â Â Â Â ( Â Â Â Â Â Â Â Â options:GetTokenSilentlyOptions&{detailedResponse:true}, Â Â Â Â ):Promise<GetTokenSilentlyVerboseResponse|undefined>; Â Â Â Â (options?:GetTokenSilentlyOptions):Promise<string|undefined>; }
After the browser redirects back to the callback page,
-call handleRedirectCallback to handle success and error
-responses from Auth0. If the response is successful, results
+
If there's a valid token stored, return it. Otherwise, opens an
+iframe with the /authorize URL using the parameters provided
+as arguments. Random and secure state and nonce parameters
+will be auto-generated. If the response is successful, results
will be valid according to their expiration times.
+
If refresh tokens are used, the token endpoint is called directly with the
+'refresh_token' grant. If no refresh token is available to make this call,
+the SDK will only fall back to using an iframe to the '/authorize' URL if
+the useRefreshTokensFallback setting has been set to true. By default this
+setting is false.
+
This method may use a web worker to perform the token call if the in-memory
+cache is used.
+
If an audience value is given to this function, the SDK always falls
+back to using an iframe to make the token exchange.
+
Note that in all cases, falling back to an iframe requires access to
+the auth0 cookie.
Exchanges an external subject token for Auth0 tokens and logs the user in.
-This method implements the Custom Token Exchange grant as specified in RFC 8693.
-
The exchanged tokens are automatically cached, establishing an authenticated session.
-After calling this method, you can use getUser(), getIdTokenClaims(), and
-getTokenSilently() to access the user's information and tokens.
// User is now logged in - access user info constuser = awaitgetUser(); console.log('Logged in user:', user); } catch (error) { console.error('Token exchange failed:', error); }
-
Opens a popup with the /authorize URL using the parameters
-provided as arguments. Random and secure state and nonce
-parameters will be auto-generated. If the response is successful,
-results will be valid according to their expiration times.
-
IMPORTANT: This method has to be called from an event handler
-that was started by the user like a button click, for example,
-otherwise the popup will be blocked in most browsers.
Clears the application session and performs a redirect to /v2/logout, using
-the parameters provided as arguments, to clear the Auth0 session.
-If the logoutParams.federated option is specified, it also clears the Identity Provider session.
-Read more about how Logout works at Auth0.
Passkey API client for WebAuthn-based passwordless authentication.
+
Exchanges an external subject token for Auth0 tokens and logs the user in.
+This method implements the Custom Token Exchange grant as specified in RFC 8693.
+
The exchanged tokens are automatically cached, establishing an authenticated session.
+After calling this method, you can use getUser(), getIdTokenClaims(), and
+getTokenSilently() to access the user's information and tokens.
getAccessTokenSilently:{ Â Â Â Â ( Â Â Â Â Â Â Â Â options:GetTokenSilentlyOptions&{detailedResponse:true}, Â Â Â Â ):Promise<GetTokenSilentlyVerboseResponse|undefined>; Â Â Â Â (options?:GetTokenSilentlyOptions):Promise<string|undefined>; }
awaitconnectAccountWithRedirect({ connection:'google-oauth2', scopes: ['openid', 'profile', 'email', 'https://www.googleapis.com/auth/drive.readonly'], authorization_params: { // additional authorization params to forward to the authorization server } });
-
If there's a valid token stored, return it. Otherwise, opens an
-iframe with the /authorize URL using the parameters provided
-as arguments. Random and secure state and nonce parameters
-will be auto-generated. If the response is successful, results
-will be valid according to their expiration times.
-
If refresh tokens are used, the token endpoint is called directly with the
-'refresh_token' grant. If no refresh token is available to make this call,
-the SDK will only fall back to using an iframe to the '/authorize' URL if
-the useRefreshTokensFallback setting has been set to true. By default this
-setting is false.
-
This method may use a web worker to perform the token call if the in-memory
-cache is used.
-
If an audience value is given to this function, the SDK always falls
-back to using an iframe to make the token exchange.
-
Note that in all cases, falling back to an iframe requires access to
-the auth0 cookie.
+
Redirects to the /connect URL using the parameters
+provided as arguments. This then redirects to the connection's login page
+where the user can authenticate and authorize the account to be connected.
+
If connecting the account is successful onRedirectCallback will be called
+with the details of the connected account.
+
+
+
Advanced
+
+
+
createFetcher
+
createFetcher:<TOutputextendsCustomFetchMinimalOutput=Response>( Â Â Â Â config?:FetcherConfig<TOutput>, )=>Fetcher<TOutput>
+
Returns a new Fetcher class that will contain a fetchWithAuth() method.
+This is a drop-in replacement for the Fetch API's fetch() method, but will
+handle certain authentication logic for you, like building the proper auth
+headers or managing DPoP nonces and retries automatically.
+
Check the EXAMPLES.md file for a deeper look into this method.
Type Declaration
-
( Â Â Â Â options:GetTokenSilentlyOptions&{detailedResponse:true}, ):Promise<GetTokenSilentlyVerboseResponse|undefined>
+
<TOutputextendsCustomFetchMinimalOutput=Response>( Â Â Â Â config?:FetcherConfig<TOutput>, ):Fetcher<TOutput>
-
Fetches a new access token and returns the response from the /oauth/token endpoint, omitting the refresh token.
+
Returns a new Fetcher class that will contain a fetchWithAuth() method.
+This is a drop-in replacement for the Fetch API's fetch() method, but will
+handle certain authentication logic for you, like building the proper auth
+headers or managing DPoP nonces and retries automatically.
+
Check the EXAMPLES.md file for a deeper look into this method.
generateDpopProof:( Â Â Â Â params:{ Â Â Â Â Â Â Â Â accessToken:string; Â Â Â Â Â Â Â Â method:string; Â Â Â Â Â Â Â Â nonce?:string; Â Â Â Â Â Â Â Â url:string; Â Â Â Â }, )=>Promise<string>
+
Returns a string to be used to demonstrate possession of the private
+key used to cryptographically bind access tokens with DPoP.
+
It requires enabling the Auth0ClientOptions.useDpop option.
+
+
+
Type Declaration
+
+
+
+
( Â Â Â Â params:{ Â Â Â Â Â Â Â Â accessToken:string; Â Â Â Â Â Â Â Â method:string; Â Â Â Â Â Â Â Â nonce?:string; Â Â Â Â Â Â Â Â url:string; Â Â Â Â }, ):Promise<string>
-
Fetches a new access token and returns it.
+
Returns a string to be used to demonstrate possession of the private
+key used to cryptographically bind access tokens with DPoP.
+
It requires enabling the Auth0ClientOptions.useDpop option.
Returns the current DPoP nonce used for making requests to Auth0.
+
It can return undefined because when starting fresh it will not
+be populated until after the first response from the server.
+
It requires enabling the Auth0ClientOptions.useDpop option.
+
+
+
Type Declaration
+
+
+
+
(id?:string):Promise<string|undefined>
+
+
Returns the current DPoP nonce used for making requests to Auth0.
+
It can return undefined because when starting fresh it will not
+be populated until after the first response from the server.
+
It requires enabling the Auth0ClientOptions.useDpop option.
+
+
+
Parameters
+
+
Optionalid: string
+
The identifier of a nonce: if absent, it will get the nonce
+used for requests to Auth0. Otherwise, it will be used to
+select a specific non-Auth0 nonce.
+
+
Returns Promise<string|undefined>
+
+
+
Param: nonce
The nonce value.
+
+
+
Param: id
The identifier of a nonce: if absent, it will get the nonce
+used for requests to Auth0. Otherwise, it will be used to
+select a specific non-Auth0 nonce.
Sets the current DPoP nonce used for making requests to Auth0.
+
It requires enabling the Auth0ClientOptions.useDpop option.
+
+
+
Type Declaration
+
+
+
+
(nonce:string,id?:string):Promise<void>
+
+
Sets the current DPoP nonce used for making requests to Auth0.
+
It requires enabling the Auth0ClientOptions.useDpop option.
+
+
+
Parameters
+
+
nonce: string
+
The nonce value.
+
+
Optionalid: string
+
The identifier of a nonce: if absent, it will set the nonce
+used for requests to Auth0. Otherwise, it will be used to
+select a specific non-Auth0 nonce.
+
+
Returns Promise<void>
+
+
+
Param: nonce
The nonce value.
+
+
+
Param: id
The identifier of a nonce: if absent, it will set the nonce
+used for requests to Auth0. Otherwise, it will be used to
+select a specific non-Auth0 nonce.
The API audience the access token should be scoped to.
Must be a resource server that has allow_anonymous_access enabled.
-
+
Defined in node_modules/@auth0/auth0-auth-js/dist/index.d.ts:2066
+
Optionalmetadata
metadata?:Record<string,string>
Up to 1KB of arbitrary key-value metadata to attach to the anonymous session.
Set once at creation time — cannot be changed after the session is created.
-
+
Defined in node_modules/@auth0/auth0-auth-js/dist/index.d.ts:2075
+
Optionalscope
scope?:string
Space-separated list of scopes to request.
+
Defined in node_modules/@auth0/auth0-auth-js/dist/index.d.ts:2070
interfaceIsFederatedDomainOptions{ Â Â Â Â customFetch?:{ Â Â Â Â Â Â Â Â (input:URL|RequestInfo,init?:RequestInit):Promise<Response>; Â Â Â Â Â Â Â Â (input:string|URL|Request,init?:RequestInit):Promise<Response>; Â Â Â Â }; Â Â Â Â telemetry?:TelemetryConfig; }
+
Defined in node_modules/@auth0/auth0-auth-js/dist/index.d.ts:3585
customFetch?:{ Â Â Â Â (input:URL|RequestInfo,init?:RequestInit):Promise<Response>; Â Â Â Â (input:string|URL|Request,init?:RequestInit):Promise<Response>; }
interfaceLogoutOptions{     clientId?:string|null;     logoutParams?:{         federated?:boolean;         returnTo?:string;         [key:string]:any;     };     openUrl?:false     | ((url:string)=>void|Promise<void>); }
setMFAAuthDetails( Â Â Â Â mfaToken:string, Â Â Â Â scope?:string, Â Â Â Â audience?:string, Â Â Â Â mfaRequirements?:MfaRequirements, ):void
-
Internal
-
Stores authentication details (scope, audience, and MFA requirements) for MFA token verification.
-This is automatically called by Auth0Client when an mfa_required error occurs.
-
The context is stored keyed by the MFA token, enabling concurrent MFA flows.
-
-
-
Parameters
-
-
mfaToken: string
-
The MFA token from the mfa_required error response
-
-
Optionalscope: string
-
The OAuth scope from the original request (optional)
-
-
Optionalaudience: string
-
The API audience from the original request (optional)
-
-
OptionalmfaRequirements: MfaRequirements
-
The MFA requirements from the mfa_required error (optional)
Supporting option, claim and parameter types that come from the underlying
+@auth0/auth0-spa-js SDK. You arrive at one of these from the hook or context
+member that uses it, rather than by browsing this section. For deeper
+documentation on each, see the
+@auth0/auth0-spa-js reference.
Options for exchanging a signed passkey credential for tokens.
+
credential is the raw PublicKeyCredential produced by the WebAuthn
+ceremony — a creation credential (signup) or an assertion credential
+(login). The credential type (attestation vs assertion) is detected
+automatically during serialization.
+
+
typePasskeyGetTokenOptions={ Â Â Â Â audience?:string; Â Â Â Â authSession:string; Â Â Â Â credential:PublicKeyCredential; Â Â Â Â organization?:string; Â Â Â Â realm?:string; Â Â Â Â scope?:string; Â Â Â Â verification?:{email?:string;phone?:string}; }
OTP codes collected for identifier verification. Required when
+PasskeySignupChallenge.verificationRequired is non-empty. Keys are the
+identifier names (e.g. "email", "phone"); values are the OTP codes.
+Omit entirely when no verification is required.
A passkey login challenge ready for the WebAuthn ceremony.
+
publicKey is decoded (base64url → ArrayBuffer) and can be fed directly into
+a WebAuthn assertion ceremony . authSession must be retained and passed to getTokenWithPasskey().
+
+
typePasskeyLoginChallenge={ Â Â Â Â authSession:string; Â Â Â Â publicKey:PublicKeyCredentialRequestOptions; }
A passkey signup challenge ready for the WebAuthn ceremony.
+
publicKey is decoded (base64url → ArrayBuffer) and can be fed directly into
+a WebAuthn credential creation ceremony. authSession must be retained and passed to getTokenWithPasskey().
+
+
typePasskeySignupChallenge={ Â Â Â Â authSession:string; Â Â Â Â publicKey:PublicKeyCredentialCreationOptions; Â Â Â Â verificationRequired?: ("email"|"phone")[]; }
Identifiers that require OTP verification before token issuance (e.g. ["email"]).
+Absent when no verification is required. Collect OTP codes for each identifier
+and pass them as verification to getTokenWithPasskey() — do NOT call
+navigator.credentials.create() until all codes have been collected.
PasskeySignupChallengeOptions:PasskeySignupChallengeBaseOptions& ( Â Â Â Â |{email:string;phoneNumber?:string;username?:string} Â Â Â Â |{email?:string;phoneNumber:string;username?:string} Â Â Â Â |{email?:string;phoneNumber?:string;username:string} )
+
Options for requesting a passkey signup challenge.
+
At least one user identifier (email, username, or phoneNumber) must be provided.
+Which identifiers are accepted depends on what is configured on your database connection.
The raw error response from Auth0, if available.