Framework integration
How to Add Testimonials to Next.js
In a Next.js app you have two clean ways to show testimonials: drop in the Testivo embed script, or fetch the JSON API and render server-side for maximum SEO. The API route returns approved testimonials as JSON so you can render them in a Server Component with your own components and ship the Review schema in the initial HTML.
1. Collect your testimonials in Testivo
Before you embed, gather some proof. Share your Testivo collection link and customers leave a text, video, or audio testimonial in about 90 seconds — no account needed on their end. Approve the ones you like, then theme your wall (grid, masonry, carousel, or popup) and copy the embed.
2. Embed the wall on Next.js
- Quick way: add the embed via next/script — <Script src="https://testivo.tech/embed/wall.js" data-slug="your-slug" strategy="afterInteractive" /> plus a <div className="testivo-wall" data-slug="your-slug" />.
- SEO-max way: in a Server Component, fetch GET /api/embed/wall/your-slug and map the JSON into your own testimonial components so the content is in the server-rendered HTML.
- Add the Review JSON-LD to the page (a <script type="application/ld+json"> in your layout or page) so ratings are machine-readable from first paint.
This is the snippet you'll paste:
<script src="https://testivo.tech/embed/wall.js" data-slug="your-slug" async></script>
<div class="testivo-wall" data-slug="your-slug"></div>3. Bonus: your testimonials are AI-readable
Most Next.js testimonial widgets render inside an iframe that Google and AI assistants can't read. Testivo's wall renders same-origin and ships Schema.org Review markup automatically — free, on every plan — so when a buyer asks ChatGPT, Perplexity, or Google's AI “is {your product} any good?”, your real customer proof is what they read. Here's the JSON-LD it generates for you:
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Your Product",
"review": [{
"@type": "Review",
"author": { "@type": "Person", "name": "Jane Doe" },
"reviewRating": { "@type": "Rating", "ratingValue": 5, "bestRating": 5 },
"reviewBody": "Testivo made collecting testimonials effortless."
}],
"aggregateRating": {
"@type": "AggregateRating", "ratingValue": "4.9", "reviewCount": 27, "bestRating": 5
}
}Testivo also publishes an llms.txt feed of your testimonials and allows AI crawlers (GPTBot, ClaudeBot, PerplexityBot) by default. No paid tier, no copy-paste schema snippet.
Frequently asked questions
Should I use the embed script or the API in Next.js?
Use the JSON API (/api/embed/wall/:slug) in a Server Component for the best SEO — the testimonials land in server-rendered HTML. The embed script is fine for a quick client-side drop-in.
Does this work with the App Router and Server Components?
Yes. Fetch the API in an async Server Component (with Next's fetch caching/revalidate as you like) and render the results; no client JavaScript is required to show the testimonials.
How do I get star ratings into Google from Next.js?
Render a <script type="application/ld+json"> block with Review/AggregateRating using the API data. Testivo also returns this schema, so you can serve it directly in the initial HTML.
Add AI-readable testimonials to Next.js — free
Collect your first testimonial in minutes. No credit card, schema included on every plan.