Before running your application with Clerk authentication, you need to:
-
Create a Clerk Account
- Go to https://clerk.com
- Sign up for a free account
- Create a new application
-
Get Your Clerk Keys
- In your Clerk dashboard, navigate to API Keys
- Copy your Publishable Key (starts with
pk_test_orpk_live_)
-
Configure Environment Variables
- Copy
.env.exampleto.env(if not already done) - Add your Clerk Publishable Key:
VITE_CLERK_PUBLISHABLE_KEY=pk_test_c2VsZWN0LWNpY2FkYS0zMC5jbGVyay5hY2NvdW50cy5kZXYk NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_c2VsZWN0LWNpY2FkYS0zMC5jbGVyay5hY2NvdW50cy5kZXYk CLERK_SECRET_KEY=sk_test_dnsubBJdAx3A7jzCN0ZYmOOMkglKcINH9lA1cvdeeY
- Copy
-
Apply Database Migration
- Run the
add_clerk_auth.sqlscript in your Supabase database - This adds user profiles and multi-user support
- Run the
npm run dev✅ User sign-up and sign-in ✅ Protected routes (DataRoom, DocumentSharing) ✅ Public routes (Landing page, share links) ✅ User profile display ✅ Sign out functionality ✅ Document ownership tracking
- Recipients do NOT need accounts to view documents via share links
- Only the DataRoom and DocumentSharing pages require authentication
- Existing documents without a user_id remain accessible via share links