Internal DocumentationArchived DocumentationDo dev legacyArchiveClerk migration

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.dev

Key Files

  • components/app-providers.tsx - ClerkProvider configuration with allowed satellites
  • middleware.ts - Authentication middleware
  • app/sign-in/[[...sign-in]]/page.tsx - Sign-in page
  • app/sign-up/[[...sign-up]]/page.tsx - Sign-up page
  • hooks/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

  1. Add the satellite URL to allowedRedirectOrigins in app-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
  ]}
>
  1. Update environment variables:
CLERK_ALLOWED_REDIRECT_ORIGINS=...,http://localhost:XXXX

Testing

# 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 domains

Production Deployment

  1. Update environment variables in Vercel/deployment platform
  2. Ensure HTTPS is configured
  3. Update allowed redirect origins with production URLs
  4. Configure DNS if needed

On this page