do.dev Authentication Configuration
Overview
The dodev app serves as the primary authentication domain for the entire do.dev ecosystem. All other applications authenticate through this domain using Clerk's satellite domain architecture.
Role
Primary Domain - Handles all authentication operations:
- User sign-in/sign-up
- OAuth provider integration
- Session management
- User profile management
- Cross-domain authentication
Configuration
Environment Variables
# Clerk Core
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxx
CLERK_SECRET_KEY=sk_test_xxx
# Primary Domain Settings
NEXT_PUBLIC_CLERK_IS_SATELLITE=false # or omit
NEXT_PUBLIC_CLERK_DOMAIN=localhost:3005 # or do.dev in production
# Auth Routes
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/dashboard
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/onboarding
# Allowed Satellites (Development)
CLERK_ALLOWED_REDIRECT_ORIGINS=http://localhost:3026,http://localhost:3011
# Allowed Satellites (Production)
# CLERK_ALLOWED_REDIRECT_ORIGINS=https://doc.dev,https://send.devKey Files
components/app-providers.tsx- ClerkProvider configuration with allowed satellitesmiddleware.ts- Authentication middlewareapp/sign-in/[[...sign-in]]/page.tsx- Sign-in pageapp/sign-up/[[...sign-up]]/page.tsx- Sign-up pagehooks/useClerkAuth.ts- Custom auth hook
Satellite Domains
This primary domain supports authentication for:
- doc.dev (Documentation builder)
- send.dev (Email service)
- All landing page applications
Adding New Satellite Domains
- Add the satellite URL to
allowedRedirectOriginsinapp-providers.tsx:
<ClerkProvider
allowedRedirectOrigins={[
'http://localhost:3026', // doc.dev
'http://localhost:3011', // send.dev
'http://localhost:3010', // local.dev development
'https://local.dev', // new satellite
]}
>- Update environment variables:
CLERK_ALLOWED_REDIRECT_ORIGINS=...,http://localhost:XXXXTesting
# Start primary domain
pnpm dev # Runs on http://localhost:3005
# Test authentication
# 1. Sign in at http://localhost:3005/sign-in
# 2. Visit satellite domain - should be authenticated
# 3. Sign out - should affect all domainsProduction Deployment
- Update environment variables in Vercel/deployment platform
- Ensure HTTPS is configured
- Update allowed redirect origins with production URLs
- Configure DNS if needed