n8n-nodes-h2i 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +237 -81
- package/dist/nodes/DavixH2I/DavixH2I.node.js +960 -187
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,144 +1,300 @@
|
|
|
1
1
|
# Davix H2I (PixLab) — n8n Community Node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://h2i.davix.dev)
|
|
5
|
+
[](https://n8n.io)
|
|
6
|
+
|
|
7
|
+
Package: `n8n-nodes-davix-h2i`
|
|
8
|
+
Homepage: https://h2i.davix.dev
|
|
9
|
+
|
|
10
|
+
Use the Davix H2I (PixLab) API directly inside n8n workflows — render HTML to images, transform images, run PDF operations, and run image analysis tools without writing manual HTTP requests.
|
|
11
|
+
|
|
12
|
+
Table of contents
|
|
13
|
+
- Features
|
|
14
|
+
- Requirements
|
|
15
|
+
- Quick start
|
|
16
|
+
- Install via n8n UI (recommended)
|
|
17
|
+
- Install via npm (self-hosted)
|
|
18
|
+
- Credentials
|
|
19
|
+
- Supported resources & operations
|
|
20
|
+
- Inputs & outputs
|
|
21
|
+
- Example workflows
|
|
22
|
+
- Development
|
|
23
|
+
- Troubleshooting
|
|
24
|
+
- Contributing
|
|
25
|
+
- Security
|
|
26
|
+
- License
|
|
27
|
+
- Support & Contact
|
|
7
28
|
|
|
8
29
|
---
|
|
9
30
|
|
|
10
31
|
## Features
|
|
11
32
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
33
|
+
- H2I: Render HTML + CSS to images (PNG, JPEG).
|
|
34
|
+
- Image: Resize, crop, rotate, convert, quality control, export to PDF.
|
|
35
|
+
- PDF: Merge, split, compress, convert PDFs to images, extract images.
|
|
36
|
+
- Tools: Image analysis (metadata, colors, detect format, orientation, hash).
|
|
37
|
+
- Accepts binary inputs (images, PDFs) and attaches them as multipart files to the API.
|
|
38
|
+
- Optionally downloads API results and exposes them as n8n binary data for subsequent nodes (save to disk, S3, Drive, etc.).
|
|
39
|
+
- Minimal configuration: supply Davix API Base URL and API Key credentials.
|
|
18
40
|
|
|
19
41
|
---
|
|
20
42
|
|
|
21
43
|
## Requirements
|
|
22
44
|
|
|
23
|
-
- An n8n instance (self-hosted or compatible environment for community nodes)
|
|
24
|
-
-
|
|
25
|
-
- Davix H2I API
|
|
45
|
+
- An n8n instance (self-hosted or compatible environment for community nodes).
|
|
46
|
+
- Node: Davix H2I API Key.
|
|
47
|
+
- Davix H2I API Base URL — default: `https://pixlab.davix.dev`.
|
|
48
|
+
- n8n version that supports community nodes (recommended recent stable n8n).
|
|
26
49
|
|
|
27
50
|
---
|
|
28
51
|
|
|
29
|
-
##
|
|
52
|
+
## Quick start
|
|
30
53
|
|
|
31
54
|
### Install via n8n UI (recommended)
|
|
32
|
-
1. Open
|
|
33
|
-
2. Go to
|
|
34
|
-
3. Click
|
|
35
|
-
|
|
36
|
-
```text
|
|
55
|
+
1. Open your n8n instance.
|
|
56
|
+
2. Go to Settings → Community Nodes.
|
|
57
|
+
3. Click Install and enter:
|
|
58
|
+
```
|
|
37
59
|
n8n-nodes-davix-h2i
|
|
38
|
-
|
|
60
|
+
```
|
|
61
|
+
4. Restart n8n if prompted.
|
|
39
62
|
|
|
40
|
-
Install via npm (self-hosted)
|
|
63
|
+
### Install via npm (self-hosted)
|
|
41
64
|
Run inside your n8n installation environment:
|
|
42
|
-
|
|
43
|
-
bash
|
|
44
|
-
Copy code
|
|
65
|
+
```bash
|
|
45
66
|
npm install n8n-nodes-davix-h2i
|
|
46
|
-
Restart n8n
|
|
67
|
+
# Restart n8n if needed
|
|
68
|
+
```
|
|
47
69
|
|
|
48
|
-
|
|
49
|
-
In n8n, go to Credentials
|
|
70
|
+
---
|
|
50
71
|
|
|
51
|
-
|
|
72
|
+
## Credentials
|
|
52
73
|
|
|
53
|
-
|
|
74
|
+
In n8n go to Credentials → Create new credential and choose **Davix H2I API**.
|
|
54
75
|
|
|
55
|
-
|
|
76
|
+
Fill the following fields:
|
|
77
|
+
- API Key — your Davix API key
|
|
78
|
+
- Base URL — default is `https://pixlab.davix.dev`. Use your custom URL if you self-host Davix.
|
|
56
79
|
|
|
57
|
-
Base URL
|
|
80
|
+
The node will validate that both Base URL and API Key are present before making any requests.
|
|
58
81
|
|
|
59
|
-
|
|
82
|
+
---
|
|
60
83
|
|
|
61
|
-
|
|
62
|
-
Add node: Davix H2I
|
|
84
|
+
## Supported resources & operations
|
|
63
85
|
|
|
64
|
-
|
|
86
|
+
Davix H2I node exposes four resource groups. Each resource has its own operations and parameters.
|
|
65
87
|
|
|
66
|
-
|
|
88
|
+
- Resource: H2I
|
|
89
|
+
- Operation: Render (HTML → Image)
|
|
90
|
+
- Parameters: html, css, width, height, format (png/jpeg)
|
|
91
|
+
- Optional: Download result as binary
|
|
67
92
|
|
|
68
|
-
|
|
93
|
+
- Resource: Image
|
|
94
|
+
- Operation: Transform / Convert
|
|
95
|
+
- Parameters: input binary properties, format (jpeg/png/webp/avif/gif/svg/pdf), width, height, crop, rotate, flip, quality, keepMetadata, targetSizeKB, enlarge
|
|
96
|
+
- PDF-specific options when format=pdf: pdfMode, pdfPageSize, pdfOrientation, pdfMargin, pdfEmbedFormat, pdfJpegQuality
|
|
97
|
+
- Optional: Download result(s) as binary
|
|
69
98
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
99
|
+
- Resource: PDF
|
|
100
|
+
- Operations: merge, split, compress, to-images, extract-images
|
|
101
|
+
- Parameters: input binary properties (pdf files), sortByName, ranges, prefix, pages, toFormat, width, height, dpi, extractImageFormat
|
|
102
|
+
- Optional: Download result(s) as binary
|
|
73
103
|
|
|
74
|
-
|
|
104
|
+
- Resource: Tools
|
|
105
|
+
- Operation: Analyze
|
|
106
|
+
- Parameters: input binary properties (images), tools (metadata, colors, detect-format, orientation, hash), includeRawExif, paletteSize, hashType
|
|
107
|
+
- Returns JSON analysis results
|
|
75
108
|
|
|
76
|
-
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Inputs & outputs
|
|
77
112
|
|
|
78
|
-
|
|
79
|
-
JSON
|
|
113
|
+
Inputs:
|
|
114
|
+
- JSON fields (e.g., HTML string for H2I render).
|
|
115
|
+
- URLs (where applicable).
|
|
116
|
+
- Binary input: pass file bytes from nodes like HTTP Request, Google Drive, S3, or file-read nodes. Provide the binary property name(s) as comma-separated values for multi-file operations.
|
|
80
117
|
|
|
81
|
-
|
|
118
|
+
Outputs:
|
|
119
|
+
- JSON response containing API status and meta information.
|
|
120
|
+
- Binary outputs when the node is configured to download returned files — the binary will be prepared on the configured output binary property (default `data`).
|
|
82
121
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
122
|
+
Notes about binary fields:
|
|
123
|
+
- When sending multiple binary files, provide a comma-separated list of binary property names (e.g. `pdf1,pdf2` or `image1,image2`).
|
|
124
|
+
- The node names file fields in multipart requests as `files` (for PDFs) or `images` (for images), matching the API's expected fields.
|
|
86
125
|
|
|
87
|
-
|
|
126
|
+
---
|
|
88
127
|
|
|
89
|
-
|
|
128
|
+
## Example usage
|
|
129
|
+
|
|
130
|
+
Below are common example workflows and minimal parameter values to get you started.
|
|
131
|
+
|
|
132
|
+
Example 1 — HTML → Image
|
|
133
|
+
1. Create a Set node with an `html` string (or generate HTML dynamically).
|
|
134
|
+
2. Add the Davix H2I node:
|
|
135
|
+
- Resource: H2I
|
|
136
|
+
- Operation: Render
|
|
137
|
+
- HTML: use the expression or the `html` field
|
|
138
|
+
- CSS: optional
|
|
139
|
+
- Width: 1000
|
|
140
|
+
- Height: 1500
|
|
141
|
+
- Format: png
|
|
142
|
+
- Download Result as Binary: true
|
|
143
|
+
- Output Binary Property: `imageData`
|
|
144
|
+
3. Attach a file-save node (e.g., Write Binary File or Google Drive) to save `imageData`.
|
|
145
|
+
|
|
146
|
+
Example 2 — Image transform (resize & convert)
|
|
147
|
+
1. Download an image via HTTP Request node (set to return binary data).
|
|
148
|
+
2. Davix H2I node:
|
|
149
|
+
- Resource: Image
|
|
150
|
+
- Operation: Transform
|
|
151
|
+
- Input Binary Properties: `data`
|
|
152
|
+
- Format: webp
|
|
153
|
+
- Width: 800
|
|
154
|
+
- Height: 600
|
|
155
|
+
- Quality: 85
|
|
156
|
+
- Download Result(s) as Binary: true
|
|
157
|
+
- Output Binary Property: `convertedImage`
|
|
158
|
+
|
|
159
|
+
Example 3 — Merge PDFs
|
|
160
|
+
1. Use multiple HTTP Request or file-read nodes to obtain binary PDF files under different binary properties (e.g., `pdf1`, `pdf2`).
|
|
161
|
+
2. Davix H2I node:
|
|
162
|
+
- Resource: PDF
|
|
163
|
+
- Operation: Merge
|
|
164
|
+
- Input Binary Properties: `pdf1,pdf2`
|
|
165
|
+
- Sort By Name: false (or true)
|
|
166
|
+
- Download Result(s) as Binary: true
|
|
167
|
+
- Output Binary Property: `mergedPdf`
|
|
168
|
+
|
|
169
|
+
Example 4 — Image analysis (palette and metadata)
|
|
170
|
+
1. Provide an image as binary via `data` property.
|
|
171
|
+
2. Davix H2I node:
|
|
172
|
+
- Resource: Tools
|
|
173
|
+
- Operation: Analyze
|
|
174
|
+
- Input Binary Properties: `data`
|
|
175
|
+
- Tools: Metadata, Colors
|
|
176
|
+
- Include Raw EXIF: true
|
|
177
|
+
3. The node returns JSON with metadata and color palette.
|
|
90
178
|
|
|
91
|
-
|
|
92
|
-
Download image as binary (HTTP Request node)
|
|
179
|
+
---
|
|
93
180
|
|
|
94
|
-
|
|
181
|
+
## API endpoints used by the node
|
|
95
182
|
|
|
96
|
-
|
|
183
|
+
The node issues requests to these paths (appends to the configured Base URL):
|
|
184
|
+
- POST /v1/h2i — HTML → Image (JSON body)
|
|
185
|
+
- POST /v1/image — Image transforms (multipart formData, files/images)
|
|
186
|
+
- POST /v1/pdf — PDF operations (multipart formData, files)
|
|
187
|
+
- POST /v1/tools — Tools / analyze (multipart formData, images)
|
|
97
188
|
|
|
98
|
-
|
|
99
|
-
Provide PDF(s) as binary input
|
|
189
|
+
Requests include the `x-api-key` header (the node injects this from credentials).
|
|
100
190
|
|
|
101
|
-
|
|
191
|
+
---
|
|
102
192
|
|
|
103
|
-
|
|
193
|
+
## Development
|
|
104
194
|
|
|
105
|
-
|
|
106
|
-
This package can include a custom SVG icon. If the icon does not appear:
|
|
195
|
+
This package is authored in TypeScript. Standard commands (see `package.json`) are:
|
|
107
196
|
|
|
108
|
-
|
|
197
|
+
- Build:
|
|
198
|
+
```bash
|
|
199
|
+
npm run build
|
|
200
|
+
# runs: n8n-node build && npm run copy:icons
|
|
201
|
+
```
|
|
109
202
|
|
|
110
|
-
|
|
203
|
+
- Development mode:
|
|
204
|
+
```bash
|
|
205
|
+
npm run dev
|
|
206
|
+
# runs: n8n-node dev
|
|
207
|
+
```
|
|
111
208
|
|
|
112
|
-
|
|
113
|
-
|
|
209
|
+
- Lint:
|
|
210
|
+
```bash
|
|
211
|
+
npm run lint
|
|
212
|
+
npm run lint:fix
|
|
213
|
+
```
|
|
114
214
|
|
|
115
|
-
|
|
116
|
-
|
|
215
|
+
Project layout:
|
|
216
|
+
- `nodes/` — TypeScript source for node and helpers.
|
|
217
|
+
- `dist/` — compiled output (what n8n loads at runtime).
|
|
218
|
+
- `package.json` uses `n8n-node` tooling and declares `dist/` files for distribution.
|
|
117
219
|
|
|
118
|
-
|
|
220
|
+
Icon
|
|
221
|
+
- A custom SVG icon is included at `nodes/DavixH2I/davixH2I.svg`. If icon does not appear in n8n, try restarting n8n or reinstalling the package.
|
|
119
222
|
|
|
120
|
-
|
|
223
|
+
---
|
|
121
224
|
|
|
122
|
-
|
|
123
|
-
Website: https://h2i.davix.dev
|
|
225
|
+
## Troubleshooting
|
|
124
226
|
|
|
125
|
-
|
|
227
|
+
- Missing credentials error:
|
|
228
|
+
- Ensure the Davix H2I credential is created and has both Base URL and API Key.
|
|
229
|
+
- No binary output:
|
|
230
|
+
- Confirm the node is configured to "Download result as binary" or that the API returns a direct file URL in the response.
|
|
231
|
+
- Multipart upload errors:
|
|
232
|
+
- Make sure the binary property names you provide match the previous node outputs exactly.
|
|
233
|
+
- Unexpected API error:
|
|
234
|
+
- Inspect the node JSON output — the API typically returns a JSON object with `status`, `error`, or `results`. Remove or redact API keys before sharing logs.
|
|
126
235
|
|
|
127
236
|
When reporting issues, include:
|
|
237
|
+
- n8n version
|
|
238
|
+
- Node.js version
|
|
239
|
+
- The Davix H2I node version
|
|
240
|
+
- The operation you used
|
|
241
|
+
- Request parameters (with API keys removed)
|
|
242
|
+
- Workflow error logs (if any)
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Contributing
|
|
247
|
+
|
|
248
|
+
Contributions, issues and feature requests are welcome! Please follow these steps:
|
|
249
|
+
1. Fork the repository.
|
|
250
|
+
2. Create a feature branch: `git checkout -b feat/your-feature`.
|
|
251
|
+
3. Build and test locally with `npm run dev` and `npm run build`.
|
|
252
|
+
4. Open a pull request describing your changes.
|
|
253
|
+
|
|
254
|
+
Please keep changes small and focused. Respect semantic versioning when proposing releases.
|
|
128
255
|
|
|
129
|
-
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Security
|
|
259
|
+
|
|
260
|
+
- Do not commit API keys or secrets to source control.
|
|
261
|
+
- If you discover a security vulnerability, please open an issue or contact the project owner privately with details so it can be addressed promptly.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## FAQ
|
|
266
|
+
|
|
267
|
+
Q: Can I use a self-hosted Davix instance?
|
|
268
|
+
A: Yes — set the Base URL in credentials to your instance's URL (e.g., `https://your-davix.example.com`).
|
|
269
|
+
|
|
270
|
+
Q: Can the node process multiple files and return multiple binary outputs?
|
|
271
|
+
A: The node can accept multiple input binaries (as comma-separated binary property names). When the API returns multiple result URLs, the node currently downloads the first URL to the configured output binary property. For multi-file responses, check the JSON `results` array and handle additional URLs via subsequent nodes or custom scripts.
|
|
272
|
+
|
|
273
|
+
Q: How do I send several images in one call?
|
|
274
|
+
A: Use the Input Binary Properties field and provide a comma-separated list of binary property names produced by previous nodes. Each will be attached as an `images` file in the multipart request.
|
|
130
275
|
|
|
131
|
-
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Changelog
|
|
132
279
|
|
|
133
|
-
|
|
280
|
+
See repository releases / tags for version history. This project uses semantic versioning.
|
|
134
281
|
|
|
135
|
-
|
|
282
|
+
---
|
|
136
283
|
|
|
137
|
-
|
|
284
|
+
## License
|
|
138
285
|
|
|
139
|
-
|
|
140
|
-
|
|
286
|
+
MIT — see the LICENSE file for details.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Support & Contact
|
|
291
|
+
|
|
292
|
+
- Website: https://h2i.davix.dev
|
|
293
|
+
- Project: https://github.com/davix-agency/n8n-nodes-davix-h2i
|
|
294
|
+
- For issues, open a GitHub issue with details (remove API keys before posting).
|
|
295
|
+
|
|
296
|
+
---
|
|
141
297
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
298
|
+
Credits
|
|
299
|
+
- Davix (PixLab) — API provider
|
|
300
|
+
- Authors / contributors — Davix H2I node for n8n
|