Files


    

Neo4j Adapter - NextAuth.js

Open Source. Full Stack. Own Your Data.

Canary CI Test Bundle Size @next-auth/neo4j-adapter Version

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

  1. Install neo4j-driver, next-auth and @next-auth/neo4j-adapter
npm install neo4j-driver next-auth @next-auth/neo4j-adapter@next
  1. Add this adapter to your pages/api/[...nextauth].js next-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