@vfrey/sdk is not on npm yet, and it needs the hosted vfrey service, which is not live yet. Today the SDK ships as a packed file next to @vfrey/vfrey in the beta, and you install it from that file. The page shows how it will be used.
@vfrey/sdk is a TypeScript client for the public API. It has no runtime dependencies, uses fetch, and needs Node 22 or newer (or a browser). Errors are typed, rate limits are retried with backoff, and every POST carries an idempotency key.

Install

Until it is published, install the packed file:

Start

Edit a scene, then render it

renderScene submits the job, waits for it, and finds the video. Use render.submit, render.wait, and render.getVideo separately to do other work while it renders.

Edit without conflicts

scenes.update reads the scene, runs your function, and writes the edits. If someone else saved first, it reads again and re-runs your function, up to 3 times.

Handle errors

Every failure throws a subclass of VfreyError with status, code, and message.
The classes match the API error codes. A scene edit that fails throws BadRequestError with .operation, the index of the failing operation.

Page through files

The SDK also reads Topics, Creators, and mail drafts: vfrey.topics, vfrey.creators, vfrey.mail.drafts. They use the same plans and credits as Topics, Creators, and Mail.