Documentation

sdk

TypeScript SDK

@fystash_ai/sdkRoomClient (HTTP) and FystashClient (in-guest fabric wire).

Requires Node ≥ 20. Production topology is topology=nested.

Install

npm install @fystash_ai/sdk
export FYSTASH_API=https://api.fystash.ai
export FYSTASH_API_KEY='key-…'

RoomClient hello

import { RoomClient } from "@fystash_ai/sdk";

const client = new RoomClient({
  baseUrl: process.env.FYSTASH_API!,
  apiKey: process.env.FYSTASH_API_KEY!,
  timeoutMs: 180_000,
});

const room = `room-hello-${Date.now()}`;
await client.health();
await client.createRoom(room);
await client.createFromTemplate(room, "a1", {
  guestCid: 9100,
  memoryMib: 256,
});
await client.destroy(room);

Wire client (in-guest)

import { FystashClient } from "@fystash_ai/sdk";

const client = FystashClient.tcp("127.0.0.1", 7000, {
  roomId: "room-1",
  agentId: "worker-a",
  subscriptions: ["events"],
});
await client.connect();
const reply = await client.request("worker-b", Buffer.from("hello"), {
  timeoutMs: 5_000,
});
await client.close();

Unix sockets default to daemon registration mode (identity owned by the guest daemon).