Skip to main content
@kavachos/vue provides Vue 3 composables and an app plugin for building auth UIs. It works with Vite, Nuxt, and any Vue 3 setup.

Installation

Setup

Register the plugin in your Vue app:
main.ts

Nuxt setup

In Nuxt, create a plugin file:
plugins/kavach.client.ts

useSession

Returns the current session state. Reactive, updates when the user signs in or out.
components/NavBar.vue

useUser

Returns the current user object, or null if signed out.

useSignIn / useSignUp / useSignOut

pages/sign-in.vue
Sign up
Sign out

useAgents

Lists and manages agent identities for the current user.

Plugin configuration reference

string
default:"'/api/kavach'"
Base path where your KavachOS handler is mounted.
RequestInit
Options passed to every internal fetch call (e.g. custom headers).
Last modified on April 29, 2026