Vue quickstart
Add Wocha authentication to a Vue 3 SPA with PKCE.
Add Wocha sign-in to a Vue 3 single-page application using @wocha/vue with the OAuth PKCE public client flow.
Prerequisites
- Node.js 18+
- Vue 3.4+ (Vite recommended)
- A Wocha project with a public OAuth application
- Redirect URI registered:
http://localhost:5173/callback
What you'll build
A Vue 3 app with plugin-based auth, router guards, and PKCE sign-in.
your-app.local
Welcome back
After sign-in
✓ Session stored securely
✓ User profile available in your app
✓ Organisation context ready for multi-tenant features
Installation
pnpm add @wocha/vue vue-routerOr scaffold with the CLI
npx @wocha/cli init --framework vueEnvironment variables
Plugin setup
Install the Wocha plugin in src/main.ts:
OAuth callback route
Create src/views/CallbackView.vue:
Sign in from a component
Next steps
- SDK reference — hooks, server helpers, and configuration options
- Webhooks overview — receive user and session lifecycle events
- Common patterns — protect routes, org switching, and role-based UI