TypeScript / JavaScript
npm install @trustysweep/sdkimport { TrustySweep, SweepError, RateLimitError } from "@trustysweep/sdk";const sweep = new TrustySweep({ apiKey: process.env.SWEEP_API_KEY });
for await (const s of sweep.sources.list({ connection_id: "cxn_…" })) console.log(s.display_name);const { plan, receipt } = await sweep.sweep({ intent: "sweep", connection_id: "cxn_…", source_ids: ["src_…"], selection: { policy: true } });- Resources:
providers,auth,account,billing,usage,connect,connections,sources,assets,diagnosis,graph,plans,executions,receipts,vault,migrations,destinations,automation,intel,creator,grants,principals,developer,events,jobs,webhooks. PagePromise: await for the first page,for awaitfor all items,.pages(),.all(max).executions.waitFor(id)andjobs.waitFor(id)poll with backoff.webhooks.constructEvent(rawBody, header, secret),receipts.verify(receipt, jwks?).- Errors:
SweepError(problem document),RateLimitError(retryAfterSeconds),SweepConnectionError,WebhookSignatureError. - Options:
baseUrl,fetch,maxRetries,timeoutMs,headers,credentials(browser session auth).
Types are generated from openapi.yaml; scripts/check-coverage.mjs fails the build if any operation lacks a method. Source: sdk-typescript/ in the platform repo.