Instant publishing
New to this? Copy the prompt and paste it into Claude Code — it walks you through the whole setup and tells you what to put where.
Your webhook secret
Copy this into both your site's RILL_WEBHOOK_SECRET and Settings → Integrations. It is generated here in your browser.
…This step is optional. Without a webhook, an edit appears on your site once the SDK's revalidate window lapses — an hour by default. With one, it appears on the next request. Skip it if an hour is fine.
The secret is generated for you in the panel above — copy it into both places below. Everything here is also in the prompt, so an AI can wire it up for you.
Mount the handler
// app/api/rill/revalidate/route.ts
import { createRevalidateHandler } from '@rillpage/sdk/next'
export const POST = createRevalidateHandler({
secret: process.env.RILL_WEBHOOK_SECRET!,
})Point Rill at it
Add the URL and the same secret under Integrations in settings. Publishing then invalidates the tag for that specific post, plus the list.
How the caching works
Every request the SDK makes is tagged: rill:posts for a list, and rill:post:<slug> for one post. The webhook calls revalidateTag for both, so a publish refreshes exactly the affected pages rather than dropping your entire cache.
The revalidate window is the backstop. A webhook that never arrives — because a deploy was mid-flight, or the secret was rotated — means content is late, not permanently stale.
createRillClient({
apiKey: process.env.RILL_API_KEY!,
revalidate: 3600, // seconds; false to cache until told otherwise
})Next: Writing from Claude Code