Nuxt SDK
Nuxt 3 module with server-side OAuth and encrypted cookie sessions.
@wocha/nuxt is the Nuxt 3 module for Wocha authentication using the BFF (backend-for-frontend) pattern. OAuth runs on Nitro server routes; sessions are stored in encrypted httpOnly cookies.
Installation
pnpm add @wocha/nuxtOr scaffold with the CLI
npx @wocha/cli init --framework vuePeer dependency: Nuxt >=3.10.
Setup
Environment variables:
Server routes
The module auto-registers:
| Route | Purpose |
|---|---|
/api/auth/login | Start OAuth login |
/api/auth/callback | OAuth callback |
/api/auth/logout | End session |
/api/auth/session | Public session JSON |
/api/auth/switch-org | Switch organisation |
Route protection
Composables (auto-imported)
Permission checks
Learn more
- Nuxt SDK README
- Next.js SDK — similar BFF pattern for App Router