nuxt-revalidate
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Nuxt Revalidate

npm version npm downloads License Nuxt

🧹 Nuxt revalidate module

Quick Setup

  1. Add nuxt-revalidate dependency to your project
# Using pnpm
pnpm add -D nuxt-revalidate

# Using yarn
yarn add --dev nuxt-revalidate

# Using npm
npm install --save-dev nuxt-revalidate
  1. Add nuxt-revalidate to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-revalidate'
  ]
})
  1. Protect /__revalidate__ endpoint using secret key in .env or nuxt.config.ts
REVALIDATE_KEY=YOUR_SECRET_KEY
export default defineNuxtConfig({
  revalidate: {
    key: 'YOUR_SECRET_KEY'
  }
});

That's it! You can now call /__revalidate__?path=ROUTE_TO_REVALIDATE&key=YOUR_SECRET_KEY and clear cached route.

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

Readme

Keywords

Package Sidebar

Install

npm i nuxt-revalidate

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

6.87 kB

Total Files

12

Last publish

Collaborators

  • mateuszkulpa