Skip to main content
@onlyform/sdk is the official ESM package for Node.js 18+ and server runtimes with a standards-compatible Fetch API. It includes TypeScript declarations and has no runtime dependencies. The current release targets API contract 2026-08-01.

Install

Configure the client

The client uses https://api.onlyform.com by default. Use the optional baseUrl constructor property only for private development environments.

Create a complete form

The create call accepts blocks, settings, and theme tokens inside definition.
See Form definitions, Block types, and Theme tokens for the complete accepted schema.

Add and remove blocks

Form and block reads return { data, etag }. Pass the latest ETag as ifMatch when editing blocks to prevent overwriting a concurrent change.
Use replaceAll(formId, blocks, { ifMatch }) to atomically replace the complete ordered block collection.

Update a form

Cursor pagination

Other resources

Handle errors

The client accepts AbortSignal on request options and uses a 30-second timeout by default. Set timeoutMs in the constructor to change it.