5
5 Comments

Do you have a simple template for a JavaScript widget that launches some 3rd party content on a website?

I understand that's not really hard in practice, but I would rather not reinvent a wheel and make any obvious mistakes. If I look at JS widgets from players like Intercom, or GA, those are filled with thousands lines of code. Do you have, or have you seen something basic, that I can start from?

on December 12, 2019
  1. 1

    I’ve built a few widgets using Preact Habitat. Check it out here https://github.com/zouhir/preact-habitat

  2. 1

    I'm interested as well
    From what I checked, almost all of them are using iframe to display the data. But what about the security, injection,....

    1. 1

      Right, they might be iframing it, but it's not always added as a straight-forward iframe.
      Maybe I am overthinking it with the whole JS thing...

  3. 1

    Can you elaborate on what you mean by “launches”?

    1. 1

      Could be anything from displaying an image, to having a submit-form. I understand that a form has a lot more complexities.