Skip to main content
The official Node SDK is published on npm as hyperclip. This page shows production patterns built on top of it. For the full method reference see SDKs.

Install

Requires Node 18+ (uses native fetch). Works on Vercel, Netlify, AWS Lambda, Cloudflare Workers, Bun, and Deno.

Basic usage

Bulk processing with concurrency control

Run the same flow against rows from a spreadsheet, CMS, or queue. Fixed concurrency keeps you from overwhelming credit reservations.
The deterministic idempotency key (one per row ID) is the magic here. If the batch crashes and you re-run it, already-processed rows return their existing completed run instead of re-charging.

Next.js: webhook-triggered generation

Expose an API route that kicks off a run and returns its ID immediately. Your frontend polls a status endpoint until the video is ready — never touching the API key.
The frontend polls GET /api/generate/<id> every few seconds and renders the video once status === "completed".

Cloudflare Workers / edge runtimes

The SDK is dependency-free and runs on any environment that has fetch. The one gotcha: edge runtimes don’t have process.env by default — pass the API key explicitly.
Don’t runs.wait() inside a serverless function with a short timeout. Most serverless platforms cap at 30s of CPU time. Return the run ID and let the client poll.

Cancellation with AbortSignal

The wait() helper accepts an AbortSignal so you can bail early — useful when the user navigates away or your job runner ages out.

Error handling

See error codes for every case.

Inline FlowSchema (no saved flow)

Skip the saved-flow step and pass a graph inline. Useful for templated or AI-generated flows.
See inline FlowSchema for the full shape and node catalog.

Bring-your-own fetch

Inject a custom fetch for testing, structured logging, or proxying:

Where next

SDK reference

Every method, parameter, and option.

Inputs reference

All the ways to override a flow’s defaults at run time.

Errors

Catalog of every error you can hit.

Source on GitHub

File issues, read source, watch for releases.