
Step 1: Load the Widget Script
Load the Set PIN widget script into your page:Step 2: Get a Widget Token
Request a widget token for setting the PIN:Step 3: Add the Widget Component
Add the<set-pin> web component to your page:
Configuration Options
Custom Labels
Customize the labels displayed in the widget:widgetTitle- Widget header textpinLabel- PIN field labelconfirmPinLabel- Confirm PIN field labelpinPlaceholder- PIN field placeholderconfirmPinPlaceholder- Confirm PIN placeholdersubmitButtonText- Submit button textsubmitLoadingText- Loading state text
Event Handling
The widget dispatches lifecycle events across two phases:load— Widget initialized successfully, all fields are ready for user input.error— Widget failed to initialize (field load failure, network error, or timeout).success— PIN was set successfully.failure— PIN setting failed (PINs do not match, expired widget token, or API error).
addEventListener or callback properties:
Load Event
Dispatched when all secure input fields have loaded and the widget is fully functional. Use it to hide loading UI or enable dependent controls.Error Event
Dispatched when the widget fails to initialize. This means one or more secure input fields could not load, and the widget is not functional. Show an error message or retry UI to the user.Success and Failure Events
Dispatched after the user submits the PIN form. Commonfailure reasons include mismatched PINs and expired widget token.
The success event exposes only non-sensitive status metadata:
PIN values are never included in host-page event details.

