@relayfile/sdk
v0.5.3
Published
TypeScript SDK for relayfile — real-time filesystem for humans and agents
Readme
@relayfile/sdk
TypeScript SDK for relayfile — real-time filesystem for humans and agents.
Install
npm install @relayfile/sdkQuick Example
import { RelayFileClient } from "@relayfile/sdk";
const client = new RelayFileClient({
baseUrl: "https://api.relayfile.com",
token: process.env.RELAYFILE_TOKEN ?? ""
});
const workspaceId = "workspace_123";
const tree = await client.listTree(workspaceId, {
path: "/",
depth: 2
});
console.log(tree.entries.map((entry) => entry.path));
const file = await client.readFile(workspaceId, "/notes/todo.md");
console.log(file.content);
await client.writeFile({
workspaceId,
path: "/notes/todo.md",
baseRevision: file.revision,
content: `${file.content}\n- Follow up with SDK publish`,
contentType: "text/markdown"
});Use a relayfile JWT whose claims include workspace_id, agent_name, and aud: ["relayfile"]. The SDK adds X-Correlation-Id automatically for API calls.
Full Docs
Full documentation is available in the relayfile docs.
