Skip to content

Installation ​

This page covers all the ways to install and access SkyState tooling.


CLI ​

The SkyState CLI (sky) is the primary tool for pushing public state, managing projects, and authenticating from the terminal. See what public state is for.

The CLI requires Node.js 20.19 or later.

Global Install ​

bash
npm install -g skystate

Project-Local Install ​

If you prefer to pin the CLI version per project, install the same skystate package as a dev dependency.

Then run it via npx or through a package.json script:

bash
npx sky --version
json
{
  "scripts": {
    "push:dev": "sky state public push --project my-app --file config.json --env development"
  }
}

Updating ​

bash
npm update -g skystate

SDKs ​

SkyState ships two JavaScript/TypeScript SDK packages.

@skystate/core ​

A framework-agnostic client for Node.js, browser, and any JavaScript environment. Use this for non-React apps, server-side usage, or when you want to wrap the core client for another framework.

bash
npm install @skystate/core

Basic Usage ​

ts
import { createSkyStateClient } from '@skystate/core';

const client = createSkyStateClient({
  account: 'acc_example', // Replace acc_example with your account ID from `sky status`
  project: 'my-app',
  environment: 'production',
});

await client.init();

// Read a single key with a fallback default
const maintenance = client.publicState.get('maintenance', { enabled: false });

@skystate/react ​

React hooks and context provider built on top of @skystate/core.

bash
npm install @skystate/react

Environment Variables ​

In Node.js / Server Environments ​

For server-side API access, generate a project API key from the console and send it only from trusted backend code:

# .env
SKYSTATE_API_KEY=your-api-key-here

Server-side credentials should never be exposed to the browser bundle. Always use environment variables that are not prefixed with VITE_ or NEXT_PUBLIC_.


Next Steps ​