Skip to main content

React (Vite or Create React App)

Add the script to your index.html file. This loads the widget on every page of your app.

Next.js — App Router

Use the next/script component in your root layout. The afterInteractive strategy loads the widget once the page is interactive, so it won’t block rendering.
app/layout.tsx

Next.js — Pages Router

Add the widget to _app.tsx using next/script. It will render on every page.
pages/_app.tsx
Always use next/script rather than a plain <script> tag in Next.js. It handles loading strategy and deduplication automatically.