Skip to main content
The official TypeScript client. Typed methods, automatic retries, response unwrapping. Ships ESM with types, runs on Node 18+, Deno, Bun, Workers, and the browser.

Quickstart

render.ts
jobs.create returns a waiting job. jobs.wait polls until a terminal status (complete, failed, cancelled) and returns it.

Jobs

Every method takes an optional { signal } to abort the request or a wait loop.

Create

type, inputs, and params are per job type. Pass idempotencyKey to make a retry return the original job instead of a duplicate.

Wait, get, list

wait throws if it does not finish before timeout (default 300000). listAll walks every page. Cancel a running job with client.jobs.cancel("job_abc").

Read the output

A job is a union on status. output exists only when status === "complete", error only when failed. Narrow first.
  • outputUrl(job) returns the headline URL: the one file, or the HLS/DASH manifest. It is undefined for data-only jobs, file sets, and non-complete jobs.
  • output.files is every file, for sequences, HLS segments, or a resolution ladder.
  • jobData<T>(job) reads output.data as T | null for probe, detection, and transcript jobs. Validate T yourself for untrusted input.
  • A failed job carries JobError { code, message, detail, retryable }.
jobs.download(id) returns the raw Response, jobs.logs(id) returns execution logs, jobs.types() lists the job types available to your org.

Other resources

Each takes an optional { signal }. Uploads. uploads.create runs the full asset flow and returns an Asset. Reference asset.url as a job input. Ephemeral for 24 hours unless persist: true.
Billing. billing.state() for balance and plan, billing.usage({ start, end }) for spend, billing.usageByClient({ days }) for spend grouped by the client that ran each job (dashboard, sdk, cli, mcp, n8n, or api), billing.transactions({ page, limit }) for the ledger. Webhooks. webhooks.create({ name, url, subscribedEvents }) registers an endpoint. Verify every delivery with the zero-dependency verifyWebhook from @rendobar/sdk/webhooks. Pass the raw body and the request headers. It checks the signature, timestamp freshness, and secret rotation, and returns Promise<boolean>.
Realtime. realtime.subscribeJob(id, { onProgress, onStep, onComplete }) streams one job, realtime.connect({...}) streams all org events.
Realtime needs session-cookie auth, not API keys. API-key users poll with jobs.wait.
Every response and param type is exported from @rendobar/sdk as a named type.

Config and errors

Failed requests throw an ApiError with code, statusCode, message, and retryAfter (on RATE_LIMITED). Narrow with isApiError.
Codes: UNAUTHORIZED, FORBIDDEN, VALIDATION_ERROR, INSUFFICIENT_CREDITS, RATE_LIMITED, NOT_FOUND, CONFLICT, INTERNAL_ERROR. The client auto-retries 429 (respecting Retry-After) and 5xx with backoff. Other 4xx throw immediately.

See also