Skip to main content

Type alias: Adapter<WithVerificationToken>

adapters.Adapter

Ƭ Adapter<WithVerificationToken>: DefaultAdapter & WithVerificationToken extends true ? { createVerificationToken: (verificationToken: VerificationToken) => Awaitable<VerificationToken | null | undefined> ; useVerificationToken: (params: { identifier: string ; token: string }) => Awaitable<VerificationToken | null> } : {}

Using a custom adapter you can connect to any database backend or even several different databases. Custom adapters created and maintained by our community can be found in the adapters repository. Feel free to add a custom adapter from your project to the repository, or even become a maintainer of a certain adapter. Custom adapters can still be created and used in a project without being added to the repository.

Required methods

(These methods are required for all sign in flows)

  • createUser
  • getUser
  • getUserByEmail
  • getUserByAccount
  • linkAccount
  • createSession
  • getSessionAndUser
  • updateSession
  • deleteSession
  • updateUser

(Required to support email / passwordless sign in)

  • createVerificationToken
  • useVerificationToken

Unimplemented methods

(These methods will be required in a future release, but are not yet invoked)

  • deleteUser
  • unlinkAccount

Adapters Overview | Create a custom adapter

Type parameters​

NameType
WithVerificationTokenboolean