Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference@auth/fauna-adapter

@auth/fauna-adapter

Official Fauna adapter for Auth.js / NextAuth.js.

Installation

npm install @auth/fauna-adapter fauna

FaunaAccount

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
ParameterType
objectRecord<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
ParameterType
objectRecord<string, any>
Returns

T


FaunaAdapter()

FaunaAdapter(client, config?): Adapter

Parameters

ParameterType
clientClient
config?AdapterConfig

Returns

Adapter

Auth.js © Balázs Orbán and Team - 2024