If your app has very few page refreshes and lots of asynchronous JS, you'll need to integrate the updates widget in a slightly different way to ensure your customers are seeing the latest notifications.

There are a number of ways to achieve this, here are some methods based on a React app (although these examples are React-based, the concept applies to all single page apps):


DOM Method (recommended)

Resources:

  1. https://stackoverflow.com/a/34425083
  2. https://medium.com/better-programming/4-ways-of-adding-external-js-files-in-reactjs-823f85de3668


Adding React-script-tag

Resources:

  1. https://medium.com/better-programming/4-ways-of-adding-external-js-files-in-reactjs-823f85de3668