Skip to content

Conversation

@regenrek
Copy link

@regenrek regenrek commented Jun 15, 2025

This pull request exposes several internal hooks, components, and utility functions to provide developers with the flexibility to build custom authentication user interfaces.

Previously, many of the core building blocks were not exported from the package. This made it difficult to create custom implementations of forms like SignInForm, MagicLinkForm, or SignUpForm without needing to fork the library or eject from the pre-built components.

With these changes, developers can now import the necessary primitives directly and compose them to create bespoke authentication experiences tailored to their application's needs. This is especially useful if you want to reimplement sign-in, magic link sign-in, or sign-up flows with your own TSX markup.

What's new?

We've added new entry points to make these imports available:

  • @daveyplate/better-auth-ui/utils: Exports utility functions like getLocalizedError, getPasswordSchema, and cn.
  • @daveyplate/better-auth-ui/captcha: Exports the Captcha component.

The main @daveyplate/better-auth-ui entry point now also exports the following:

  • Hooks: useCaptcha, useIsHydrated, useOnSuccessTransition, useLang
  • Context: AuthUIContext
  • Types: AuthLocalization, PasswordValidation

This allows for greater flexibility when building custom authentication flows.

@daveycodez
Copy link
Contributor

I would just export these from the root package instead of /utils and /captcha just to keep it consistent with the rest of the library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants