Module
@riducms/sveltekit
@riducms/sveltekit — SvelteKit integration: direct browser requests to Ridu, server rendering, and one session owner.
Functions 3
defineRidu()Bind an application's generated client to SvelteKit.
createRiduHandle()A SvelteKit `handle` that sets `event.locals.ridu` for each request. Compose it with other hooks through `sequence`.
createServerClient()Create the Ridu client for one SvelteKit request. It authenticates with the request's frontend cookie, verifies `auth.getSession()` at most once, and writes the cookie on the response after a server-side login, logout, or rejected token.
Interfaces 4
interface ServerClientOptionsPublic interface ServerClientOptions from @riducms/sveltekit.
interface ProvideOptionsPublic interface ProvideOptions from @riducms/sveltekit.
interface RiduOne application's Ridu binding. It holds configuration, never an authenticated client.
interface RiduDefinitionOptionsPublic interface RiduDefinitionOptions from @riducms/sveltekit.
Types 5
type RiduHandleA server `handle` hook. SvelteKit 2 exports `Handle` from `@sveltejs/kit` and SvelteKit 3 from `@sveltejs/kit/hooks`; this shape is assignable to both.
type ClientFactoryThe generated `createClient` from `ridu.generated.ts`. Its auth parameter is generic, so `any` is the only parameter type every generated signature accepts.
type ConfigOfThe application contract bound by a generated factory.
type InferClientThe client type of a `defineRidu` result, for `App.Locals`.
type InferSessionThe session type of a `defineRidu` result.
Constants 2
constant AUTH_DEPENDENCYThe dependency every auth-sensitive load should declare with `depends(AUTH_DEPENDENCY)`.
constant DEFAULT_COOKIE_NAMEFrontend-domain cookie that holds a Ridu session token.