fjrg2007/enigma/clerk-react-patterns
Claude Code and agent skill by fjrg2007/enigma
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
'React SPA auth patterns with @clerk/react for Vite/CRA - ClerkProvider
Install
npx vskill@latest install fjrg2007/enigma/clerk-react-patternsSKILL.md
The same SKILL.md was published earlier as midudev/autoskills/clerk-react-patterns.
React SPA Patterns
This skill covers@clerk/reactfor Vite/CRA SPAs. For Next.js useclerk-nextjs-patterns. For TanStack Start useclerk-tanstack-patterns.
What Do You Need?
| Task | Reference | |
|---|---|---|
| useAuth / useUser / useClerk hooks | references/hooks.md | |
| Protected routes with React Router | references/protected-routes.md | |
| Custom sign-in / sign-up forms | references/custom-flows.md | |
| React Router v6/v7 integration | references/router-integration.md |
References
| Reference | Description | |
|---|---|---|
references/hooks.md | useAuth, isLoaded guard | |
references/protected-routes.md | ProtectedRoute pattern | |
references/custom-flows.md | useSignIn, useSignUp flows | |
references/router-integration.md | React Router v6/v7 setup |
Setup
.env:
src/main.tsx:
Mental Model
@clerk/react is client-only — there is no server-side auth(). All auth state comes from hooks.
isLoadedmust betruebefore trustingisSignedIn— always guard onisLoadeduseClerk()gives access tosignOut,openSignIn,openUserProfileand other methodsgetToken()fromuseAuth()fetches the session JWT for API calls
Minimal Pattern
Protected Route (React Router v6/v7)
Token for API Calls
Common Pitfalls
| Symptom | Cause | Fix | |
|---|---|---|---|
isSignedIn is undefined | isLoaded is still false | Always check isLoaded first | |
ClerkProvider missing | Provider not at root | Wrap <App> in main.tsx | |
| Env var undefined | Wrong Vite prefix | Use VITE_CLERK_PUBLISHABLE_KEY, access via import.meta.env | |
Token is null | User not signed in | Null-check getToken() result | |
| Sign-in component shows blank | No publishableKey on provider | Pass publishableKey explicitly |
See Also
clerk-setup- Initial Clerk installclerk-custom-ui- Custom flows & appearanceclerk-orgs- B2B organizations
Docs
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingassets/skills-registry/clerk-react-patterns/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/fjrg2007/enigma/clerk-react-patterns)