Replit Auth vs. Clerk Auth — With Replit Auth, users sign in with Replit accounts and see Replit-branded login pages. With Clerk Auth (this page), your app gets its own authentication tenant with fully customizable branding and user accounts independent of Replit. Choose Clerk Auth when you want your own brand on the login experience or need user accounts separate from Replit.
Replit Auth vs. Clerk Auth at a glance
| Replit Auth | Clerk Auth | |
|---|---|---|
| User accounts | Users sign in with a Replit account | Users create accounts within your app (no Replit account needed) |
| Branding | Replit-branded login page | Fully customizable — your app name, icon, and colors |
| SSO credentials | Uses Replit’s shared OAuth apps | Bring your own OAuth credentials per provider |
| Environments | Single environment | Separate Development and Production environments |
| Referrals | Sign-ups count toward Replit Referrals | No Replit referral integration |
| Best for | Quick setup, apps where Replit branding is acceptable | Custom-branded apps, professional/commercial products |
Getting started
To add Clerk Auth to your app, include it in your Agent prompt:How Clerk Auth works with Replit
When Agent sets up Clerk Auth for your app, it:- Creates a dedicated Clerk tenant — Your app gets its own Clerk application with separate Development and Production environments
- Provisions credentials — API keys and secrets are stored as environment variables
- Configures a proxy — Authentication works seamlessly on your published domain
- Sets up sign-in and sign-up routes — Pre-built Clerk React components are added to your app
- Adds server-side middleware — Your API routes are protected with Clerk’s Express middleware
Key features
Clerk Auth provides your app with:- Independent user accounts — Your app’s users are not Replit users; they exist only within your app’s Clerk tenant
- Configurable login page — Set your app name, icon, and choose which sign-in providers to show
- Custom-branded SSO — Supply your own OAuth credentials per provider so the sign-in flow displays your app’s name and branding instead of generic defaults
- Email and password authentication — Built-in sign-up and sign-in with email verification
- Social sign-in (SSO) — Let users sign in with Google, GitHub, Apple, or X (Twitter)
- User management — View, search, and moderate users from the Auth pane
- Session handling — Secure session tokens managed automatically
- Development and Production environments — Test authentication in development before going live
Managing users
The Auth pane in your Workspace gives you a complete view of your authenticated users. Because Clerk Auth creates a separate user store for your app, the users listed here are accounts in your app — not Replit accounts.
- View all users with details like email, name, last login, and account creation date
- Search and filter to find specific users
- Ban or unban users to control access to your app
- Sort users by different criteria
- Switch environments — Toggle between Development and Production to manage users in each
Configuring your login page
From the Configure tab in the Auth pane, you can control which sign-in providers appear on your login page and set your app’s name and icon.
- App name — Displayed on the login screen
- App icon — Your brand’s logo on the login screen
- Login methods — Enable or disable specific sign-in providers (Google, GitHub, Apple, X, Email)
- Environment — Switch between Development and Production settings
Custom SSO credentials
By default, SSO providers use shared credentials — your app’s sign-in flow works immediately but shows generic branding during the OAuth consent screen. To display your app’s name and branding when users sign in with a social provider, configure your own OAuth credentials for each provider.
Security best practices
- Always validate server-side — Check authentication in your API routes, not just in the UI
- Use environment variables — Never hardcode keys or secrets in your code
- Keep the proxy middleware first — The Clerk proxy must be mounted before body parsers in your Express app
- Don’t redirect the homepage to sign-in — Keep your landing page accessible to unauthenticated visitors
Additional resources
- Configure Google SSO — Set up custom Google OAuth credentials
- Configure GitHub SSO — Set up custom GitHub OAuth credentials
- Configure Apple SSO — Set up custom Apple Sign In credentials
- Configure X (Twitter) SSO — Set up custom X OAuth credentials