Node SDK
Typed resources, automatic idempotency, retries, pagination, uploads and webhook verification.
Install
npm install @monoclan/node
import Sendforsign from '@monoclan/node';
const sfs = new Sendforsign(process.env.SENDFORSIGN_KEY!, { apiUrl: 'https://api2.sendforsign.com' });
Resources
| Resource | Methods |
|---|---|
documents |
create, retrieve, update, delete, list, all, send, remind, void, content, editContent, pdf, docx, auditTrail, parties.add/update/remove |
files |
create, retrieve, list, content |
templates |
create, retrieve, update, list, createVersion, archive |
sessions |
create |
webhookEndpoints |
create, retrieve, update, delete, list, deliveries, retryDelivery |
events, tenants, apiKeys, account |
list and manage |
Behaviour
- Every
POSTgets an idempotency key. Network errors, 429 and 5xx are retried with backoff, and so is a 409 while the same idempotent request is still in progress; a retry reuses the key. - Errors are
MonoclanErrorwithstatus,type,code,paramandrequestId. all()iterates every page:for await (const d of sfs.documents.all({ status: 'open' })) ….constructEvent(body, header, secret)verifies a webhook and returns the event.