auth-package
CommunitySecure React and Fastify routes with Auth0.
Authormattbutlerengineering
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This skill solves the complexity of adding OIDC-based authentication to a React frontend and protecting Fastify API routes using a consistent, portable @mbe/auth layer.
Core Features & Use Cases
- React AuthProvider + hooks: Initialize authentication state with
AuthProviderand manage sign-in, sign-out, and session-aware UI usinguseAuth,useAccessToken, anduseRequireAuth. - Fastify JWT protection: Register
authPluginto validate bearer JWTs and populaterequest.user, or applyrequireAuthper-route for fine-grained access control. - Environment-driven configuration for Auth0: Configure authority, clientId, redirectUri, and audience via Vite and Node environment variables, aligned to an Auth0 OIDC setup.
- Testing patterns (unit + E2E): Mock
useAuthin Vitest for deterministic component testing and use Playwright with programmatic Auth0 login fixtures for authenticated E2E flows.
Quick Start
Use this skill to add authentication by wrapping your React app with AuthProvider, then protect Fastify routes by registering authPlugin and adding requireAuth where needed.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: auth-package Download link: https://github.com/mattbutlerengineering/mattbutlerengineering/archive/main.zip#auth-package Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.