[PR #5690] feat: add better-auth/minimal #14408

Closed
opened 2026-04-13 09:27:35 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5690

State: closed
Merged: No


This PR introduces better-auth/minimal, which is aimed at reducing bundle size when Kysely is not used. Additionally, the project structure has been modified to remove Kysely.


Summary by cubic

Add a Kysely-free build at better-auth/minimal to cut bundle size when you use adapters instead of direct DB connections. The default better-auth build stays the same and supports migrations and Kysely; all packages are now ESM-only.

  • New Features

    • New entrypoint better-auth/minimal exporting betterAuth without Kysely or migrations (runMigrations throws).
    • Minimal requires an adapter and rejects direct DB connections; default better-auth keeps Kysely and migrations.
    • Split init paths (init, initMinimal) with shared createAuthContext and adapter helpers (getAdapterWithKysely / getAdapterWithoutKysely).
    • ESM-only builds across packages with simplified exports.
  • Bug Fixes

    • MongoDB adapter: correct ObjectId handling for gt/gte/lt/lte/ne and null/undefined IDs.
    • Prisma adapter: handle ne with null and in/not_in with nulls; avoid empty-in edge case.
    • changeEmail: remove duplicate email existence check; return UNPROCESSABLE_ENTITY with a specific error code.
    • Admin types: fix UserWithRole.banned type.

Written for commit da16fde3c7. Summary will update automatically on new commits.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5690 **State:** closed **Merged:** No --- This PR introduces `better-auth/minimal`, which is aimed at reducing bundle size when Kysely is not used. Additionally, the project structure has been modified to remove Kysely. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add a Kysely-free build at better-auth/minimal to cut bundle size when you use adapters instead of direct DB connections. The default better-auth build stays the same and supports migrations and Kysely; all packages are now ESM-only. - **New Features** - New entrypoint better-auth/minimal exporting betterAuth without Kysely or migrations (runMigrations throws). - Minimal requires an adapter and rejects direct DB connections; default better-auth keeps Kysely and migrations. - Split init paths (init, initMinimal) with shared createAuthContext and adapter helpers (getAdapterWithKysely / getAdapterWithoutKysely). - ESM-only builds across packages with simplified exports. - **Bug Fixes** - MongoDB adapter: correct ObjectId handling for gt/gte/lt/lte/ne and null/undefined IDs. - Prisma adapter: handle ne with null and in/not_in with nulls; avoid empty-in edge case. - changeEmail: remove duplicate email existence check; return UNPROCESSABLE_ENTITY with a specific error code. - Admin types: fix UserWithRole.banned type. <sup>Written for commit da16fde3c71dd28e853d05034d60f9d434b9500e. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
GiteaMirror added the pull-request label 2026-04-13 09:27:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#14408