ReferenceSdk
TypeScript SDK
@vendodev/sdk v1.4.0 — install, public surface, and reference links.
Package
| Package | @vendodev/sdk |
| Version | 1.4.0 |
| npm | npmjs.com/package/@vendodev/sdk |
| Source | github.com/runvendo/vendo-sdk-js |
| Changelog | CHANGELOG.md |
| Requires | Node 18+, Deno 1.40+ |
Install
npm install @vendodev/sdkPublic surface
Vendo class
import { Vendo } from "@vendodev/sdk";
const vendo = new Vendo({
apiKey?: string, // defaults to process.env.VENDO_API_KEY
baseUrl?: string, // defaults to process.env.VENDO_BASE_URL || "https://vendo.run"
apiVersion?: string, // defaults to "2026-05-02"
});
await vendo.token(slug: string): Promise<string>
await vendo.tokens(slugs: string[]): Promise<Record<string, string | null>>
vendo.invalidate(slug: string): void
vendo.forRequest(headers: Headers | Record<string, string>): Vendo // Vendo mode only
vendo.forUser(jwt: string): Vendo // Vendo mode only
vendo.connectUrl(slug: string, opts?: { returnTo?: string; state?: string }): string
// Sub-APIs (readonly instance properties)
vendo.connections // ConnectionsAPI
vendo.integrations // IntegrationsAPI
vendo.billing // BillingAPI (Vendo mode only)
vendo.events // EventsAPI (Vendo mode only)
vendo.webhooks // WebhooksAPI (both modes)
vendo.data // DataAPI — Composio proxy (Vendo mode only)The constructor throws AuthError if VENDO_API_KEY is not in env and
apiKey is not passed.
Reconciler subpath module
The reconciler is not a property on the Vendo class. Import it from
the dedicated subpath:
import * as reconciler from "@vendodev/sdk/reconciler";
// mapping is a callable; on_change defaults to no-op when omitted.
await reconciler.bootstrap({
envFile: "/app/.env",
mapping: async () => ({ X: "1" }),
});
const r = await reconciler.start({
envFile: "/app/.env",
mapping: async () => ({ X: "1" }),
onChange: "restart", // | "reload-hook" | (diff) => void
});
r.stop();Top-level helpers
import { isVendoMode, connectUrl, getCredential, HttpAdapter, DEFAULT_RETRY } from "@vendodev/sdk";
isVendoMode(): boolean
connectUrl(slug, opts): string
getCredential(slug) // legacy 0.0.x compatConnectionsAPI
await vendo.connections.list(): Promise<Connection[]>
await vendo.connections.get(slug: string): Promise<Connection | null>IntegrationsAPI
await vendo.integrations.list(): Promise<Integration[]>
await vendo.integrations.get(slug: string): Promise<Integration | null>
await vendo.integrations.envVars(slug: string): Promise<string[]>BillingAPI (Vendo mode only)
await vendo.billing.balance(): Promise<Balance>
await vendo.billing.spendCaps(): Promise<SpendCaps>
await vendo.billing.usage(opts?: { period?: "day" | "month" }): Promise<unknown>EventsAPI (Vendo mode only)
subscribe() returns an AsyncIterable<EventStreamMessage>. Reconnects with
exponential backoff (capped at 30 s by default).
for await (const event of vendo.events.subscribe()) { ... }
for await (const event of vendo.events.subscribe({ signal: AbortSignal })) { ... }WebhooksAPI
import { WebhooksAPI } from "@vendodev/sdk";
const hooks = new WebhooksAPI({ secret: "whsec_...", maxAgeSec: 300 });
const event: WebhookEvent = hooks.verify(headers, body); // body: stringDataAPI (Vendo mode only)
await vendo.data.execute("SLACK_SEND_MESSAGE", { channel: "#general", text: "hi" });Posts to https://composio-proxy.vendo.run/v1/execute.
Error classes
import {
VendoError,
NotConnected,
NeedsReauth,
AuthError,
RateLimited,
BalanceExhausted,
SpendCapExceeded,
UpstreamError,
ValidationError,
IdempotencyConflict,
VendoOnlyFeature,
IdentityNotPresent,
} from "@vendodev/sdk";See Concepts: Errors for usage.
Testing utilities
import { MockClient, fakeConnection } from "@vendodev/sdk";Browser entry point
import { register, VendoConnectButton, VendoConnectionCard } from "@vendodev/sdk/browser";Custom elements: <vendo-connect-button>, <vendo-connection-card>.
Every request method is async and returns a Promise. The exception is
invalidate(slug), which is a synchronous cache eviction.