Next.js
Add the TellTide feedback widget to a Next.js site in a few lines.
Use this guide when your product is a Next.js app and you want the TellTide launcher on every page (or on specific layouts).
Before you start
- Create an app in Apps and note your App ID.
- Set App link to your Next.js site URL (e.g.
https://shop.example.com). - Customize the widget in Manage Widget and click Save.
App Router — root layout (recommended)
Add the TellTide script once in your root layout so it loads on all pages:
// app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<script
src="https://telltide.com/src/widgets/widget.js"
data-app-id="YOUR_APP_ID"
async
/>
</body>
</html>
);
}
Replace YOUR_APP_ID with your App ID from the dashboard.
Using next/script (optional)
Next.js can load third-party scripts with its Script component:
import Script from 'next/script';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
{children}
<Script
src="https://telltide.com/src/widgets/widget.js"
data-app-id="YOUR_APP_ID"
strategy="lazyOnload"
/>
</body>
</html>
);
}
lazyOnload defers loading until after the page is interactive — good for performance. The widget still appears on every route.
Only on certain pages
If you do not want the widget on every page, add the script in a nested layout instead of the root layout:
// app/(marketing)/layout.tsx — example: only marketing pages
export default function MarketingLayout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
<script
src="https://telltide.com/src/widgets/widget.js"
data-app-id="YOUR_APP_ID"
async
/>
</>
);
}
App link & environments
| Environment | What to do |
|---|---|
| Production | App link hostname must match your live site (e.g. shop.example.com) |
| localhost | Works for local testing without changing App link |
| Vercel preview URLs | Create a separate TellTide app per preview hostname, or test on localhost |
Verify
- Run your Next.js app and open it in the browser.
- Click the TellTide launcher (bottom corner by default).
- Submit test feedback.
- Open Feedbacks in TellTide — the submission should appear.
Related
- Integration overview
- Widget reference — optional
data-*attributes - Troubleshooting
