SvelteKit SDK
SvelteKit adapter with server-side OAuth and encrypted cookie sessions.
@wocha/sveltekit is the SvelteKit adapter for Wocha authentication using the BFF pattern. OAuth runs on server routes; sessions are stored in encrypted httpOnly cookies.
Installation
pnpm add @wocha/sveltekitOr scaffold with the CLI
npx @wocha/cli init --framework sveltekitPeer dependencies: @sveltejs/kit ^2.0, Svelte 4 or 5.
Environment variables
Auth route handler
Create src/routes/auth/[...wocha]/+server.ts:
Route protection
Add to src/hooks.server.ts: