Your campaign widget exposes various functionality to your site in order to create seamless onboarding experiences.
1. Load Campaign Widget
You can embed the campaign widget on your website using a personal embed script or using our JS SDK.
1.1. Personal embed script
Inject the campaign widget in your site using a script tag similar to this. You'll find your script in the Developer -> General section of your campaign.
Some interactions with the campaign widget are exposed to the parent window and you can invoke them as described below.
// Will show the widgetwindow.THXWidget.show(true);// Will hide the widgetwindow.THXWidget.show(false);// Will navigate inside the widget to different routeswindow.THXWidget.open("/quests");window.THXWidget.open("/rewards");window.THXWidget.open("/wallet");window.THXWidget.signin() // Sign in (Popup on large screens, redirect on small screens)window.THXWidget.signout() // Sign out:)// Will show the widget and open the virtual wallet connect viewwindow.THXWidget.connect("a6021617-9aab-4194-b2af-a4dd0cc96f84");// Will store the Identity and connect to an account after a sign inwindow.THXWidget.setIdentity("a6021617-9aab-4194-b2af-a4dd0cc96f84");// public var updated by widget app// null (signed out), false (signing in), true (signed in)window.THXWidget.isAuthenticated