API Reference

To integrate Challenges from Nudge into Web, you need to make sure that the basic integration of the Nudge Core SDK is done, if you have not already done it, check here.

Please also make sure that you have tagged all the relevant UI components into theids as defined in the above docs.

Our Challenges SDK is not hosted on npm and has to be installed using a private URL setup, please reach out to your Nudge account manager to get access to the Challenges SDK.

 var challengesUi = new ChallengesUi();

Once you have integrated the Nudge Code SDK, just add the above-defined variable to the list in theplugins property of NudgeProvider

<NudgeProvider 
	app={nudge}
	plugins={[
		challengesUi,
]}>
.. 
..
..
</NudgeProvider>

That's it!

For non-JSX based libraries, use the following snippet:

NudgeProvider({app: nudge, plugins: [challengesUi]});

Our Nudge Core would now trigger Challenges defined on your Dashboard using the challengesUi plugin.

Add-on Integrations

Callback Function

The GetCallBack function from the Nudge class enables you to set up a callback mechanism to receive notifications from any screen within the Nudge package. This feature proves particularly useful when handling specific actions or events, such as a Call-to-Action (CTA) callback following the completion of a nudge flow, which includes a URL link to redirect the user to a desired location.

Example:

printCallback(response) {
      console.log(response);
    }

  streakUI.GetCallBack(printCallback);