Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anteprimorac/lucia-mikro-orm-adapter
Mikro ORM adapter for Lucia auth library
https://github.com/anteprimorac/lucia-mikro-orm-adapter
adapter lucia lucia-auth mikro-orm
Last synced: 21 days ago
JSON representation
Mikro ORM adapter for Lucia auth library
- Host: GitHub
- URL: https://github.com/anteprimorac/lucia-mikro-orm-adapter
- Owner: anteprimorac
- License: mit
- Created: 2023-08-05T20:25:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-21T00:57:05.000Z (9 months ago)
- Last Synced: 2024-10-04T11:21:37.418Z (about 1 month ago)
- Topics: adapter, lucia, lucia-auth, mikro-orm
- Language: TypeScript
- Homepage:
- Size: 162 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lucia-mikro-orm-adapter
[Mikro ORM](https://mikro-orm.io/) adapter for [Lucia auth library](https://lucia-auth.com/).## Installation
```bash
npm i -S lucia-mikro-orm-adapter
```## Usage
```js
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.
```js
mikroORMAdapter(orm, {
User,
Session,
UserKey,
});
```