nano-kit-platform-web

Installation
SKILL.md

@nano_kit/platform-web

@nano_kit/platform-web wraps browser APIs in @nano_kit/store signals: storage-backed settings, media queries, window and document state, permissions, geolocation, cookies, cross-tab messages, locale and user agent. Signals, stores and DI are described in the nano-kit-store skill.

Reference

DOCS.md next to this file is the documentation of the released package as published on https://nano-kit.js.org, generated from the site sources. Read it for the helpers, their overloads and examples before writing code. This skill adds only conventions, choices and pitfalls.

Which helper for which job

  • User settings that must survive a reload: localStored; per-tab drafts: sessionStored. The synced variants follow changes made in other documents; use them when two tabs must agree.
  • Responsive and environment decisions: mediaQuery and the window and document singletons, derived with computed, instead of ad-hoc window reads in components.
  • Session and preferences shared with the server: cookieStored on the CookieStore$ token, never document.cookie.
  • Transient cross-tab events (logout, refresh): broadcasted, which carries structured clones, so plain objects need no codec.
  • Locale negotiation: browserLocale on the Locales$ token; UserAgent$ for the user agent. Both resolve to navigator in the browser.
  • Storage and cookie values are strings unless a codec is given; use JsonCodec or BooleanCodec for anything else, and the rate limiter overloads for chatty writers.

Universal code

Installs
2
GitHub Stars
44
First Seen
Oct 13, 2026