@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
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()
FaunaAdapter(client, config?): Adapter
Parameters
Parameter | Type |
---|---|
client | Client |
config ? | AdapterConfig |