Add Respant to your Next.js site
Next.js discourages editing raw HTML directly and provides its own next/script component specifically for third-party scripts like this, it handles loading timing correctly across client-side navigation in a way a plain <script> tag paste wouldn't.
Step by step
App Router (app/layout.js or app/layout.tsx)
Open your root layout file and import Script from "next/script". Inside the <body>, add: <Script src="https://app.flenrok.com/flenrok-loader.js" data-respant-key="YOUR_WIDGET_KEY" strategy="afterInteractive" /> — the strategy="afterInteractive" prop is what makes it load at the right time without blocking your page.
Pages Router (pages/_document.js)
If your project still uses the older Pages Router, add the same <Script ...> tag inside the <Body> section of pages/_document.js instead, same strategy="afterInteractive" prop.
Rebuild and deploy
Run your normal build and deploy (npm run build, then your host's deploy step, Vercel/Netlify/your own server). Open your live URL and confirm the chatbot launcher appears, including after navigating between pages client-side, not just on a hard page load.
A plain <script> tag pasted directly into the layout also technically works, but next/script's strategy prop is Next.js's own recommended approach specifically so third-party scripts don't compete with your page's own hydration.
Your embed snippet
This is the exact line you paste. Your real snippet has your own chatbot's widget key filled in automatically, find it on your live preview screen right after you build your chatbot, or anytime from your dashboard under Website integration.
<script src="https://app.flenrok.com/flenrok-loader.js" data-respant-key="YOUR_WIDGET_KEY" async></script>
Don't type this by hand, copy it directly from your dashboard so the widget key matches your actual chatbot.
Test your widget
Open your live site in a normal browser tab, not a preview or editor view, and give the page a few seconds to fully load. Your chatbot's launcher should appear in the corner of the screen. Click it, type a real question a customer might ask, and check that the answer sounds right. If nothing shows up, clear your browser cache and reload, or double-check the snippet was saved in the right place and that you're looking at the published version of your site, not a draft.
Still stuck? Email us with your site URL and we'll take a look, or open the chatbot on the Respant site itself and ask it, it's trained to walk you through this exact step.
Haven't built your chatbot yet?
Build a working demo in minutes, free, no credit card. You'll get this exact snippet the moment it's ready.
Build My Demo Bot, Free