0.1.3 • Published 8 months ago

nudge-survey v0.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

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"

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago