Vite Plugin
The Kavach Vite plugin provides type generation and development convenience.
Installation
npm install @kavach/viteBasic Usage
import { defineConfig } from 'vite'
import { kavach } from '@kavach/vite'
export default defineConfig({
plugins: [kavach()]
})Options
import { defineConfig } from 'vite'
import { kavach } from '@kavach/vite'
export default defineConfig({
plugins: [
kavach({
adapter: 'supabase',
generateTypes: true,
outputPath: './src/lib/kavach.d.ts'
})
]
})Options Reference
| Option | Type | Description |
|---|---|---|
| adapter | string | Auth adapter name |
| generateTypes | boolean | Generate TypeScript types |
| outputPath | string | Output path for generated types |
| devMode | boolean | Enable dev-specific features |
Features
- Type Generation — Auto-generate TypeScript types from config
- Virtual Module — Provides
$kavach/authvirtual module - Demo Mode — Mock adapter for development without credentials