Installation
This page covers all the ways to install and access SkyState tooling.
CLI
The SkyState CLI (@skystate/cli) is the primary tool for pushing configs, managing projects, and authenticating from the terminal.
Requirements
- Node.js 18 or later
- npm 8 or later (or any compatible package manager)
Global Install
npm install -g @skystate/cliVerify:
skystate --versionProject-Local Install
If you prefer to pin the CLI version per project, install it as a dev dependency:
npm install --save-dev @skystate/cliThen run it via npx or through a package.json script:
npx skystate --version{
"scripts": {
"push:dev": "skystate push config.json --env development"
}
}Updating
npm update -g @skystate/cliSDKs
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 build your own integration layer.
npm install @skystate/coreBasic Usage
import { createSkyStateClient } from '@skystate/core';
const client = createSkyStateClient({
projectSlug: 'my-app',
environment: 'production',
});
// Fetch a single key with a fallback default
const maintenanceEnabled = await client.get<boolean>(
'maintenance.enabled',
false,
);
// Fetch the full config object
const config = await client.getAll();TypeScript Support
@skystate/core ships full TypeScript type definitions. No @types/ package is required.
@skystate/react
React hooks and context provider built on top of @skystate/core. Designed for React 18+.
npm install @skystate/reactSetup
Wrap your root component with SkyStateProvider:
// main.tsx
import React from 'react';
import ReactDOM from 'react-dom/client';
import { SkyStateProvider } from '@skystate/react';
import App from './App';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<SkyStateProvider
projectSlug="my-app"
environment={import.meta.env.PROD ? 'production' : 'development'}
devKey={import.meta.env.VITE_SKYSTATE_DEV_KEY}
>
<App />
</SkyStateProvider>
</React.StrictMode>
);Hooks
import { useProjectConfig } from '@skystate/react';
function AnnouncementBanner() {
const { data: enabled, isLoading } = useProjectConfig<boolean>(
'banner.enabled',
false,
);
const { data: text } = useProjectConfig<string>(
'banner.text',
'',
);
if (isLoading || !enabled) return null;
return <div className="banner">{text}</div>;
}The useProjectConfig hook returns:
| Property | Type | Description |
|---|---|---|
data | T | The resolved value. defaultValue until the fetch completes. |
isLoading | boolean | true while the initial fetch is in flight. |
error | Error | null | Populated if the fetch fails. data stays on defaultValue. |
Environment Variables
In Vite Apps
Vite exposes variables prefixed with VITE_ to the client bundle. To pass your dev key to the SDK:
# .env
VITE_SKYSTATE_DEV_KEY=sk_dev_abc123...const devKey = import.meta.env.VITE_SKYSTATE_DEV_KEY;In Next.js Apps
Next.js exposes variables prefixed with NEXT_PUBLIC_ to the browser:
# .env.local
NEXT_PUBLIC_SKYSTATE_DEV_KEY=sk_dev_abc123...const devKey = process.env.NEXT_PUBLIC_SKYSTATE_DEV_KEY;In Node.js / Server Environments
For server-side usage (e.g. reading config in a Next.js API route or an Express server), use the full JWT token from the CLI credentials, or generate a project API key from the dashboard:
# .env
SKYSTATE_API_KEY=your-api-key-hereServer-side credentials should never be exposed to the browser bundle. Always use environment variables that are not prefixed with
VITE_orNEXT_PUBLIC_.
Dashboard
The SkyState dashboard is a web application — no installation required.
Access it at: https://app.skystate.io
Sign in with your GitHub account. The dashboard provides:
- A project overview showing all your projects and their environments.
- A Remote Config editor with syntax highlighting and diff view.
- Version history with the ability to view and restore any past version.
- Usage page showing your API request counts and billing status.
- Settings for managing dev API keys, account details, and subscription.
Browser Requirements
The dashboard works in any modern browser. Chrome, Firefox, Safari, and Edge are all supported. JavaScript must be enabled.
CI/CD Integration
To use the CLI in CI pipelines, provide credentials via environment variables instead of running skystate login interactively.
Using a Token
Set SKYSTATE_TOKEN to your JWT from ~/.config/skystate/credentials.json:
# GitHub Actions example
- name: Push config
env:
SKYSTATE_TOKEN: ${{ secrets.SKYSTATE_TOKEN }}
run: |
npm install -g @skystate/cli
skystate push config.json --env staging --yesThe CLI reads SKYSTATE_TOKEN automatically — no skystate login step is needed.
Project Slug Override
If your pipeline does not have a skystate.json in the working directory, provide the project slug via environment variable:
SKYSTATE_PROJECT=my-app skystate push config.json --env productionNon-Interactive Mode
Pass --yes to skip confirmation prompts in scripts:
skystate push config.json --env production --yesUninstalling
Remove the CLI
npm uninstall -g @skystate/cliRemove Stored Credentials and Config
rm -rf ~/.config/skystateThis removes your stored token and CLI config. You will need to run skystate login again after reinstalling.