{"id":31190578,"url":"https://github.com/octet-stream/better-auth-mikro-orm","last_synced_at":"2026-02-25T23:03:48.382Z","repository":{"id":268416537,"uuid":"903062257","full_name":"octet-stream/better-auth-mikro-orm","owner":"octet-stream","description":"MikroORM Adapter for Better Auth","archived":false,"fork":false,"pushed_at":"2026-01-01T13:42:13.000Z","size":253,"stargazers_count":30,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-25T23:03:19.768Z","etag":null,"topics":["better-auth","database-adapter","mikro-orm"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/better-auth-mikro-orm","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octet-stream.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-13T21:13:42.000Z","updated_at":"2026-02-10T14:50:51.000Z","dependencies_parsed_at":"2024-12-16T16:45:20.540Z","dependency_job_id":"62d9ca0e-a174-451a-8b40-14c281b4b71e","html_url":"https://github.com/octet-stream/better-auth-mikro-orm","commit_stats":null,"previous_names":["octet-stream/better-auth-mikro-orm"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/octet-stream/better-auth-mikro-orm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Fbetter-auth-mikro-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Fbetter-auth-mikro-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Fbetter-auth-mikro-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Fbetter-auth-mikro-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octet-stream","download_url":"https://codeload.github.com/octet-stream/better-auth-mikro-orm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octet-stream%2Fbetter-auth-mikro-orm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29844845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["better-auth","database-adapter","mikro-orm"],"created_at":"2025-09-19T21:51:11.426Z","updated_at":"2026-02-25T23:03:48.378Z","avatar_url":"https://github.com/octet-stream.png","language":"TypeScript","readme":"# better-auth-mikro-orm\n\n[MikroORM](https://mikro-orm.io/) adapter for [Better Auth](https://www.better-auth.com/)\n\n\n[![CI](https://github.com/octet-stream/better-auth-mikro-orm/actions/workflows/ci.yaml/badge.svg)](https://github.com/octet-stream/better-auth-mikro-orm/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/octet-stream/better-auth-mikro-orm/graph/badge.svg?token=xcVndkC8mL)](https://codecov.io/gh/octet-stream/better-auth-mikro-orm)\n\n## Installation\n\nUsing npm:\n```sh\nnpm i better-auth-mikro-orm\n```\nUsing yarn:\n```sh\nyarn add better-auth-mikro-orm\n```\nUsing pnpm:\n```sh\npnpm add better-auth-mikro-orm\n```\n\n## Usage\n\n1. First you'll need to set up MikroORM and define the [core schema](https://www.better-auth.com/docs/concepts/database#core-schema) for Better Auth.\nIf 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.\n2. When you're finished with the schema definitions, you can simply pass the result of the `mikroOrmAdapter` call to the `database` option like this:\n\n```ts\nimport {mikroOrmAdapter} from \"better-auth-mikro-orm\"\nimport {betterAuth} from \"better-auth\"\n\nimport {orm} from \"./orm.js\" // Your Mikro ORM instance\n\nexport const auth = betterAuth({\n  database: mikroOrmAdapter(orm),\n\n  // Don't forget to disable the ID generator if it is already managed by MikroORM\n  advanced: {\n    database: {\n      generateId: false\n    }\n  }\n})\n```\n\n## API\n\n### `mikroOrmAdapter(orm: MikroORM): AdapterInstance`\n\nCreates 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`](https://www.better-auth.com/docs/concepts/cli).\nThis means you'll have to manage database schemas on your own.\nPlease refer to the Better Auth and MikroORM documentations for details.\n\nReturns the `AdapterInstance` function for the Better Auth `database` option.\n\nThis function expects a single argument:\n\n* `orm` - An instance of `MikroORM` returned from either `MikroORM.init` or `MikroORM.initSync`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctet-stream%2Fbetter-auth-mikro-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctet-stream%2Fbetter-auth-mikro-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctet-stream%2Fbetter-auth-mikro-orm/lists"}