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

Types 5

  • type RiduHandle

    A server `handle` hook. SvelteKit 2 exports `Handle` from `@sveltejs/kit` and SvelteKit 3 from `@sveltejs/kit/hooks`; this shape is assignable to both.

  • type ClientFactory

    The generated `createClient` from `ridu.generated.ts`. Its auth parameter is generic, so `any` is the only parameter type every generated signature accepts.

  • type ConfigOf

    The application contract bound by a generated factory.

  • type InferClient

    The client type of a `defineRidu` result, for `App.Locals`.

  • type InferSession

    The session type of a `defineRidu` result.

Constants 2

Methods 3