clerk-auth

Implements Clerk authentication with proxy middleware for React, Express, and Expo applications.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/AmirEmad11/instabot --skill clerk-auth-amiremad11
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clerk-auth
Source: https://github.com/AmirEmad11/instabot/tree/main/.local/skills/clerk-auth
Command: npx skills add https://github.com/AmirEmad11/instabot --skill clerk-auth-amiremad11

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 requires coordinating server middleware, client providers, routing, and branded sign-in pages. This Skill automates the full Clerk integration, including key provisioning, proxy setup, and migration from Replit Auth. ## Core Features & Use Cases - Automated Clerk Provisioning: Calls setupClerkWhitelabelAuth() to provision a Clerk app and auto-set all required environment variables. - Full-Stack Setup: Configures Express proxy middleware, @clerk/express server auth, @clerk/react client routing with Wouter, and optional Expo mobile integration with custom auth screens. - Branded Auth Pages: Generates customized sign-in/sign-up pages with logos, appearance objects, and localization matching the site's theme. - Replit Auth Migration: Provides step-by-step references for migrating web and Expo apps from Replit Auth to Clerk, including user identity mapping via sessionClaims.userId. - Use Case: A user asks to add login and signup to their app. The Skill provisions Clerk keys, wires the proxy middleware, sets up protected API routes, and builds themed sign-in pages automatically. ## Quick Start Ask the agent to add user authentication with login and signup pages to your app using the clerk-auth skill.

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 clerkProxyMiddleware template into your API server, mount it before body parsers, then add clerkMiddleware() and install @clerk/react on the client. Set up ClerkProvider with Wouter routing and dedicated /sign-in and /sign-up routes.

How do I migrate from Replit Auth to Clerk?

Follow the migration references: remove auth routes, session library, and auth middleware from the server, then replace useAuth from @workspace/replit-auth-web with useUser and useAuth from @clerk/react. The requireAuth middleware must read sessionClaims.userId to match migrated users' original IDs.

Does Clerk work with Expo and Expo Go?

Yes, via @clerk/expo with tokenCache backed by expo-secure-store, but native Clerk components are incompatible with Expo Go. You must build custom authentication screens using the Clerk Core v3 SDK hooks like useSignIn, useSignUp, and useSSO.

Why am I getting 401 Unauthorized errors in my web app?

In web apps, browsers send session cookies automatically, so setAuthTokenGetter is never the fix. Verify clerkMiddleware() is mounted before API routes and that requireAuth correctly checks getAuth(req); add temporary logging inside requireAuth to debug.

Where do I manage users and OAuth providers for Clerk?

Use the Auth pane in the workspace toolbar, never clerk.com or an external dashboard. It lets you view and ban users, enable or disable login providers like Google and GitHub, edit app branding, and configure custom OAuth credentials.

What are the limitations of the Clerk proxy setup?

The server-side proxy only runs in production and is inactive in development, so no proxy env vars are needed locally. The proxy path is hardcoded to /__clerk, and the setup does not work with Clerk's hosted pages, requiring dedicated in-app sign-in routes.