'I am trying to create widget in next.js app

My website is almost complete on next.js. I am trying to create widget to one of my component that can be embedded on any website without iframe. Please help me out



Solution 1:[1]

Use a Web Component Framework

First understand what web components are.

https://developer.mozilla.org/en-US/docs/Web/Web_Components

recommended frameworks

Your website being in next.js would not be a factor here. You should build your web component then serve it via CDN or via static folder in next.js. You could reuse your REST routes or styles etc. but you would want a proper modern web component.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1