@natu/storyblok-revalidate
Allows pages update without the need to rebuild the entire project.
ℹ️
Used in the web app.
Usage
Import package in package.json
"dependencies": {
"@natu/storyblok-revalidate": "*",
}
Use revalidateHandler
in api route
apps/web/src/app/api/revalidate/route.ts
import { revalidateHandler } from '@natu/storyblok-revalidate';
export { revalidateHandler as POST };
Setup revalidate webhook in Storyblok CMS
As the endpoint URL, pass:
https://<your-domain>/api/revalidate?token=NEXT_PUBLIC_STORYBLOK_PREVIEW_TOKEN
You will find the token under the variable NEXT_PUBLIC_STORYBLOK_PREVIEW_TOKEN
in the file apps/web/.env
⚠️
Remember to check all the checkboxes in the Story
accordion