nudge-survey
v0.1.3
Published
To integrate Nudge Survey UI into React App, 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.](https://www.npmjs.com/package/nudge-core)
Downloads
4
Readme
React
To integrate Nudge Survey UI into React App, 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.
const survey = Survey();
Once you have integrated the Nudge Code SDK, just add the above-defined variable to the list in theplugins
property of NudgeProvider
NudgeProvider
is a HOC module that provides functionality for creating and managing plugins that can be used to integrate Nudge plugins into your applications
<NudgeProvider
uiCallBack={uiCallback}
nudgeInstance={nudge}
plugins={[survey]}
>
<!-- Your Code over here -->
</NudgeProvider>
Example of uiCallback implementation
const uiCallback = (plugins) => {
for (const plugin of plugins) {
if (plugin.ui !== <></>) {
triggerPopup(plugin.ui);
//Here the triggerPopup function triggers the survey in your UI
break;
}
}
}
That's it!
Our Nudge Core would now trigger Surveys defined on your Dashboard using the surveyUI
plugin.
"# nudge_survey_web"
"# nudge_testing_extension"