Next.js
App Router or Pages Router.
app/layout.tsx (App Router) or pages/_document.tsx (Pages Router)
Copy your snippet
In your SiteMind dashboard, open Widget Studio and copy the embed code. It is one script tag with your widget key in it.
Open your root layout
App Router (Next.js 13+): open app/layout.tsx. Pages Router: open pages/_document.tsx instead.
Paste the snippet
Paste it as JSX, just before the closing </body> tag inside the returned markup (Pages Router: inside <Body>, before </Body>).
Save
Save the file. Your dev server hot-reloads, or redeploy for production.