What problem does it solve?
This Skill stops unauthorized access to Fastify API routes by validating JWT bearer tokens and ensuring only properly scoped requests reach the business logic.
Core Features & Use Cases
- JWT validation middleware: register @auth0/auth0-fastify-api to decode tokens, attach user claims, and block invalid requests before route handlers run.
- Scope and permission checks: call fastify.requireAuth with specific scopes or permission lists to enforce API-level authorization per endpoint.
- Use Case: Protect a RESTful Fastify backend serving mobile and SPA clients by requiring access tokens with the correct audience so that only authorized users can hit protected routes.
Quick Start
Register the @auth0/auth0-fastify-api plugin with your Fastify server, set AUTH0_DOMAIN and AUTH0_AUDIENCE from your Auth0 API, and protect routes using fastify.requireAuth().