mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Neo4j Adapter - NextAuth.js
Open Source. Full Stack. Own Your Data.
Overview
This is the Neo4j 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 Neo4j schema in the docs at next-auth.js.org/adapters/neo4j.
Getting Started
- Install
neo4j-driver,next-authand@next-auth/neo4j-adapter
npm install neo4j-driver next-auth @next-auth/neo4j-adapter@next
- Add this adapter to your
pages/api/[...nextauth].jsnext-auth configuration object.
import NextAuth from "next-auth"
import neo4j from "neo4j-driver"
import { Neo4jAdapter } from "@next-auth/neo4j-adapter"
// Setup your neo4j driver instance
const driver = neo4j.driver(
"bolt://localhost",
neo4j.auth.basic("neo4j", "password")
)
const neo4jSession = driver.session()
export default NextAuth({
// https://next-auth.js.org/configuration/providers
providers: [],
adapter: Neo4jAdapter(neo4jSession),
...
})
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
