deployment-sanity-webhook

Configures Vercel deployments, Sanity revalidation webhooks, environment variables, and CORS for Next.js sites.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/ebecerra-developer/ebecerra-web --skill deployment-sanity-webhook-ebecerra-developer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: deployment-sanity-webhook
Source: https://github.com/ebecerra-developer/ebecerra-web/tree/main/.claude/skills/deployment-sanity-webhook
Command: npx skills add https://github.com/ebecerra-developer/ebecerra-web --skill deployment-sanity-webhook-ebecerra-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Published Sanity content often fails to appear on production Next.js sites because of misconfigured revalidation webhooks, unsynced secrets, or CDN caching, and this Skill provides the operational runbook to configure and diagnose the full deployment pipeline. ## Core Features & Use Cases - Webhook Configuration: Defines exact Sanity webhook URLs with mandatory trailing slashes and URL-encoded secrets so POST requests reach the Next.js revalidate endpoint instead of dying on 308 redirects. - Secret Rotation Runbook: Keeps SANITY_REVALIDATE_SECRET synchronized across .env.local, Vercel env vars, and the Sanity webhook query string to avoid 401 failures. - Revalidation Diagnostics: Provides a step-by-step checklist (hard refresh, webhook delivery history, trailing slash, URL encoding, Versions checkbox, manual revalidate, useCdn flag) for the "published but not visible" problem. - Use Case: After rotating the revalidation secret, follow the runbook to update all three locations at once and verify delivery in the Sanity webhook history before a demo. ## Quick Start Use the deployment-sanity-webhook skill to diagnose why my published Sanity changes are not showing up on ebecerra.es.

Frequently Asked Questions about deployment-sanity-webhook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a Sanity webhook to revalidate a Next.js site?▼

Create a POST webhook in manage.sanity.io pointing to https://yourdomain/api/revalidate/?secret=<URL-encoded-secret> with Create, Update, and Delete triggers, the filter !(_id in path("drafts.**")), and the Versions checkbox enabled. The URL must end with a trailing slash if Next.js uses trailingSlash: true.

Why is my Sanity publish not showing on my Next.js site?▼

Check the webhook delivery history in manage.sanity.io for a recent 200 response, verify the URL has a trailing slash (otherwise Next.js returns a 308 redirect Sanity will not follow), confirm the secret is URL-encoded, and ensure useCdn is false in the Sanity client. You can also trigger the revalidate endpoint manually to isolate the webhook as the cause.

Why does my Sanity webhook return a 308 redirect or 401 error?▼

A 308 means the webhook URL is missing the trailing slash required by Next.js trailingSlash config, and Sanity does not follow redirects on POST. A 401 means the secret in the webhook URL does not match the SANITY_REVALIDATE_SECRET environment variable, often because it was not URL-encoded or not rotated in all locations.

Should I use useCdn true or false with Sanity and Next.js ISR?▼

Set useCdn to false when Next.js ISR already handles caching. With useCdn true, the Sanity CDN caches responses independently, so publishes do not appear until the CDN cache expires, defeating the on-demand revalidation webhook.

How do I rotate a Sanity revalidation secret without breaking webhooks?▼

Update the secret in all three places at once: the app's .env.local file, the Vercel project environment variables, and the URL-encoded query string of the Sanity webhook. Rotating only some locations causes the webhook to return 401 until everything is synchronized.