Customize the widget
Optional. Callbacks, behavior and styles of the login button.
Customize the widget
Your apiKey, and authEndpoint if you change it, go in config (Configure the widget). The components only take behavior, callback and styling props.
Props are documented with their React names; the same surface exists in every binding with the framework's idiom:
- Vue: same props in kebab-case (
:on-success,:dropdown-btn-size,:show-dropdown-when-connected, …). - Angular: styling and behavior props are inputs (
[dropdownBtnSize],[showDropdownWhenConnected], …) and callbacks are outputs:(success),(errored)and(loggedOut)inFlowBlockAuth,(linked)and(errored)inLinkBlockAuth.
FlowBlockAuth: callbacks
onSuccess(function): called after a successful login, with the user'saddress.onError(function): called when the login fails or the user closes the login window.onLogout(function): called after the user logs out from the profile menu.
FlowBlockAuth: behavior
showDropdownWhenConnected(boolean): shows the profile menu when the user is signed in (default:true).isInsideModal(boolean): set it totruewhen the button is inside your own modal (default:false).containerRef(ref): the modal's container, used withisInsideModalto detect clicks outside.buttonText(string): label of the sign-in button.
FlowBlockAuth: when your backend handles the login
With the backend routes you don't need these props. Use them only if your page already knows the user or your backend redeems the code its own way. In Angular both are inputs: [user] and [onAuthCode].
user(object | null): the signed-in user as your backend knows it ({ address, did, roles }), ornullif nobody is signed in. With it, the widget shows that user and doesn't ask/mewhen the page loads, for example when your server already renders the user.onAuthCode(function): receives{ code, codeVerifier, redirectUri }after the login instead of sending it to/code. Send it to your backend, redeem it there and return the user. Unless you also setauthEndpoint, the widget then doesn't call/meor/logoutnor check the session: close your session inonLogout.
FlowBlockAuth: styling
btnClassNamesbtnTextClassNamesdropdownBtnSize(string):"xs","small","base"or"large"(default:"small").dropdownBtnBgClassNamesdropdownBtnTextColorClassNamesdropdownBtnBorderClassNamesdropdownHeight(number)additionalDropdownItems(array): extra options for the profile menu. Each item is{ onClick, text, firstIcon?, disabled? }, wheretextis a string or a map per language ({ es, en }).
LinkBlockAuth
The account linking button. It hides itself once the user is linked.
onLinked(function): called after the account is linked.onError(function): called with the reason:already_linked,not_signed_inorfailed.buttonText(string): label of the button.btnClassNames,btnTextClassNames: same as inFlowBlockAuth.

