Migrate from Clerk
Step-by-step guide to migrating your application from Clerk to Wocha
Wocha provides equivalent features to Clerk with additional enterprise capabilities like SpiceDB permissions, custom actions, and self-hosting.
Concept mapping
| Clerk | Wocha |
|---|---|
ClerkProvider | GreetSessionProvider (Next.js) / WochaProvider (React) |
clerkMiddleware() | withWochaAuth() |
auth() | getSession() / requireSession() |
currentUser() | getUser() |
<SignIn /> | <SignIn /> (@wocha/ui or headless) |
<UserButton /> | <UserButton /> (@wocha/ui) |
useUser() | useUser() |
useOrganization() | useOrg() |
| Organization | Organisation |
| Webhook | Webhook |
| Backend API | Customer API |
Step 1: Install Wocha
Step 2: Replace providers
Step 3: Replace middleware
Step 4: Replace server helpers
Step 5: Replace hooks
Step 6: Migrate users
CLI migration (recommended)
Always preview the migration first:
The --dry-run flag parses and validates Clerk users without creating anything in Wocha. It reports user counts, duplicate emails, and missing fields, and writes a JSON migration plan to wocha-migrate-plan-clerk-*.json.
After import, verify the migration:
Validation checks that all Clerk users exist in Wocha (matched by email) and reports any discrepancies.
Manual import via SDK
Step 7: Update environment variables
| Clerk | Wocha |
|---|---|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | WOCHA_CLIENT_ID |
CLERK_SECRET_KEY | WOCHA_CLIENT_SECRET |
| — | WOCHA_ISSUER |