mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Mikro ORM Adapter - NextAuth.js
Open Source. Full Stack. Own Your Data.
Overview
This is the MikroORM Adapter for auth.js. This package can only be used in conjunction with the primary auth.js package. It is not a standalone package.
Getting Started
-
Install
next-authand@next-auth/mikro-orm-adapternpm install next-auth @next-auth/mikro-orm-adapter@next -
Add this adapter to your
pages/api/[...nextauth].tsnext-auth configuration object.import NextAuth from "next-auth" import { MikroOrmAdapter } from "@next-auth/mikro-orm-adapter" // For more information on each option (and a full list of options) go to // https://authjs.dev/reference/configuration/auth-options export default NextAuth({ // https://authjs.dev/reference/providers/oauth-builtin providers: [], adapter: MikroOrmAdapter({ dbName: "./db.sqlite", type: "sqlite", debug: process.env.DEBUG === "true" || process.env.DEBUG?.includes("db"), ... }, { // pass extended models as { entities: { } } if needed }), ... });
Contributing
We're open to all community contributions! If you'd like to contribute in any way, please read our Contributing Guide.
License
ISC
