Skip to main content
Axle widgets are full-viewport overlays that surface additional user experiences within your application, similar to Axle Ignition. Currently, validation is the only supported widget type - it displays a policy’s validation result to the user.

Start a widget session

Once you have a validationResult from Validate Policy, start a widget session using the Start Widget endpoint. This returns a widgetToken and a widgetUri to display to the user.
Request Sample
Response

Appending origin or redirect URI

Before rendering the widget, your application should append either origin (for web) or redirectUri (for mobile) as a query parameter to the widgetUri. This tells the widget how to communicate back to your application on exit. Web:
Mobile:

Web: Display in iframe

1

Open iframe

Render the widgetUri (with origin appended) in an iframe set to 100% width and 100% height of the viewport. Axle handles all internal layout and scrolling, so your application doesn’t need to manage the widget’s sizing.
2

Listen for MessageEvent

Add an event listener on the parent window. For security, verify that the message origin is the Axle widget domain (e.g., https://widget.sandbox.axle.insure) before processing.
3

Process the exit event

When the user closes or exits the widget, remove the iframe (or close the modal) and return the user to the previous view.
Page with iframe and eventListener (example)

Mobile: Display in native webview

Open the widgetUri (with redirectUri appended) in a native webview. When the user exits the widget, Axle redirects to the redirectUri you provided with a status query parameter appended:
Your native app should catch this redirect and close the webview.

Widget events

onExit

Emitted when the user closes or exits the widget (e.g., clicks a close button or back action). Via postMessage (web):
Via redirect (mobile):
When your application receives this event, it should tear down the iframe or close the webview and return the user to the previous view.
That’s it - your users can now view their validation result through Axle’s widget without leaving your application 🎉.