Skip to main content

TypeScript SDK

Zero-dependency client that works in Node.js 18+, Deno, and modern browsers. Uses native fetch - no axios, no node-fetch, no dependencies. SDKs are per-pack. This page covers the shared core every per-pack client is built on (@kitefrost/core, installed automatically as a dependency) - auth, transport, and the resources common to every pack. For pack-specific resources (characters, continuity, dialogue, encounters, sessions, …), see your pack’s own quickstart and API reference.

Installation

Install the Game Narrative SDK:
It pulls in @kitefrost/core, which handles auth and the shared resources. See the quickstart for a working example.
During the alpha the API is https://api-staging.kitefrost.ai. Set KITEFROST_BASE_URL=https://api-staging.kitefrost.ai in your environment, or pass baseUrl when creating the client.

Quick Start

All calls are asynchronous - every method returns a Promise.

Shared Core Resources

Available as client.core.<resource> on every per-pack client.

Health

Auth

Projects

API Keys

Billing

Events

Context

BYOK (Bring Your Own Key)

Webhooks

Error Handling

TypeScript’s error class names differ slightly from Python’s for the same statuses - KiteFrostApiError is the base (Python: KiteFrostError), KiteFrostAuthError covers 401/403 (Python: AuthError), KiteFrostNotFoundError covers 404 (Python: NotFoundError).
All errors carry statusCode, message, and feedbackId. There is no automatic retry beyond a one-shot re-auth on a 401. On RateLimited, back off yourself using .retryAfter (seconds, may be undefined):
See Telemetry & Privacy for what feedbackId is and how to use it.

Source

The core is at sdk/typescript/packages/core/ and per-pack clients at sdk/typescript/packages/<pack>/ in the main repository.