data-chatbot-id value), and use the src address from that snippet.

The data-chatbot-id value in the embed code is your agent ID.
App component, not in a page component, so the widget loads once and
stays open when the visitor moves between pages.
In Next.js (App Router) you can instead add the snippet with the Script component from next/script
in your root layout.
The widget’s text, colours and behaviour come from the AI agent page, so you don’t pass any settings
in your code. The only attribute you set is data-chatbot-id.
Open the chat from your own button
Once the script has loaded, the page has awindow.ChatWidget object. Calls made before the widget
finishes loading are queued:
open(), close() and toggle() are available.