To embed a chatbot in a Next.js app, load your provider’s script with the Next.js Script component instead of a raw script tag. In the App Router, add it to app/layout.tsx so the chatbot appears across all routes; in the Pages Router, place it in _app.tsx or a single page. For customgpt.ai, copy the Embed, Live Chat, or Website Copilot code and paste it into those Script blocks.