Module: index
Installationβ
- npm
- yarn
- pnpm
npm install @auth/core
yarn add @auth/core
pnpm add @auth/core
Usageβ
Functionsβ
AuthHandlerβ
βΈ AuthHandler(request, options): Promise<Response>
The core functionality of Auth.js. It receives a standard
Request and
returns a standard
Response.
Parametersβ
| Name | Type |
|---|---|
request | Request |
options | AuthOptions |
Returnsβ
Promise<Response>
Type Aliasesβ
TokenSetβ
Ζ¬ TokenSet: Partial<OAuth2TokenEndpointResponse | OpenIDTokenEndpointResponse>
Different tokens returned by OAuth Providers. Some of them are available with different casing, but they refer to the same value.
Interfacesβ
Accountβ
β’ Account: Object
Usually contains information about the provider being used
and also extends TokenSet, which is different tokens returned by OAuth Providers.
AuthOptionsβ
β’ AuthOptions: Object
Configure your NextAuth instance
CallbacksOptionsβ
β’ CallbacksOptions<P, A>: Object
Type parametersβ
| Name | Type |
|---|---|
P | Profile |
A | Account |
CookieOptionβ
β’ CookieOption: Object
CookiesOptionsβ
β’ CookiesOptions: Object
EventCallbacksβ
β’ EventCallbacks: Object
The various event callbacks you can register for from next-auth
LoggerInstanceβ
β’ LoggerInstance: Object
Override any of the methods, and the rest will use the default logger.
PagesOptionsβ
β’ PagesOptions: Object
Profileβ
β’ Profile: Object
The OAuth profile returned from your provider
Sessionβ
β’ Session: Object
Returned by useSession, getSession, returned by the session callback
and also the shape received as a prop on the SessionProvider React Context
useSession |
getSession |
SessionProvider |
session callback
SessionOptionsβ
β’ SessionOptions: Object
Themeβ
β’ Theme: Object
Change the theme of the built-in pages.
Userβ
β’ User: Object
The shape of the returned object in the OAuth providers' profile callback,
available in the jwt and session callbacks,
or the second parameter of the session callback, when using a database.
signIn callback |
session callback |
jwt callback |
profile OAuth provider callback