Skip to main content
Whatever serves your page (the cskn web worker, or a native shell’s offline copy of your bundle) writes a small object into window.cskn before your code runs. It tells your app which app it is, whose page it is on, and who is signed in.

Reading it

The host only ever adds to window.cskn, and a native shell attaches its bridge to the same object. Neither is guaranteed to arrive first, so never assign window.cskn = … in your own code; spread into it instead (see Local development).

Fields

boolean
true on a creator’s profile (<username>.cskn.my/<slug>), false on the app’s own host.
{ username: string } | null
The owner of the profile being viewed. Only set on a user page.
object
required
object | null
The user signed in to this browser: { sub, name, username, picture, email, email_verified }. null for a visitor, and inside a native shell, where identity comes over the bridge instead.
string
Where your routes are mounted: "" on the app’s own host, "/<slug>" on a user page. Read it through appBasename().
object | null
The theme the page owner selected, resolved before first paint. Consumed by useThemeSelection.
{ vapidPublicKey: string | null; serviceWorker: string }
What a browser needs to subscribe to Web Push. Consumed by Web Push.

Common patterns

Show the profile owner’s data on a user page, and the signed-in user’s data otherwise:
Gate the app on its status:

Local development

pnpm dev has no host to inject anything. Fill in a stand-in when nothing is there, and spread rather than assign so a bridge that a shell attached is kept:
main.tsx
Run with VITE_IS_USER_PAGE=true pnpm dev to preview the user page.