Fauna Adapter - NextAuth.js
Open Source. Full Stack. Own Your Data.
Overview
This is the Fauna Adapter for next-auth
. This package can only be used in conjunction with the primary next-auth
package. It is not a standalone package.
You can find the Fauna schema and seed information in the docs at next-auth.js.org/adapters/fauna.
Getting Started
- Install
next-auth
and @next-auth/fauna-adapter
npm install next-auth @next-auth/fauna-adapter
- Add this adapter to your
pages/api/[...nextauth].js
next-auth configuration object.
import NextAuth from "next-auth"
import Providers from "next-auth/providers"
import * as Fauna from "faunadb"
import { FaunaAdapter } from "@next-auth/fauna-adapter"
const client = new Fauna.Client({
secret: "secret",
scheme: "http",
domain: "localhost",
port: 8443,
})
export default NextAuth({
providers: [
Providers.Google({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
],
adapter: FaunaAdapter({ faunaClient: client})
...
})
Contributing
We're open to all community contributions! If you'd like to contribute in any way, please first read our Contributing Guide.
License
ISC