nudge-survey
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

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"

Readme

Keywords

none

Package Sidebar

Install

npm i nudge-survey

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

377 kB

Total Files

18

Last publish

Collaborators

  • nudgenow