Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doczilla-app/doczilla-node
Doczilla API wrapper, effortlessly create PDFs and screenshots based on your HTML.
https://github.com/doczilla-app/doczilla-node
html-to-image html-to-pdf html-to-pdf-api html2image html2pdf puppeteer
Last synced: about 1 month ago
JSON representation
Doczilla API wrapper, effortlessly create PDFs and screenshots based on your HTML.
- Host: GitHub
- URL: https://github.com/doczilla-app/doczilla-node
- Owner: Doczilla-APP
- License: mit
- Created: 2023-12-16T12:16:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-21T09:02:58.000Z (about 2 months ago)
- Last Synced: 2024-11-21T10:18:27.084Z (about 2 months ago)
- Topics: html-to-image, html-to-pdf, html-to-pdf-api, html2image, html2pdf, puppeteer
- Language: TypeScript
- Homepage: https://www.doczilla.app
- Size: 1.7 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Doczilla Node.js Library
## Installation
Install the package with:
```sh
npm install @doczilla/node
# or
yarn add @doczilla/node
```## Usage
The package needs to be configured with your account's API key, which is
available on your [Doczilla's organisation settings page](https://doczilla.app/login).```ts
import Doczilla from '@doczilla/node'const doczilla = new Doczilla('doczilla-...')
const pdfBuffer = await doczilla.pdf.direct({
page: {
html: 'Your first Doczilla PDF'
}
})
```### Webhook signing
Doczilla can optionally sign the webhook events it sends to your endpoint, allowing you to validate that they were not
sent by a third party. You can read more about it [here](https://docs.doczilla.app/examples/securing-webhooks).Please note that you must pass the _raw_ request body, exactly as received from Doczilla, to the `verifyPayload()`
function; this will not work with a parsed (i.e., JSON) request body.```js
const event = doczilla.webhooks.verifyPayload(
webhookRawBody,
webhookDoczillaSignatureHeader,
webhookSecret
);
```