Repository navigation
🚀 Enhancements
- Add configurable storageKeyPrefix for storage keys (ced64e5)
⚠️ Resolve config in one place and support .config/nuxt-api-shield.ts (91c9c0a)
🩹 Fixes
- Create the GitHub release only after the tag is pushed (6ea53b8)
- Ignore trailing slashes in routes and skipRoutes (3a1bec3)
📖 Documentation
- Add agent skills configuration (a66a8f4)
- Restructure README around a quick start and an options reference (d064ab9)
- Add a step-by-step guide for upgrading from v1 to v2 (d2c0871)
🏡 Chore
- Publish releases with npm instead of yarn (48fa138)
- Add release script that picks the bump and checks npm access (18ea95a)
⚠️ Breaking Changes
⚠️ Resolve config in one place and support .config/nuxt-api-shield.ts (91c9c0a)
❤️ Contributors
- Rrd108 (@rrd108)
⚠️ Upgrade notes (v2)
Step-by-step migration: Upgrading from v1.
- Node 22.12 or later is required (or Node 24).
- New:
.config/nuxt-api-shield.ts— options can live in a dedicated config file (.config/nuxt-api-shield.tsornuxt-api-shield.config.ts), typed withdefineShieldConfigfromnuxt-api-shield/config. Precedence, highest first:runtimeConfig.nuxtApiShield, thenuxtApiShieldkey, the config file, the defaults. runtimeConfig.public.nuxtApiShieldis removed — deprecated in v1.1.0, it now fails the build. Move it toruntimeConfig.nuxtApiShield, thenuxtApiShieldkey or the config file.- Arrays are no longer concatenated across sources — if you set
routesorskipRoutesin bothruntimeConfig.nuxtApiShieldandnuxtApiShield, only theruntimeConfigone is used now. Objects still merge key by key. - Invalid wildcard routes fail the build — a
pattern: trueroute that breaks the pattern rules (e.g./**,/api*) used to be skipped silently at request time, leaving that route unprotected. The build now stops with an error naming the route. - Trailing slashes in
routesandskipRoutesare ignored — request paths are matched without a trailing slash, so a rule like'/api/v2/'or a skip route like'/api/health/'never matched anything and left those routes unprotected (or not skipped). They are now treated as'/api/v2'and'/api/health'. ModuleOptionsfields are all optional — and the resolved, fully-defaulted shape is exported asResolvedShieldConfig(whatuseRuntimeConfig().nuxtApiShieldholds).