clerk-auth

Implements Clerk authentication with proxy support for web and Expo apps.

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/SaberAloui/agri-hub --skill clerk-auth-saberaloui
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clerk-auth
Source: https://github.com/SaberAloui/agri-hub/tree/main/.local/skills/clerk-auth
Command: npx skills add https://github.com/SaberAloui/agri-hub --skill clerk-auth-saberaloui

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @clerk/express, @clerk/react, @clerk/expo, http-proxy-middleware, and includes references (resource) components.

What problem does it solve? Setting up user authentication across web and mobile apps involves provisioning keys, wiring middleware, building branded sign-in pages, and handling platform differences. This Skill automates the entire Clerk integration so login, signup, and user accounts work out of the box. ## Core Features & Use Cases - Automated Clerk Provisioning: Calls setupClerkWhitelabelAuth() to provision a Clerk app and auto-set all required secrets, with a production proxy middleware for custom domains. - Web and Expo Setup: Provides complete patterns for React+Vite apps (ClerkProvider, Wouter routing, branded sign-in/sign-up pages) and Expo apps (custom auth screens using Clerk Core v3 SDK, token cache, OAuth flows). - Replit Auth Migration: Includes step-by-step references for migrating existing web and mobile apps from Replit Auth to Clerk, including user identity mapping via sessionClaims.userId. - Use Case: A user asks to add login to their app. The Skill provisions Clerk, installs dependencies, wires the Express middleware, and generates fully branded sign-in and sign-up pages matching the site's theme. ## Quick Start Ask the agent to add user authentication with login and signup to your app, and it will provision Clerk and wire up the full flow automatically.

Frequently Asked Questions about clerk-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Clerk authentication to a React and Express app?▼

Provision keys with setupClerkWhitelabelAuth(), copy the proxy middleware into the API server, mount clerkMiddleware() from @clerk/express, and wrap the React app in ClerkProvider from @clerk/react with dedicated /sign-in and /sign-up routes.

How do I build custom sign-in screens for Expo with Clerk?▼

Use the Clerk Core v3 SDK hooks from @clerk/expo: useSignIn() and useSignUp() for email/password flows, and useSSO() with startSSOFlow() for Google OAuth. Native Clerk components are incompatible with Expo Go, so custom screens are required.

How do I migrate from Replit Auth to Clerk?▼

Follow the migration references: remove the OIDC auth routes, session library, and @workspace/replit-auth-web package, then wire Clerk middleware and providers. The requireAuth middleware must read sessionClaims.userId so migrated users keep their original IDs.

Why do I get 401 Unauthorized errors in the web app preview?▼

Check that clerkMiddleware() is mounted in app.ts before API routes and that requireAuth correctly reads getAuth(req). Do not use setAuthTokenGetter on web — that function is only for Expo apps where cookie sessions are unavailable.

Does Clerk authentication work with Expo Go?▼

Yes, but only with custom authentication screens built on the Clerk Core v3 SDK. Clerk's native UI components are incompatible with Expo Go, and expo-* packages must be version-pinned to match the project's Expo SDK.

Where do I manage users and OAuth providers after setup?▼

Use the Auth pane in the workspace toolbar to view and ban users, enable or disable login providers like Google and GitHub, change login screen branding, and configure custom OAuth credentials. There is no external Clerk dashboard.