Skip to main content

Installation

The @stwd/sdk package provides a typed client for the Steward API with zero dependencies.

Install

npm install @stwd/sdk

Requirements

  • Runtime: Node.js 18+, Bun 1.0+, Deno, or any environment with fetch()
  • TypeScript: 5.0+ (optional but recommended)
  • Dependencies: None — zero external dependencies

Quick Setup

import { StewardClient } from "@stwd/sdk";

// Tenant-level client (for management operations)
const steward = new StewardClient({
  baseUrl: "https://api.steward.fi",
  apiKey: "stwd_your_tenant_api_key",
});

// Agent-level client (for signing operations)
const agentClient = new StewardClient({
  baseUrl: "https://api.steward.fi",
  bearerToken: process.env.STEWARD_AGENT_TOKEN,
});

Package Contents

The SDK exports:
ExportDescription
StewardClientMain API client class
StewardApiErrorTyped error class with status code and response data
TypesFull TypeScript types for all request/response shapes
import {
  StewardClient,
  StewardApiError,
  type StewardClientConfig,
  type SignTransactionInput,
  type SignTypedDataInput,
  type SignSolanaTransactionInput,
  type PolicyRule,
  type AgentIdentity,
} from "@stwd/sdk";

Environment Variables

Common environment variables used with the SDK:
STEWARD_API_URL=https://api.steward.fi    # API base URL
STEWARD_API_KEY=stwd_your_tenant_key       # Tenant API key
STEWARD_AGENT_TOKEN=stwd_jwt_...           # Agent JWT token
STEWARD_AGENT_ID=my-agent                  # Agent identifier
STEWARD_PROXY_URL=http://steward-proxy:8080 # Proxy URL (for containers)

Published Packages

PackageVersionDescription
@stwd/sdk0.3.0TypeScript SDK client
@stwd/eliza-plugin0.2.0ElizaOS integration plugin

Next Steps