@auth/fauna-adapter
Official Fauna adapter for Auth.js / NextAuth.js.
Installation
npm install @auth/fauna-adapter faunaFaunaAccount
type FaunaAccount = ToFauna<AdapterAccount>;FaunaSession
type FaunaSession = ToFauna<AdapterSession>;FaunaUser
type FaunaUser = ToFauna<AdapterUser>;FaunaVerificationToken
type FaunaVerificationToken = ToFauna<VerificationToken> & {
  id: string;
};Type declaration
id
id: string;format
const format: {
  from: T;
  to: T;
};Type declaration
from()
Takes an object that’s coming from the database and converts it to plain JavaScript.
Type Parameters
| Type Parameter | 
|---|
| T | 
Parameters
| Parameter | Type | 
|---|---|
| object | Record<string,any> | 
Returns
T
to()
Takes an object that’s coming from Auth.js and prepares it to be written to the database.
Type Parameters
| Type Parameter | 
|---|
| T | 
Parameters
| Parameter | Type | 
|---|---|
| object | Record<string,any> | 
Returns
T
FaunaAdapter()
function FaunaAdapter(client, config?): AdapterParameters
| Parameter | Type | 
|---|---|
| client | Client | 
| config? | AdapterConfig |