@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
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 insidedefinition.
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.
replaceAll(formId, blocks, { ifMatch }) to atomically replace the complete ordered block collection.
Update a form
Cursor pagination
Other resources
Handle errors
AbortSignal on request options and uses a 30-second timeout by default. Set timeoutMs in the constructor to change it.