clerk-astro-patterns
CommunitySecure Clerk auth patterns for Astro
AuthorRajAryanIITBHU
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides concise, ready-to-use patterns and guidance for integrating Clerk authentication into Astro projects, removing common configuration errors and ensuring routes, API endpoints, and client islands are properly protected.
Core Features & Use Cases
- Middleware setup with route matchers to protect dashboard, settings, and API routes and redirect unauthenticated users.
- Server-side rendering guidance using Astro.locals.auth for SSR pages and org-aware redirects.
- Island component patterns using client directives and useAuth/useUser hooks for React/Vue/Svelte islands.
- API route examples showing proper auth checks, permission handling, and usage of clerkClient in server contexts.
- Templates and examples that demonstrate required Astro config, environment variables, and deployment-ready adapter settings.
Quick Start
Use clerk-astro-patterns to add clerkMiddleware protecting /dashboard and /settings and configure Astro.locals.auth() to redirect unauthenticated users to /sign-in.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 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: clerk-astro-patterns Download link: https://github.com/RajAryanIITBHU/bny/archive/main.zip#clerk-astro-patterns 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.