OptionalaudienceThe 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. Each API requires its own access token with the appropriate audience.
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) in your Auth0 Application settings.
https://auth0.com/docs/secure/tokens/refresh-tokens/multi-resource-refresh-token - Multi-Resource Refresh Tokens documentation
OptionalincludeWhen true, returns the full response from the /auth/access-token endpoint
instead of only the access token string.
OptionalmergeControl scope merging behavior for token cache lookups.
When true (default): merges globally configured scopes with the requested
scope before looking up cached tokens. This is the standard behavior for the
default audience.
When false: uses ONLY the explicitly requested scope for cache lookup,
without merging global defaults. This is necessary when retrieving tokens
for non-default audiences (e.g., step-up MFA tokens) where the cached token
was stored with a specific scope that differs from global defaults.
OptionalrouteCustom route for the access token endpoint. Useful for multi-tenant applications where different tenants require different route configurations. If not specified, falls back to the NEXT_PUBLIC_ACCESS_TOKEN_ROUTE environment variable or "/auth/access-token".
OptionalscopeAdditional scopes to request beyond those granted during login. Requires the Auth0 Application to be configured for Multi-Resource Refresh Tokens (MRRT).
Options for fetching an access token.
Important for Multi-API Applications: When your application calls multiple APIs with different audiences, you must specify the
audienceparameter to ensure the correct access token is retrieved. Without specifying the audience, the default access token from the session will be used, which may be intended for a different API.Example