mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
* feat: pnpm * Update publish script * gitignore the pnpm debug log * Fix workspace * Fix dev commands * feat: pnpm * Update publish script * gitignore the pnpm debug log * Fix workspace * Fix dev commands * chore: fix pnpm install in GitHub Action * fix: update tsconfig path * pnpm run -> pnpm * chore: remove cache-node and add back setup-node * fix: tsconfig dependencies * chore: fix tsconfig path * fix: adapter-test dependencies * fix: setup-node for release-pr * fix: import adapter-test * chore: update workspace dependency for next-auth * fix: test failure * fix: add jest for adapters * fix: jest again * fix: mongo in prisma * fix: `--no-git-checks` for `release-pr` Co-authored-by: Balázs Orbán <info@balazsorban.com>
Prisma Adapter - NextAuth.js
Open Source. Full Stack. Own Your Data.
Overview
This is the Prisma 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 Prisma schema in the docs at next-auth.js.org/adapters/prisma.
Getting Started
- Install
next-authand@next-auth/prisma-adapteras well asprismaand@prisma/client.
npm install next-auth @next-auth/prisma-adapter @prisma/client
npm install --save-dev prisma
- Add this adapter to your
pages/api/[...nextauth].jsnext-auth configuration object.
import NextAuth from "next-auth"
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import * as Prisma from "@prisma/client"
const prisma = new Prisma.PrismaClient()
// For more information on each option (and a full list of options) go to
// https://next-auth.js.org/configuration/options
export default NextAuth({
// https://next-auth.js.org/configuration/providers
providers: [],
adapter: PrismaAdapter(prisma)
...
})
Contributing
We're open to all community contributions! If you'd like to contribute in any way, please read our Contributing Guide.
License
ISC
