Helper
Chat Widget

Other Frameworks

Integrate the Helper Chat Widget with other JavaScript frameworks

We'd love to help you integrate Helper with your framework! If you have a working integration example for a framework not listed here, please let us know and we'll add it to this page.

Contact us through the chat widget or reach out to our support team with your integration example.

Turbo (Rails, Stimulus)

If you're using Turbo with Rails or other frameworks, you'll need to:

  1. Add the data-delay-init attribute to the widget script tag:
<script src="https://<your-helper-host>/widget/sdk.js" data-delay-init></script>
  1. Handle page navigation events to properly initialize and destroy the widget:
const config = {
  // ... your configurations
};
 
document.addEventListener("turbo:load", async () => {
  try {
    HelperWidget.destroy();
    await HelperWidget.init(config);
  } catch (error) {
    console.error("Error during Turbo load:", error);
  }
});

Since Turbo replaces the entire document's body on navigation, reinitializing the widget ensures it functions correctly across pages, avoids DOM conflicts, and maintains consistent behavior.

General Integration Guidelines

If you run into issues using the Helper widget with a single-page app framework, try the following:

  1. Disable automatic initialization by adding the data-delay-init attribute to the widget script tag.
  2. Initialize the widget using HelperWidget.init when your page/component mounts.
  3. Destroy the widget using HelperWidget.destroy when your page/component unmounts to prevent memory leaks.
  4. Handle navigation events if your framework uses client-side routing.

On this page