[GH-ISSUE #6183] make kysely optional #19064

Open
opened 2026-04-15 17:50:52 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @benmccann on GitHub (Nov 22, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/6183

Originally assigned to: @ping-maxwell on GitHub.

Is this suited for github?

  • Yes, this is suited for github

kysely is described as optional: https://www.better-auth.com/docs/guides/optimizing-for-performance#bundle-size-optimization

However, there is no way to avoid downloading it: https://npmgraph.js.org/?q=better-auth@1.4.0. If it has a supply chain issue, users will be exposed to it regardless of whether they need it. It also is a fairly large dependency weighing in at 3.2MB

Describe the solution you'd like

Move kysely to an adapter or make it an optional peer dependency

Describe alternatives you've considered

Making it an adapter vs an optional peer dependency each have their own trade-offs, but both would avoid the dependency

Additional context

No response

Originally created by @benmccann on GitHub (Nov 22, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/6183 Originally assigned to: @ping-maxwell on GitHub. ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. kysely is described as optional: https://www.better-auth.com/docs/guides/optimizing-for-performance#bundle-size-optimization However, there is no way to avoid downloading it: https://npmgraph.js.org/?q=better-auth@1.4.0. If it has a supply chain issue, users will be exposed to it regardless of whether they need it. It also is a fairly large dependency weighing in at 3.2MB ### Describe the solution you'd like Move kysely to an adapter or make it an optional peer dependency ### Describe alternatives you've considered Making it an adapter vs an optional peer dependency each have their own trade-offs, but both would avoid the dependency ### Additional context _No response_
GiteaMirror added the coredatabase labels 2026-04-15 17:50:53 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 22, 2025):

Thanks for opening this issue! We understand that although kysely is described as optional for bundle size optimization, users still end up downloading it even if they don’t need it. We’re looking into potential solutions such as moving kysely to an adapter or making it an optional peer dependency to avoid unnecessarily exposing the dependency in case of a supply chain issue [1]. Could you share more about your use-case or requirements for this change? tag @better-auth-agent if you would like an answer from the Agent.

DiagramDiscordGitHub

Diagram Join Star

<!-- gh-comment-id:3565517546 --> @better-auth-agent[bot] commented on GitHub (Nov 22, 2025): Thanks for opening this issue! We understand that although kysely is described as optional for bundle size optimization, users still end up downloading it even if they don’t need it. We’re looking into potential solutions such as moving kysely to an adapter or making it an optional peer dependency to avoid unnecessarily exposing the dependency in case of a supply chain issue [[1]](https://github.com/better-auth/better-auth/issues/3946). Could you share more about your use-case or requirements for this change? tag @better-auth-agent if you would like an answer from the Agent. <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@dosubot[bot] commented on GitHub (Feb 21, 2026):

Hi, @benmccann. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested making the "kysely" dependency optional or moving it to an adapter to reduce bundle size and supply chain risks.
  • Currently, "kysely" is always downloaded despite being described as optional.
  • The better-auth-agent team acknowledged the issue and is considering solutions like making "kysely" an optional peer dependency or moving it to an adapter.
  • They have asked you for more details about your use case to better address the request.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of better-auth by commenting here.
  • If I don’t hear back from you within 7 days, this issue will be automatically closed.

Thanks for your understanding and contribution!

<!-- gh-comment-id:3939031932 --> @dosubot[bot] commented on GitHub (Feb 21, 2026): Hi, @benmccann. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested making the "kysely" dependency optional or moving it to an adapter to reduce bundle size and supply chain risks. - Currently, "kysely" is always downloaded despite being described as optional. - The better-auth-agent team acknowledged the issue and is considering solutions like making "kysely" an optional peer dependency or moving it to an adapter. - They have asked you for more details about your use case to better address the request. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of better-auth by commenting here. - If I don’t hear back from you within 7 days, this issue will be automatically closed. Thanks for your understanding and contribution!
Author
Owner

@lishaduck commented on GitHub (Feb 21, 2026):

Not stale, kysely is still required.

<!-- gh-comment-id:3939082551 --> @lishaduck commented on GitHub (Feb 21, 2026): Not stale, kysely is still required.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19064