Files
archived-next-auth/docs/versioned_docs/version-beta/guides/05-adapters/using-a-database-adapter.md
Lluis Agusti cb56cd44ca refactor(docs): re-structure (#4498)
* docs: beta initial commit

* docs(oauth): finish initial tutorial

* docs(oauth-tutorial): finish guide

* docs(docusaurus): just log broken links

* docs: re-organising beta

* docs(beta): sort documents for sorting

* docs: more re-structure

* docs: more re-structure (2)

* fix: more WIP

* fix: more WIP

* chore: more updates

* chore: wip

* chore: wip

* fix lock file

* docs(getting-started): credentials

* chore: remove json-server file

* chore: cleanup

* remove mongodb from dev app

* chore: cleanup

* revert

* chore: cleanup

* chore: more cleanup changes

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-15 15:45:33 +01:00

1.4 KiB

Using a database adapter

An Adapter in NextAuth.js connects your application to whatever database or backend system you want to use to store data for users, their accounts, sessions, etc. Adapters are optional, unless you need to persist user information in your own database, or you want to implement certain flows. The Email Provider requires an adapter to be able to save Verification Tokens.

:::tip When using a database, you can still use JWT for session handling for fast access. See the session.strategy option. Read about the trade-offs of JWT in the FAQ. :::

We have a list of official adapters that are distributed as their own packages under the @next-auth/{name}-adapter namespace. Their source code is available in their various adapters package directories at nextauthjs/next-auth.

Let's get started

In this guide we're going to use the prisma Adapter in conjunction with the Email Provider.