Use this file to discover all available pages before exploring further.
getAccessToken is a client-side function that retrieves an access token for the currently authenticated user. It fetches tokens from the /auth/access-token endpoint, which handles token refresh automatically if needed.
This is the client-side version. For server-side token retrieval, see getAccessToken (Server).
The unique identifier of the target API. This should match the API identifier configured in Auth0.Critical for Multi-API Applications: If your application calls multiple APIs, you must specify this parameter to ensure the correct access token is used for each API.Configuration Requirement: When using audience or scope, ensure that the audiences and scopes are part of your Auth0 Application’s Refresh Token Policies. This requires configuring Multi-Resource Refresh Tokens (MRRT).
Additional scopes to request beyond those granted during login.Requires the Auth0 Application to be configured for Multi-Resource Refresh Tokens (MRRT).
By default, the function fetches from /auth/access-token. You can customize this endpoint using the NEXT_PUBLIC_ACCESS_TOKEN_ROUTE environment variable: