Getting started
Get a working login flow in about 2 minutes with the Wocha CLI.
Time to first auth: ~2 minutes. Run one command, start your dev server, and click Sign in — no Console setup, no redirect URI configuration, and no hand-edited layout files.
Quick start (recommended)
The fastest path is the Wocha CLI. It detects your framework, provisions a free development tenant, installs the SDK, and scaffolds auth files for you.
npx @wocha/cli init -yPass --framework to skip prompts — for example nextjs, react-spa, vue, or sveltekit.
Example output
The CLI registers common localhost redirect URIs automatically, so OAuth callbacks work on ports 3000, 3001, 4000, and 5173 without manual configuration.
What you get
- Sign in / Sign up links in your app header (visible on first load)
- Public-by-default routes — only paths you opt into (e.g.
/dashboard/*) require authentication - Encrypted session cookies via the BFF route handler
- Claim later — run
wocha claimto keep your development tenant permanently
Test the login flow
- Start your dev server (
pnpm dev). - Open the app — you should see Sign in in the header.
- Complete login on the hosted auth UI.
- Confirm you return with an active session and your email shown in the header.
Troubleshooting:
redirect_uri_mismatch— if you use a non-standard port, runwocha doctoror check.env.localforWOCHA_REDIRECT_URI.invalid_client— re-runwocha initorwocha cloud-devto refresh credentials.- Session not persisting — ensure
WOCHA_COOKIE_SECRETis set in production.
Next steps
- Next.js quickstart — framework-specific details
- API reference — explore the Customer API interactively
- Webhooks overview — receive lifecycle events
- TypeScript SDK — manage users and organisations server-side
Alternative: Manual setup via the Console
Use this path if you prefer to configure credentials yourself or are integrating an existing Wocha project.
1. Create your account
Go to wocha.ai/signup and register with email/password or a social provider (Google, GitHub, Microsoft). Email verification is required before you can create a project.
2. Create a project
After sign-in you land in the Wocha Console project wizard:
| Field | Notes |
|---|---|
| Project name | Display name (3–100 chars) |
| Slug | Becomes {slug}.auth.wocha.ai |
| Region | EU (default), US, or APAC |
| Plan | Free tier is fine for development |
Provisioning takes ~5 seconds. Your project gets an isolated tenant schema, default OAuth application, and management API key.
3. Collect credentials
From the Console dashboard or project settings, copy:
| Credential | Where to find it | Used for |
|---|---|---|
| Tenant slug / ID | Project overview | Issuer URL, API calls |
| Management API key | Shown once at creation | @wocha/sdk (server-side admin) |
| Client ID & secret | Applications → Quickstart app | OAuth in your app |
| Issuer URL | https://{slug}.auth.wocha.ai | SDK config |
Register a redirect URI for your app before testing:
- Next.js:
http://localhost:3000/api/auth/callback - React SPA:
http://localhost:5173/callback
4. Install the SDK
pnpm add @wocha/nextjsOr choose the package for your stack:
| Stack | Package |
|---|---|
| Next.js App Router | @wocha/nextjs |
| React SPA (Vite, CRA) | @wocha/react |
| Server / scripts | @wocha/sdk |
5. Configure environment variables
6. Wire up auth
See the framework quickstart that matches your stack: