Developer documentation
Publishing webhooks let ContioReach notify your application when content changes.
This is especially useful when your frontend uses cached or statically generated pages. Instead of repeatedly checking whether content changed, your application can refresh the relevant pages when ContioReach sends a webhook.
A typical publishing flow looks like this:
Inside your workspace:
Store the generated token in your application:
REVALIDATION_SECRET=your_generated_secret_tokenCreate:
app/api/revalidate/route.tsimport { revalidatePath } from "next/cache";
export async function POST(request: Request) {
const { secret, post } = await request.json();
if (
secret !==
process.env.REVALIDATION_SECRET
) {
return Response.json(
{ error: "Invalid token" },
{ status: 401 }
);
}
revalidatePath("/blog");
if (post?.slug) {
revalidatePath(`/blog/${post.slug}`);
}
return Response.json({
revalidated: true
});
}When ContioReach sends the webhook, your application verifies the secret before revalidating content.
The example refreshes:
/blogand, when the payload includes a post slug:
/blog/[slug]This keeps both the blog listing and the individual article current.
The webhook secret should be treated like a credential. Do not expose it in browser code or commit it to a public repository.
Always verify the secret before performing revalidation.