@firma-dev/sdk package is the official TypeScript client for the Firma.dev API. It ships fully typed request and response models, resolves the correct base URL for you, and exposes every endpoint as a typed method, so you get editor autocompletion and compile-time safety instead of hand-rolled fetch calls.
The SDK is generated directly from the same OpenAPI specification that powers this API reference, so its methods and types always match the endpoints documented here.
Prerequisites
- Node.js 18 or later (the SDK uses the built-in
fetch). - A Firma.dev API key. See Authentication for how to create one and which key (live vs. test) to use.
Installation
Authentication
Create a client with your API key. The key is sent on every request as theAuthorization header; the SDK handles that for you, so you never build the header yourself.
Quickstart
List the templates in your workspace:.withRawResponse() (see Responses and raw access).
Common operations
Every endpoint in this API reference is available as a typed method, grouped by resource (firma.templates, firma.signingRequests, firma.webhooks, and so on). The examples below cover the most common flows.
Templates
Signing requests
Creating and sending a signing request takes a larger structured payload (recipients, fields, settings). Open the Create and send signing request page in the API reference and select the
@firma-dev/sdk tab to copy the exact typed call for your parameters.Webhooks
Responses and raw access
By default, awaiting a call resolves to the response body. To inspect the underlying HTTP response, use.withRawResponse():
Error handling
Failed requests throw a typed error you can catch. Errors carry the HTTP status code and the parsed error body returned by the API.Pagination
List endpoints acceptpage and page_size and return a pagination object alongside the results. Iterate by incrementing page until you have collected every item:
Field names on the pagination object follow the response schema shown on each list endpoint in the API reference. Check the endpoint page if you are unsure of the exact shape.
Next steps
Authentication
Create and manage the API keys the SDK authenticates with.
Webhooks
Receive real-time events for signing request lifecycle changes.
Sending a signing request
Walk through the full send flow the SDK methods map to.
API reference
Every endpoint, each with a copy-paste
@firma-dev/sdk example.