Skip to main content
@rendobar/sdk is the TypeScript client for the Rendobar API: typed methods, automatic retries, and responses already unwrapped from the { data } envelope. ESM and CommonJS builds run on Node 18+, Deno, Bun, Workers, and the browser.
render.ts
jobs.create returns as soon as the job is queued. A job settles on one of three outcomes, and you learn which by polling or by being pushed to.

Jobs

Every method takes an optional { signal } to abort the request or the wait loop. type, inputs, and params are per job type. Pass idempotencyKey so a retried request returns the original job instead of a second one.

Wait

wait polls until the job is complete, failed, or cancelled, then hands it back. Polling starts at 2s and backs off to 10s. Past the timeout it throws WaitTimeoutError carrying the last status seen. Pass throwOnFailure: true to throw JobFailedError on a failed or cancelled job instead of returning it.

Read the output

A Job is a union discriminated on status. output exists only on complete and error only on failed, so narrow before reading either.
outputUrl is undefined for data-only jobs and for file sets with no headline file. jobData<T> trusts the T you give it, so validate the shape yourself when the input is untrusted. The output shape is identical for every job type.

Uploads

uploads.create runs the whole asset flow (init, presigned PUT or parallel multipart, complete) and returns the ready Asset. Assets expire after 24 hours unless you pass persist: true.
Each inputs key is the filename staged in the working directory, and the command refers to it by that bare name. asset.url resolves to a presigned read at dispatch.

Webhooks

webhooks.create({ name, url, subscribedEvents }) registers an endpoint. rotateSecret, test, listDeliveries, and retryDelivery operate it. Verify every delivery with verifyWebhook, a zero-dependency entry point that runs anywhere Web Crypto does.
Pass the raw body, never parsed JSON. It checks the HMAC over ${timestamp}.${body}, rejects deliveries more than 5 minutes old, and accepts the previous secret during the 24-hour rotation window.

Realtime

realtime.subscribeJob streams one job over a WebSocket. realtime.connect streams every event in the org.
A WebSocket can’t carry an Authorization header, so the SDK appends your API key to the URL as a query param. Subscribe from your server, not from a browser. First-party browser apps authenticate with the session cookie instead (credentials: "include").

Billing

billing.state() returns balance and plan. billing.usage({ start, end }) totals spend for a window, billing.usageByClient({ days }) groups that spend by what submitted each job (dashboard, sdk, cli, mcp, n8n, api), and billing.transactions({ page, limit }) reads the ledger. apiKeys, assets, orgs, and team follow the same shape.

Client options

Errors

A failed request throws an ApiError with code, statusCode, message, details, and retryAfter on RATE_LIMITED. Narrow it with isApiError.
429 (respecting Retry-After) and 5xx retry with backoff before they throw. Every other 4xx throws on the first attempt. The codes are in the error catalogue. Every response and param type is exported from @rendobar/sdk as a named type.

See also