Expose hooks and components for custom UI implementations #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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, orSignUpFormwithout 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 likegetLocalizedError,getPasswordSchema, andcn.@daveyplate/better-auth-ui/captcha: Exports theCaptchacomponent.The main
@daveyplate/better-auth-uientry point now also exports the following:useCaptcha,useIsHydrated,useOnSuccessTransition,useLangAuthUIContextAuthLocalization,PasswordValidationThis allows for greater flexibility when building custom authentication flows.