Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Auth.js · Type Alias

AuthConfig

AuthConfig is the configuration type for Auth.js’s core Auth method. Use it to define authentication behavior and pass the resulting object to Auth or framework-specific initialization.

How it works

AuthConfig is the configuration type for the core Auth method. Use it to describe authentication providers and other behavior, then pass the configuration to Auth or use it as the basis for framework-specific setup.

Syntax

type AuthConfig = { ... }

Key points

  • AuthConfig describes the options used to configure the core Auth method.
  • The core Auth function is the main entry point and accepts the configuration object.
  • Declare a configuration object with the AuthConfig type when you want explicit type checking.

Example: Define and use an AuthConfig

import Auth, { type AuthConfig } from "@auth/core"

export const authConfig: AuthConfig = {
  providers: [],
}

const request = new Request("https://example.com")
const response = await Auth(request, authConfig)

Creates an AuthConfig object with no providers and passes it to the core Auth function.

When to use it

Configure the core Auth function

Core Auth setup

Keep authentication options in an auth.ts configuration file

Application initialization

Share adapter-free configuration with edge code

Edge-compatible architecture

Interview questions

QWhat is AuthConfig used for?

AuthConfig is the type used to configure the core Auth method. A configuration object can be passed to Auth, as shown in the core reference.

Follow-up: Why might configuration be split across files? A shared object can omit an adapter for edge-compatible usage, while the server-side Auth instance adds the adapter separately.

QHow do you apply an AuthConfig?

Define an object typed as AuthConfig and provide it to Auth. The core reference demonstrates importing the type from @auth/core and passing the object to Auth.

Follow-up: How can the same configuration be reused? Export the object and spread or pass it into framework-specific initialization where appropriate.

QIs AuthConfig itself an Auth.js instance?

AuthConfig describes configuration rather than creating an Auth instance by itself. The installation documentation recommends an auth.ts configuration file where library behavior and custom authentication logic are specified.

Follow-up: What belongs in the initialization layer? Framework-specific handlers and exported helpers are created when the configuration is passed to the framework initializer.

  • Auth
  • AuthConfig
  • NextAuthConfig
  • SvelteKitAuthConfig
  • AuthHandler

Source: auth/core. Checked 2026-10-15.