replit-auth

Integrates Replit Auth OIDC login into Express, React, and Expo monorepo apps.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openid-client, cookie-parser, expo-auth-session, expo-secure-store, expo-crypto, expo-web-browser, and includes references (resource) components.

What problem does it solve? Adding authentication to a pnpm monorepo with an Express API, React+Vite web app, and optional Expo mobile app requires wiring up OIDC flows, session storage, middleware, and client hooks by hand. This Skill provides ready-to-copy templates and step-by-step instructions to integrate Replit Auth (OpenID Connect with PKCE) across all three platforms. ## Core Features & Use Cases - Server Auth Stack: Copies Express routes, middleware, and session utilities implementing the full OIDC flow with PKCE, PostgreSQL-backed sessions, and token refresh. - Web and Mobile Clients: Provides a useAuth() React hook package for browser cookie-based auth and an Expo AuthProvider using expo-auth-session with secure token storage. - Database and API Spec Setup: Includes a Drizzle schema for users and sessions plus OpenAPI spec entries for all auth endpoints with codegen support. - Use Case: When a user asks to add login or user accounts to their Replit monorepo project, this Skill scaffolds the complete auth flow—web redirect login, mobile token exchange, session middleware, and logout—in minutes. ## Quick Start Ask the AI to add Replit Auth login and user accounts to your Express and React monorepo project.

Frequently Asked Questions about replit-auth

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

FAQPage Schema
How do I add Replit Auth login to an Express and React app?

Copy the provided auth routes, middleware, and lib templates into your Express server, mount authMiddleware before your router, and install the @workspace/replit-auth-web package in your React app. The useAuth hook then exposes login, logout, and user state.

How does mobile authentication work with Expo and Replit Auth?

The Expo app uses expo-auth-session to open the OIDC provider with PKCE, then sends the authorization code to POST /api/mobile-auth/token-exchange. The server validates it with openid-client and returns a session token stored in expo-secure-store.

Does this work with openid-client v6?

Yes, the templates use the openid-client v6 functional API such as client.discovery() and authorizationCodeGrant(). Do not use v5 class-based patterns like new Issuer(), as they are incompatible.

Can I build a custom login form instead of Replit Auth?

No, this Skill does not support custom login or signup forms. Authentication is handled entirely by the Replit OIDC provider through redirects, and user-facing UI should use generic Log in and Log out labels.

Why does Metro bundler crash after adding openid-client?

Metro can crash watching openid-client's temp cache directory. Add a blockList entry for /.cache/openid-client/ in metro.config.js to exclude it from the file watcher.