Installation & Setup
Install the Mistscale Web SDK and create your first client.
Setup is two steps: install the package, and create a client with your project's API key. There is no build step or config asset — the client is a single import.
1. Install the package
The SDK ships as @mistscale/web-sdk on the npm registry. It has no runtime dependencies beyond the browser's own fetch and WebSocket APIs.
npm install @mistscale/web-sdkWorks the same with pnpm or yarn (pnpm add @mistscale/web-sdk / yarn add @mistscale/web-sdk). Ships as ESM and CJS with bundled TypeScript types, so it works unmodified with Vite, Next.js, webpack, or a plain script bundler.
2. Create the client
import { MistScale } from "@mistscale/web-sdk";
const mistscale = new MistScale({
apiKey: "ms_your_key_here", // Project Settings → API Keys
});That's the whole setup. No network call happens until you use the client — construction only validates that the key looks like a Mistscale key (starts with ms_), so a bad key fails immediately and locally rather than on your first request.
3. Get an API key
- 1
Open your project in the Mistscale dashboard.
- 2
Go to Project Settings → API Keys.
- 3
Create a key. It's shown once — copy it immediately.
- 4
Pass it as apiKey when constructing MistScale, as shown above.
Client configuration
apiKeycontrolPlaneUrlnpcServiceUrlplayerIdrequestTimeoutMs