Skip to main content

Interface: PrismaAdapterOptions

Complete configuration object for createPrismaAdapter.

Fields:

  • client: Required PrismaClientLike instance with user + password models.
  • secret: Required token hashing secret. Minimum 32 characters recommended.
  • models?: Optional PrismaAdapterModelOptions for custom model names.

⚠️ Security:

  • Never commit secrets; load them from environment variables or secret stores.

Performance notes:

  • Each adapter method runs 1–3 database queries. Enable Prisma connection pooling for high throughput.

Edge cases:

  • Call await prisma.$connect() before passing the client if your environment requires manual connections.

Examples

createPrismaAdapter({ client: prisma, secret: process.env.AUTH_SECRET! })
createPrismaAdapter({
client: prisma,
secret: process.env.AUTH_SECRET!,
models: { password: 'userCredentials' }
})

Properties

client

client: PrismaClientLike;

models?

optional models: PrismaAdapterModelOptions;

secret

secret: string;