Skip to content
File

Blob: src/client/server/viewer.ts

typescript12 lines
1// Browser-safe viewer shape used by the SSR shell. The Worker computes this
2// from the session cookie + D1 in `src/worker/auth/session.ts` and threads
3// it into `renderUiDocumentResponse`. SSR components must not reach for
4// session state directly — keep this presentational.
5export type Viewer = {
6 userId: string;
7 // Slug of the user's "home" namespace. Optional because a user can exist
8 // without a namespace if their `preferred_username` claim was invalid
9 // or already taken when they first signed in.
10 primaryNamespaceSlug?: string;
11};