Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@forklaunch/better-auth-mikro-orm-fork

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forklaunch/better-auth-mikro-orm-fork

Mikro ORM Adapter for Better Auth

latest
Source
npmnpm
Version
0.5.3
Version published
Maintainers
1
Created
Source

better-auth-mikro-orm

MikroORM adapter for Better Auth

CI codecov

Installation

Using npm:

npm i better-auth-mikro-orm

Using yarn:

yarn add better-auth-mikro-orm

Using pnpm:

pnpm add better-auth-mikro-orm

Usage

  • First you'll need to set up MikroORM and define the core schema for Better Auth. If you use any plugin, don't forget to check if they have any additional database schema definitions, then define entities you'll need for each plugin.
  • When you're finished with the schema definitions, you can simply pass the result of the mikroOrmAdapter call to the database option like this:
import { mikroOrmAdapter } from "better-auth-mikro-orm";
import { betterAuth } from "better-auth";

import { orm } from "./orm.js"; // Your Mikro ORM instance

export const auth = betterAuth({
  database: mikroOrmAdapter(orm),

  // Don't forget to disable the ID generator if it is already managed by MikroORM
  advanced: {
    database: {
      generateId: false,
    },
  },
});

API

mikroOrmAdapter(orm: MikroORM): AdapterInstance

Creates the MikroORM adapter instance. Note that this adapter does not manage database schemas for you, so you can't use it with @better-auth/cli. This means you'll have to manage database schemas on your own. Please refer to the Better Auth and MikroORM documentations for details.

Returns the AdapterInstance function for the Better Auth database option.

This function expects a single argument:

  • orm - An instance of MikroORM returned from either MikroORM.init or MikroORM.initSync.

Keywords

auth

FAQs

Package last updated on 28 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts