Embedding Next.js Chat Pop-Up into Websites Without iFrame
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
### Summary
Hey next.js community,
I've built a chat pop-up using next.js, source code is available [in my repo](https://github.com/furiousteabag/chat-ui-next). To deploy, I added an
My goal is to embed this pop-up into other websites. I've tried doing it via
With this approach, website content becomes uninteractive because
So I think the only option is to serve the app with the loader script. But in the
So the question is how to embed my next.js app into other websites? Maybe I could use next.js serving (
I am happy to provide any additional information.
Thank you in advance!
Hey next.js community,
I've built a chat pop-up using next.js, source code is available [in my repo](https://github.com/furiousteabag/chat-ui-next). To deploy, I added an
output: "export" to nextConfig and I am serving the out/ folder with nginx. It is running live here: https://chat-popup.askguru.ai/?token=123My goal is to embed this pop-up into other websites. I've tried doing it via
iframe like this:<iframe
src="https://chat-popup.askguru.ai/?token=123"
style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;"
/>With this approach, website content becomes uninteractive because
iframe fills the whole screen. I am not able to predefine the size of an iframe in advance because the logic of changing the size of a pop-up is tricky and in some cases, the app might fill the whole screen. I don't want to manage the size of an iframe in the app itself.So I think the only option is to serve the app with the loader script. But in the
out/ folder there is no single .js bundle that may be served. In a plain react app, for example, I have used node scripts/build.js to get a single bundle.js as well as .css.So the question is how to embed my next.js app into other websites? Maybe I could use next.js serving (
next start) somehow?I am happy to provide any additional information.
Thank you in advance!