Skip to content

PostMessage reference

Events the widget posts to your page (handle the ones you care about):

EventWhenYour response
INIT_CONFIGWidget loaded and needs configurationSend WIDGET_CONFIGS
AUTH_REQUIREDWidget needs a preauth tokenSend PREAUTH
IDENTITY_STARTEDIdentity form openedOptional: send IDENTITY to prefill
LOGIN_SUCCESSFUL / LOGIN_FAILEDLogin outcome—
USER_ENROLLED / IDENTITY_FAILEDIdentity-verification outcome—
OTP_STARTED / ONBOARDING_STARTEDStep transitions in the Prefill + Onboarding flow—
SERVICE_FAILUREAn external service is down—
CLOSEUser clicked the close button—

Plus error events (UNKNOWN_USER, BAD_CREDENTIALS, PREAUTH_TOKEN_EXPIRED, THIN_FILE_ERROR, …) carrying the same SC-codes returned by the API.

Commands your page posts to the widget:

TypeWhenPayload
WIDGET_CONFIGSIn response to INIT_CONFIGBranding, flags, identity flow (see example)
PREAUTHIn response to AUTH_REQUIRED{ token: 'eyJhbGciOi...' } or { token: null } on failure
IDENTITYIn response to IDENTITY_STARTEDIdentity fields to prefill — fname/lname/mobile (both Classic and Prefill + Onboarding)

Full WIDGET_CONFIGS field list:

FieldTypeDefaultDescription
keystring(required)Your customer host key (UUID)
flagsstring'0'Feature-flags bitmask — controls which UI sections render
themestring'#3f7cfc'Primary brand color (hex)
formLabelColorstring—Form label text color (hex)
linkColorstring—Link text color (hex)
popupModeFormsbooleanfalseShow registration/identity forms in a modal popup
redirectViewstring'dashboard'Post-login view: all-in-one / dashboard / tile-view
identityDisclaimerbooleanfalseShow full disclaimer text on identity screen
identityScreenTitleTextstring'Sign Up'Title text on the identity verification screen
mobileIdentityScreenTitleTextstring—Title text on the mobile verification screen
hideBackgroundImgbooleanfalseHide the default background image
hideHeaderLogobooleanfalseHide the logo in the header
hideFooterLogobooleanfalseHide the logo in the footer
eidFailedRedirectstring'default'Behavior on identity failure: close / none / default
verificationMethodstring'dit_smfa'Identity verification flow: dit_smfa (Digital Identity Trust + Secure Multi-Factor Authentication, default), prefill_onboarding (Prefill + Onboarding), or dit_customer_otp (Digital Identity Trust + Customer OTP)