custom-prisma-adapter
v0.0.2
Published
Modified version of [@auth/prisma-adapter](https://authjs.dev/reference/adapter/prisma)
Downloads
35
Maintainers
Readme
Custom Prisma Adapter
Modified version of @auth/prisma-adapter
Installation
# Using npm
> npm install custom-prisma-adapter
# Using yarn
> yarn add custom-prisma-adapter
# Using pnpm
> pnpm add custom-prisma-adapter
# Using bun
> bun add custom-prisma-adapter
Usage
Importing
import { PrismaAdapter } from 'custom-prisma-adapter';
Examples
import NextAuth from 'next-auth';
import Google from 'next-auth/providers/google';
import { PrismaAdapter } from 'custom-prisma-adapter';
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
export const { handlers, auth, signIn, signOut } = NextAuth({
adapter: PrismaAdapter(prisma, {
accountModel: 'customAccount',
userModel: 'customUser'
}),
providers: [Google]
});
Options
You can optionally pass an options object as the second argument to PrismaAdapter
. This optional type is as follows:
options?: {
accountModel?: string;
userModel?: string;
sessionModel?: string;
verificationTokenModel?: string;
}