Module: main
This is the main entry point to the Auth.js library.
Based on the Request and Response Web standard APIs. Primarily used to implement framework-specific packages, but it can also be used directly.
Installation​
- npm
- yarn
- pnpm
npm install @auth/core
yarn add @auth/core
pnpm add @auth/core
Usage​
import { Auth } from "@auth/core"
const request = new Request("https://example.com"
const response = await Auth(request, {...})
console.log(response instanceof Response) // true
Resources​
Interfaces​
Functions​
Auth​
â–¸ Auth(request
, config
): Promise
<Response
>
Core functionality provided by Auth.js.
Receives a standard Request and returns a Response.
Example
import Auth from "@auth/core"
const request = new Request("https://example.com")
const response = await AuthHandler(request, {
providers: [...],
secret: "...",
trustHost: true,
})
See
Parameters​
Name | Type |
---|---|
request | Request |
config | AuthConfig |
Returns​
Promise
<Response
>