lucia-mikro-orm-adapter
v0.1.0
Published
Mikro ORM adapter for Lucia auth library
Downloads
31
Maintainers
Readme
lucia-mikro-orm-adapter
Mikro ORM adapter for Lucia auth library.
Installation
npm i -S lucia-mikro-orm-adapter
Usage
import { lucia } from "lucia";
import { mikroORMAdapter, User, Session, UserKey } from "lucia-mikro-orm-adapter";
export const orm = await MikroORM.init({
// register auth entities
entities: [User, Session, UserKey],
// ...
});
export const auth = lucia({
adapter: mikroORMAdapter(orm),
// ...
});
Options
You can pass custom entities to the adapter through the options object. This is useful if you want to extend the default entities or use your own.
mikroORMAdapter(orm, {
User,
Session,
UserKey,
});