Client SDK

An isomorphic SDK to connect to any Trellis server instance or local runtime.

Client

The trellis/client package provides an SDK for interacting with your Agentic State Engine from an external process or across a network. It is fully isomorphic, working seamlessly in Node.js, Bun, and browser environments.

TrellisClient

The main class used to connect to a workspace and execute transactions or queries.

import { TrellisClient } from "trellis/client";

const client = new TrellisClient({
  url: "ws://localhost:3000",
  apiKey: "your-api-key",
});

// Connect mapping
await client.connect();

// Run a one-off query
const issues = await client.query('find issue.status="open"');

// Subscribe to a live query
const unsub = client.subscribe('find issue.status="open"', (results) => {
  console.log("Issues updated:", results);
});

config

Config types and constants shared between the server and the client to dictate limits, feature flags, and defaults.