ne
nextjs
Next.js
Use next/script in the root layout.
Install in Next.js (App Router)
- Copy your project key from the owni.chat Installation page.
- In
app/layout.tsx(orsrc/app/layout.tsx) add:
import Script from 'next/script';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<Script
src="https://app.owni.chat/widget/embed.js"
strategy="afterInteractive"
data-project-key="YOUR_PROJECT_KEY"
/>
</body>
</html>
);
}
- Deploy and open your site. Confirm the widget loads, then run Check installation.
Pages Router
Place the same <Script> component in pages/_app.tsx or pages/_document.tsx before </body>.
Ready to install?
Create a free account, open your project Installation page, and paste the embed code.
Start free