Add support for modular usage of core features #705

Closed
opened 2026-03-13 08:01:02 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Vicentesan on GitHub (Feb 19, 2025).

Is this suited for github?

  • Yes, this is suited for github

I want to integrate Better Auth into my backend, but I need more control over the authentication flow. Currently, it seems like Better Auth primarily relies on a global handler for all auth routes, which limits flexibility. For example, I would like to create my own custom sign-up route where I can use Better Auth for specific tasks like hashing passwords or handling providers, but still retain control over the route's logic and implementation.

This lack of flexibility makes it harder to adapt Better Auth to custom use cases or integrate it seamlessly into existing backend architectures.

Describe the solution you'd like

I would like Better Auth to provide a way to use its core functionalities (e.g., password hashing, provider handling, etc.) without being tied to a global handler. This could be achieved by exposing modular methods or utilities that can be used in custom routes.

For example:

  • A method to hash passwords that can be called directly in my custom route.
  • A way to handle authentication providers (e.g., OAuth) programmatically within my own route logic.
  • The ability to mix and match Better Auth's features with my own backend logic while still leveraging its security and best practices.

This would allow developers to integrate Better Auth into their projects in a more flexible and customizable way.

Describe alternatives you've considered

Using the global handler: While this works for some cases, it doesn't provide the level of control I need for custom routes or specific use cases.

Implementing custom auth logic from scratch: This would give me full control, but it defeats the purpose of using Better Auth, which is to simplify and secure authentication processes.

Additional context

If this"feature" aligns with the project's goals or vision, I would love to contribute to the implementation of this functionality. I'm excited about the potential of Better Auth and would be happy to help make it more flexible and developer-friendly!

Originally created by @Vicentesan on GitHub (Feb 19, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I want to integrate Better Auth into my backend, but I need more control over the authentication flow. Currently, it seems like Better Auth primarily relies on a global handler for all auth routes, which limits flexibility. For example, I would like to create my own custom sign-up route where I can use Better Auth for specific tasks like hashing passwords or handling providers, but still retain control over the route's logic and implementation. This lack of flexibility makes it harder to adapt Better Auth to custom use cases or integrate it seamlessly into existing backend architectures. ### Describe the solution you'd like I would like Better Auth to provide a way to use its core functionalities (e.g., password hashing, provider handling, etc.) without being tied to a global handler. This could be achieved by exposing modular methods or utilities that can be used in custom routes. For example: - A method to hash passwords that can be called directly in my custom route. - A way to handle authentication providers (e.g., OAuth) programmatically within my own route logic. - The ability to mix and match Better Auth's features with my own backend logic while still leveraging its security and best practices. This would allow developers to integrate Better Auth into their projects in a more flexible and customizable way. ### Describe alternatives you've considered **Using the global handler**: While this works for some cases, it doesn't provide the level of control I need for custom routes or specific use cases. **Implementing custom auth logic from scratch**: This would give me full control, but it defeats the purpose of using Better Auth, which is to simplify and secure authentication processes. ### Additional context If this"feature" aligns with the project's goals or vision, I would love to contribute to the implementation of this functionality. I'm excited about the potential of Better Auth and would be happy to help make it more flexible and developer-friendly!
Author
Owner

@Vicentesan commented on GitHub (Feb 19, 2025):

i noticed the utils package exists but lacks key features like provider authentication and the community plugins

@Vicentesan commented on GitHub (Feb 19, 2025): i noticed the utils package exists but lacks key features like provider authentication and the community plugins
Author
Owner

@dosubot[bot] commented on GitHub (Jun 12, 2025):

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

Issue Summary:

  • Request for modular support to enhance control over authentication flow.
  • Suggestion to expose methods for password hashing and provider handling.
  • Existing utils package lacks key features like provider authentication and community plugins.

Next Steps:

  • Is this issue still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jun 12, 2025): Hi, @Vicentesan. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - Request for modular support to enhance control over authentication flow. - Suggestion to expose methods for password hashing and provider handling. - Existing utils package lacks key features like provider authentication and community plugins. **Next Steps:** - Is this issue still relevant to the latest version of the better-auth repository? If so, please comment to keep the discussion open. - Otherwise, this issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#705