{"id":15817111,"url":"https://github.com/evavic44/sanity-nextjs-revalidation","last_synced_at":"2026-04-28T08:33:15.056Z","repository":{"id":212695317,"uuid":"731706081","full_name":"Evavic44/sanity-nextjs-revalidation","owner":"Evavic44","description":"A simple guide to illustrate how to setup on-demand revalidation in Sanity and Nextjs app directory","archived":false,"fork":false,"pushed_at":"2024-04-06T07:49:19.000Z","size":125,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-06T05:22:13.850Z","etag":null,"topics":["app-dir","groq","isr","nextjs","revalidation","sanity","webhooks"],"latest_commit_sha":null,"homepage":"https://sanity-nextjs-revalidate.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Evavic44.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-14T17:24:12.000Z","updated_at":"2024-01-23T11:18:07.000Z","dependencies_parsed_at":"2024-04-06T08:40:55.456Z","dependency_job_id":null,"html_url":"https://github.com/Evavic44/sanity-nextjs-revalidation","commit_stats":null,"previous_names":["evavic44/sanity-nextjs-revalidation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Fsanity-nextjs-revalidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Fsanity-nextjs-revalidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Fsanity-nextjs-revalidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evavic44%2Fsanity-nextjs-revalidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Evavic44","download_url":"https://codeload.github.com/Evavic44/sanity-nextjs-revalidation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246586105,"owners_count":20801026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["app-dir","groq","isr","nextjs","revalidation","sanity","webhooks"],"created_at":"2024-10-05T05:22:13.724Z","updated_at":"2026-04-28T08:33:10.018Z","avatar_url":"https://github.com/Evavic44.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a guide to explain how to set-up on-demand revalidation in a Sanity Nextjs project. Read the [article][article-link]. Visit the [live demo][live-demo] to see the project live.\n\n## Live Preview\n\n![preview][preview]\n\n## Prerequisites\n\nThis template uses the following versions:\n\n- Nextjs: `v14.0.4`\n- next-sanity: `v7.0.4`\n- sanity: `3.21.3`\n- React: `v18`\n\n### Important files and folders\n\n| File(s)                                        | Description                                         |\n| ---------------------------------------------- | --------------------------------------------------- |\n| [`sanity.config.ts`](sanity.config.ts)         | Config file for Sanity Studio                       |\n| [`sanity.client.ts`](lib/sanity.client.ts)     | Config file for Sanity CLI                          |\n| [`studio`](./app/studio/[[...index]]/page.tsx) | Where Sanity Studio is mounted                      |\n| [`schemas`](./schema/index.ts)                 | Where Sanity Studio gets its content types from     |\n| [`sanity.query.ts`](./lib/sanity.query.ts)     | Where Sanity data is described and retrieved        |\n| [`route.ts`](./app/api/revalidate/route.ts)    | Route handler for triggering on-demand revalidation |\n\n## Run project locally\n\n- clone repository\n\n```bash\ngit clone https://github.com/Evavic44/sanity-nextjs-revalidation.git\n\ncd sanity-nextjs-revalidation\n\nnpm install\n```\n\n- Rename `.env.example` to `.env`\n\n### Update Env Variables\n\n- `NEXT_PUBLIC_SANITY_PROJECT_ID` Set to your project ID\n- `NEXT_PUBLIC_SANITY_DATASET` Set to \"server\" or a new project dataset.\n- `NEXT_PUBLIC_SANITY_API_VERSION`: Set to your current date in YYYY-MM-DD format or leave as is\n- `NEXT_PUBLIC_SANITY_ACCESS_TOKEN` Visit [Sanity Manage][sanity-manage] to create an access token.\n- `NEXT_PUBLIC_SANITY_HOOK_SECRET` Visit [Sanity Manage \u003e API][sanity-manage] to create hook secret.\n\n- Now run `npm run dev`\n  Visit [http://localhost:3000][3000] to see your site \u003cbr /\u003e\n  Visit [http://localhost:3000/studio][3000-studio] to edit content\n\n\u003c!-- LINK VARIABLES --\u003e\n\n[article-link]: https://victoreke.com/blog/sanity-webhooks-and-on-demand-revalidation-in-nextjs\n[live-demo]: https://sanity-nextjs-revalidate.vercel.app\n[sanity-manage]: https://sanity.io/manage\n[3000]: http://localhost:3000\n[3000-studio]: http://localhost:3000/studio\n[preview]: https://github.com/Evavic44/sanity-nextjs-revalidation/assets/62628408/4108cfc2-e483-4f28-840e-bc094ac63f4c\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevavic44%2Fsanity-nextjs-revalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevavic44%2Fsanity-nextjs-revalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevavic44%2Fsanity-nextjs-revalidation/lists"}