Skip to content

SDK Overview ​

SkyState ships JavaScript/TypeScript SDKs for public state, user state, and hosted end-user auth. See what public state is for.

PackageDescription
@skystate/coreFramework-agnostic client library. Use this for any JavaScript runtime - Node.js, Vanilla JS, or when building your own framework integration.
@skystate/reactReact bindings built on @skystate/core. Provides a context provider and hooks for public state, user state, and hosted auth.

Supported Platforms ​

Both packages run in modern browsers and Node.js.

  • Browser: Vite, webpack, Rollup, esbuild, or any bundler that supports ESM
  • Node.js: Uses the built-in fetch API
  • Framework support: The core package is framework-agnostic.

Contract ​

ContractDetail
Provider scopeOne mounted provider maps to one account, project, and environment. Remount to switch scope.
Keyed hook return shapesKeyed public hooks return { value }; keyed user hooks return { value, set, clear, syncStatus, draft }. See React SDK hooks.
HealthuseStatus().health reports overall loading/error status. See useStatus.
MetadataSDK accessors return application values and subsystem status only. Use the console, CLI, or REST API for inspection, audit, or history metadata. See Value-Only Metadata Contract.
Public reads are available before loginPublic state can render for signed-out visitors. See Public state, usePublicState, and client.publicState.get().
User state requires loginUser state loads and writes require an authenticated end-user session. Call useStatus().auth.loginWithRedirect() to start the login flow. See useUserState, User State, and Auth.
Public-state cache TTLPublic-state reads are cached longer in production than in development or staging. See Caching for the concrete TTLs.
Fixed environmentsEnvironments are fixed slugs. See Environments.
Account/project route identifiersSDK clients must use the current account route identifier and project identifier; route changes break URLs. See Accounts.

Installation ​

See Installation - SDKs for how to install either package.

Sections ​

@skystate/core ​

Framework-agnostic client. Covers createSkyStateClient, public state, and user state.

@skystate/react ​

React bindings. Covers the provider, hooks, and TypeScript patterns.