On a statically built or ISR page, comments that arrive only via client fetch are invisible to search engines and absent until JavaScript runs. For a post whose discussion is half its value, that's a real cost.
import { ServerComments } from "@vlozi/blog/server";
export default async function PostPage({ params }) {
const post = await getPost(params.slug);
return (
<article>
{/* … */}
<ServerComments siteId="site_abc123" target={`post:${post.id}`} />
</article>
);
}An async Server Component — no hooks, no client bundle, no API key.
| Prop | |
|---|---|
siteId |
required |
target |
required |
title |
heading, or null |
limit |
default 50 |
emptyState |
rendered when there's nothing (default: nothing at all) |
className |
It's read-only, on purpose
There's no form. Accepting a comment needs a rate limiter, an origin check and a honeypot, none of which a server render can provide.
To have both, use the server component for the thread and the client one for the form:
<ServerComments siteId={SITE} target={target} />
<Comments target={target} readOnly={false} title={null} />Keeping it fresh
ServerComments doesn't cache — it fetches on each render and leaves revalidation to your page, where it belongs:
export const revalidate = 300; // Next.js: rebuild this page every 5 minutesIf you want new comments to appear immediately, turn on site-sync (Dashboard → Engagement → Settings). It notifies your site when a comment goes public, so a rebuild is triggered by the event rather than by a timer.
When a fetch fails
It renders nothing and your page builds normally. An ISR revalidation that couldn't reach us leaves the last good HTML in place rather than replacing your post with an error.