Interface Auth0ClientOptions

interface Auth0ClientOptions {
    allowInsecureRequests?: boolean;
    appBaseUrl?: string;
    authorizationParameters?: AuthorizationParameters;
    beforeSessionSaved?: BeforeSessionSavedHook;
    clientAssertionSigningAlg?: string;
    clientAssertionSigningKey?: string | CryptoKey;
    clientId?: string;
    clientSecret?: string;
    domain?: string;
    enableTelemetry?: boolean;
    httpTimeout?: number;
    onCallback?: OnCallbackHook;
    pushedAuthorizationRequests?: boolean;
    routes?: Partial<
        Pick<Routes, "login" | "callback" | "logout" | "backChannelLogout">,
    >;
    secret?: string;
    session?: SessionConfiguration;
    sessionStore?: SessionDataStore;
    signInReturnToPath?: string;
    transactionCookie?: TransactionCookieOptions;
}

Properties

allowInsecureRequests?: boolean

Allow insecure requests to be made to the authorization server. This can be useful when testing with a mock OIDC provider that does not support TLS, locally. This option can only be used when NODE_ENV is not set to production.

appBaseUrl?: string

The URL of your application (e.g.: http://localhost:3000).

If it's not specified, it will be loaded from the APP_BASE_URL environment variable.

authorizationParameters?: AuthorizationParameters

Additional parameters to send to the /authorize endpoint.

beforeSessionSaved?: BeforeSessionSavedHook

A method to manipulate the session before persisting it.

See beforeSessionSaved for additional details

clientAssertionSigningAlg?: string

The algorithm used to sign the client assertion JWT. Uses one of token_endpoint_auth_signing_alg_values_supported if not specified. If the Authorization Server discovery document does not list token_endpoint_auth_signing_alg_values_supported this property will be required.

clientAssertionSigningKey?: string | CryptoKey

Private key for use with private_key_jwt clients. This should be a string that is the contents of a PEM file or a CryptoKey.

clientId?: string

The Auth0 client ID.

If it's not specified, it will be loaded from the AUTH0_CLIENT_ID environment variable.

clientSecret?: string

The Auth0 client secret.

If it's not specified, it will be loaded from the AUTH0_CLIENT_SECRET environment variable.

domain?: string

The Auth0 domain for the tenant (e.g.: example.us.auth0.com).

If it's not specified, it will be loaded from the AUTH0_DOMAIN environment variable.

enableTelemetry?: boolean

Boolean value to opt-out of sending the library name and version to your authorization server via the Auth0-Client header. Defaults to true.

httpTimeout?: number

Integer value for the HTTP timeout in milliseconds for authentication requests. Defaults to 5000 ms.

onCallback?: OnCallbackHook

A method to handle errors or manage redirects after attempting to authenticate.

See onCallback for additional details

pushedAuthorizationRequests?: boolean

If enabled, the SDK will use the Pushed Authorization Requests (PAR) protocol when communicating with the authorization server.

routes?: Partial<
    Pick<Routes, "login" | "callback" | "logout" | "backChannelLogout">,
>

Configure the paths for the authentication routes.

See Custom routes for additional details.

secret?: string

A 32-byte, hex-encoded secret used for encrypting cookies.

If it's not specified, it will be loaded from the AUTH0_SECRET environment variable.

Configure the session timeouts and whether to use rolling sessions or not.

See Session configuration for additional details.

sessionStore?: SessionDataStore

A custom session store implementation used to persist sessions to a data store.

See Database sessions for additional details.

signInReturnToPath?: string

The path to redirect the user to after successfully authenticating. Defaults to /.

transactionCookie?: TransactionCookieOptions

Configure the transaction cookie used to store the state of the authentication transaction.