Install the client
Install the npm client and render PDFs with an API key.
1. Install the package
2. Configure the client
Configure the client with the base URL and your API key. The API key goes into
the headers option, as the x-api-key header.
An API key grants full access to the API and belongs on the server only. To render from a frontend app, proxy the call through your own backend, see Call it from another service.
3. Render a PDF
id is your own identifier for the document. The service does not interpret it,
it echoes it back in the response so you can match results to requests. Use a
UUID, e.g. your order or invoice ID.
fileId is the id the service gave the rendered file, and the last segment of
url. Store it if you would rather keep your own reference and build the
download request from applicationId and fileId.
url is the endpoint the PDF is served from. It is not a public link: fetching
it needs the same API key, see Download a PDF.
data is a plain object; its keys are the template variables. See
Template syntax and
Request reference.
4. Render several documents at once
payloads is an array, so one call can render a batch. Documents may come from
different templates of the same application:
The response arrives once every document in the batch is rendered, and a single failing document fails the whole request. Keep batches small enough to stay inside your own request timeout.