Auth0/auth0-fastify — Agent Skills | officialskills.sh
Back to skills

auth0-fastify

communitysecurity

Adds session-based authentication to Fastify web applications using the @auth0/auth0-fastify SDK.

Setup & Installation

npx skills add https://github.com/auth0/agent-skills --skill auth0-fastify
or paste the link and ask your coding assistant to install it
https://github.com/auth0/agent-skills/tree/main/plugins/auth0-sdks/skills/auth0-fastify
View on GitHub

What This Skill Does

Adds session-based authentication to Fastify web applications using the @auth0/auth0-fastify SDK. It registers login, logout, and callback routes automatically, and provides helpers to check sessions, get user profiles, and retrieve access tokens. For stateless API-only setups, there's a separate auth0-fastify-api skill.

It handles the full OAuth redirect flow, session management, and token refresh in a single Fastify plugin registration, so you don't have to wire up callback routes and cookie encryption yourself.

When to use it

  • Adding login and logout to a Fastify web app without writing OAuth flows by hand
  • Protecting specific routes so only authenticated users can access them
  • Retrieving the logged-in user's profile to display on a dashboard
  • Getting an access token from the session to call a downstream API
  • Setting up callback handling for Auth0's hosted login page in Fastify