Vue SDK
Vue 3 composables and headless components for Wocha SPA authentication.
@wocha/vue provides Vue 3 composables and headless components for Wocha authentication in single-page applications. It implements OAuth 2.0 authorisation code with PKCE as a public client.
Installation
pnpm add @wocha/vueOr scaffold with the CLI
npx @wocha/cli init --framework vuePeer dependency: Vue 3.4+.
Setup
Register your redirect URI in the Console before testing.
Authentication flow
- User clicks sign in →
signIn()redirects to the hosted login UI - After authentication, Hydra redirects to
/callback GreetPluginexchanges the code for tokens and stores the refresh token- Composables reactively update with the authenticated user
Composables
useSession()
useUser()
useOrg()
usePermission(check)
SpiceDB permission check against the Customer API (requires apiUrl):