Server API

Start an authoritative Trellis instance and manage permissions.

The server module is functional but considered beta. APIs may change between minor versions.

The trellis/server package provides everything you need to run a standalone or embedded Trellis instance, bridging HTTP connections and WebSocket streams to the local graph.

Overview

The server module separates the hosting logic from the client bindings.

import { startServer } from "trellis/server";

startServer({
  port: 3000,
  path: "/var/lib/trellis",
});

Core Modules

startServer(config)

Starts the HTTP and WebSocket endpoints to serve the Trellis Agentic State Engine. Handles the transport layer for CRDT synchronization.

auth & permissions

Manage JWT signing, OAuth flows, and graph-level permission boundaries for authenticated connections.

tenancy

Provides multi-tenant graph partitioning logic for SaaS or federated deployments.

realtime

Internal WebSocket subscription manager that binds client EQL queries directly to causal ops in the internal sync engine.

deploy & import

Utilities for generating deployments and importing history from raw Git repositories into the Trellis graph.