n8n-nodes-getscreenshot 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 GetScreenshot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # n8n-nodes-getscreenshot
2
+
3
+ This is an n8n community node for the [GetScreenshot API](https://getscreenshotapi.com). It lets you capture screenshots and PDFs of web pages directly in your n8n workflows.
4
+
5
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
6
+
7
+ ## Installation
8
+
9
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
10
+
11
+ **npm package name:** `n8n-nodes-getscreenshot`
12
+
13
+ ## Operations
14
+
15
+ | Operation | Description |
16
+ |-----------|-------------|
17
+ | **Take Screenshot** | Capture a screenshot or PDF of a webpage with customizable options |
18
+ | **Get Usage** | Check your current API quota and usage statistics |
19
+
20
+ ## Credentials
21
+
22
+ You need a GetScreenshot API key to use this node. Get your API key at [getscreenshotapi.com](https://getscreenshotapi.com).
23
+
24
+ 1. Create credentials of type "GetScreenshot API"
25
+ 2. Enter your API key
26
+ 3. The credentials will be tested automatically using the `/validate-key` endpoint
27
+
28
+ ## Features
29
+
30
+ ### Device Presets
31
+ Quickly capture screenshots using common device dimensions:
32
+ - **Mobile:** iPhone 12, iPhone X, iPhone 6/7/8, Pixel 2
33
+ - **Tablet:** iPad, iPad Pro
34
+ - **Desktop:** HD (1280×800), HD+ (1366×768), SXGA, WSXGA+
35
+
36
+ ### Output Formats
37
+ - PNG (default)
38
+ - JPEG
39
+ - WebP
40
+ - PDF (with paper size options)
41
+
42
+ ### Advanced Options
43
+
44
+ **Viewport:**
45
+ - Custom width and height
46
+ - Device scale factor (1x, 2x, 3x for Retina)
47
+
48
+ **Timing:**
49
+ - Wait until condition (network idle, DOM loaded, etc.)
50
+ - Additional wait time in milliseconds
51
+ - Scroll page to trigger lazy-loading
52
+
53
+ **Element Targeting:**
54
+ - Capture specific element by CSS selector
55
+ - Hide elements before capture
56
+ - Click element before capture
57
+
58
+ **Page Modifications:**
59
+ - Auto-hide cookie banners
60
+ - Highlight text
61
+ - Inject custom CSS
62
+ - Execute custom JavaScript
63
+
64
+ **Delivery:**
65
+ - Email screenshot to address
66
+ - POST to webhook URL
67
+
68
+ ## Usage Example
69
+
70
+ ### Basic Screenshot
71
+ 1. Add a GetScreenshot node to your workflow
72
+ 2. Select "Take Screenshot" operation
73
+ 3. Enter the URL to capture
74
+ 4. Choose a device preset or use custom dimensions
75
+ 5. The node outputs both:
76
+ - **JSON data:** URL, dimensions, status
77
+ - **Binary data:** The actual screenshot image
78
+
79
+ ### Full Page PDF
80
+ 1. Set URL to capture
81
+ 2. Set Output Format to "PDF"
82
+ 3. Enable "Full Page"
83
+ 4. Add option "PDF Paper Format" and select A4
84
+ 5. Connect to a "Write File" node to save the PDF
85
+
86
+ ### Screenshot with Modifications
87
+ 1. Set URL to capture
88
+ 2. Add options:
89
+ - Hide Elements: `.ads, .popup`
90
+ - Custom CSS: `body { background: white; }`
91
+ - Additional Wait Time: `2000`
92
+
93
+ ## Output
94
+
95
+ The Take Screenshot operation returns:
96
+
97
+ **JSON:**
98
+ ```json
99
+ {
100
+ "status": "ok",
101
+ "url": "https://example.com",
102
+ "screenshotUrl": "https://storage.googleapis.com/...",
103
+ "width": 1280,
104
+ "height": 800,
105
+ "format": "png",
106
+ "fullPage": false,
107
+ "capturedAt": "2024-01-15T10:30:00.000Z"
108
+ }
109
+ ```
110
+
111
+ **Binary:**
112
+ The screenshot image is attached as binary data named `data`, ready to be used with downstream nodes like:
113
+ - Write Binary File
114
+ - Send Email (with attachment)
115
+ - Upload to S3/GCS
116
+ - HTTP Request (multipart form)
117
+
118
+ ## Resources
119
+
120
+ - [GetScreenshot Documentation](https://docs.rasterwise.com)
121
+ - [GetScreenshot Dashboard](https://getscreenshotapi.com)
122
+ - [n8n Community Nodes](https://docs.n8n.io/integrations/community-nodes/)
123
+
124
+ ## License
125
+
126
+ [MIT](LICENSE)
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class GetScreenshotApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
10
+ //# sourceMappingURL=GetScreenshotApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetScreenshotApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/GetScreenshotApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,gBAAiB,YAAW,eAAe;IACvD,IAAI,SAAsB;IAE1B,WAAW,SAAuB;IAElC,gBAAgB,SAAiC;IAEjD,UAAU,EAAE,eAAe,EAAE,CAY3B;IAEF,YAAY,EAAE,oBAAoB,CAOhC;IAEF,IAAI,EAAE,sBAAsB,CAK1B;CACF"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetScreenshotApi = void 0;
4
+ class GetScreenshotApi {
5
+ name = 'getScreenshotApi';
6
+ displayName = 'GetScreenshot API';
7
+ documentationUrl = 'https://docs.rasterwise.com';
8
+ properties = [
9
+ {
10
+ displayName: 'API Key',
11
+ name: 'apiKey',
12
+ type: 'string',
13
+ typeOptions: {
14
+ password: true,
15
+ },
16
+ default: '',
17
+ required: true,
18
+ description: 'Your GetScreenshot API key. Find it in your dashboard at getscreenshotapi.com',
19
+ },
20
+ ];
21
+ authenticate = {
22
+ type: 'generic',
23
+ properties: {
24
+ qs: {
25
+ apikey: '={{$credentials.apiKey}}',
26
+ },
27
+ },
28
+ };
29
+ test = {
30
+ request: {
31
+ baseURL: 'https://api.rasterwise.com',
32
+ url: '/v1/get-screenshot/validate-key',
33
+ },
34
+ };
35
+ }
36
+ exports.GetScreenshotApi = GetScreenshotApi;
37
+ //# sourceMappingURL=GetScreenshotApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetScreenshotApi.credentials.js","sourceRoot":"","sources":["../../credentials/GetScreenshotApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,gBAAgB;IAC5B,IAAI,GAAG,kBAAkB,CAAC;IAE1B,WAAW,GAAG,mBAAmB,CAAC;IAElC,gBAAgB,GAAG,6BAA6B,CAAC;IAEjD,UAAU,GAAsB;QAC/B;YACC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE;gBACZ,QAAQ,EAAE,IAAI;aACd;YACD,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+EAA+E;SAC5F;KACD,CAAC;IAEF,YAAY,GAAyB;QACpC,IAAI,EAAE,SAAS;QACf,UAAU,EAAE;YACX,EAAE,EAAE;gBACH,MAAM,EAAE,0BAA0B;aAClC;SACD;KACD,CAAC;IAEF,IAAI,GAA2B;QAC9B,OAAO,EAAE;YACR,OAAO,EAAE,4BAA4B;YACrC,GAAG,EAAE,iCAAiC;SACtC;KACD,CAAC;CACF;AApCD,4CAoCC"}
@@ -0,0 +1,3 @@
1
+ export * from './credentials/GetScreenshotApi.credentials';
2
+ export * from './nodes/GetScreenshot/GetScreenshot.node';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./credentials/GetScreenshotApi.credentials"), exports);
18
+ __exportStar(require("./nodes/GetScreenshot/GetScreenshot.node"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6EAA2D;AAC3D,2EAAyD"}
@@ -0,0 +1,6 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class GetScreenshot implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
6
+ //# sourceMappingURL=GetScreenshot.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetScreenshot.node.d.ts","sourceRoot":"","sources":["../../../nodes/GetScreenshot/GetScreenshot.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAEpB,MAAM,cAAc,CAAC;AAStB,qBAAa,aAAc,YAAW,SAAS;IAC9C,WAAW,EAAE,oBAAoB,CA8B/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CA+BvE"}
@@ -0,0 +1,253 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetScreenshot = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const screenshot_operation_1 = require("./actions/screenshot.operation");
6
+ const usage_operation_1 = require("./actions/usage.operation");
7
+ class GetScreenshot {
8
+ description = {
9
+ displayName: 'GetScreenshot',
10
+ name: 'getScreenshot',
11
+ icon: 'file:getscreenshot.svg',
12
+ group: ['transform'],
13
+ version: 1,
14
+ subtitle: '={{$parameter["operation"]}}',
15
+ description: 'Capture screenshots and PDFs of web pages using GetScreenshot API',
16
+ defaults: {
17
+ name: 'GetScreenshot',
18
+ },
19
+ inputs: ['main'],
20
+ outputs: ['main'],
21
+ credentials: [
22
+ {
23
+ name: 'getScreenshotApi',
24
+ required: true,
25
+ },
26
+ ],
27
+ properties: [
28
+ {
29
+ displayName: 'Operation',
30
+ name: 'operation',
31
+ type: 'options',
32
+ noDataExpression: true,
33
+ default: 'screenshot',
34
+ options: [screenshot_operation_1.screenshotDescription, usage_operation_1.usageDescription],
35
+ },
36
+ ...screenshot_operation_1.screenshotProperties,
37
+ ],
38
+ };
39
+ async execute() {
40
+ const items = this.getInputData();
41
+ const returnData = [];
42
+ const operation = this.getNodeParameter('operation', 0);
43
+ for (let i = 0; i < items.length; i++) {
44
+ try {
45
+ if (operation === 'screenshot') {
46
+ const result = await executeScreenshot.call(this, i);
47
+ returnData.push(result);
48
+ }
49
+ else if (operation === 'usage') {
50
+ const result = await executeUsage.call(this, i);
51
+ returnData.push(result);
52
+ }
53
+ }
54
+ catch (error) {
55
+ if (this.continueOnFail()) {
56
+ returnData.push({
57
+ json: {
58
+ error: error.message,
59
+ },
60
+ pairedItem: { item: i },
61
+ });
62
+ continue;
63
+ }
64
+ throw error;
65
+ }
66
+ }
67
+ return [returnData];
68
+ }
69
+ }
70
+ exports.GetScreenshot = GetScreenshot;
71
+ async function executeScreenshot(itemIndex) {
72
+ const url = this.getNodeParameter('url', itemIndex);
73
+ const preset = this.getNodeParameter('preset', itemIndex);
74
+ const outputFormat = this.getNodeParameter('outputFormat', itemIndex);
75
+ const fullPage = this.getNodeParameter('fullPage', itemIndex);
76
+ const options = this.getNodeParameter('options', itemIndex, {});
77
+ // Validate URL
78
+ if (!url.startsWith('http://') && !url.startsWith('https://')) {
79
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'URL must start with http:// or https://', { itemIndex });
80
+ }
81
+ // Build query parameters
82
+ const queryParams = {
83
+ url,
84
+ };
85
+ // Add preset if not custom
86
+ if (preset && preset !== 'none' && !preset.includes('_header')) {
87
+ queryParams.preset = preset;
88
+ }
89
+ // Add custom dimensions if preset is none
90
+ if (preset === 'none') {
91
+ if (options.width) {
92
+ queryParams.width = options.width;
93
+ }
94
+ if (options.height) {
95
+ queryParams.height = options.height;
96
+ }
97
+ }
98
+ // Add output format
99
+ if (outputFormat === 'pdf') {
100
+ queryParams.pdf = 'true';
101
+ if (options.pdfPaper) {
102
+ queryParams.pdfpaper = options.pdfPaper;
103
+ }
104
+ }
105
+ else if (outputFormat !== 'png') {
106
+ queryParams.format = outputFormat;
107
+ }
108
+ // Add full page
109
+ if (fullPage) {
110
+ queryParams.fullpage = 'true';
111
+ }
112
+ // Add device scale factor
113
+ if (options.deviceFactor && options.deviceFactor !== '1') {
114
+ queryParams.devicefactor = options.deviceFactor;
115
+ }
116
+ // Add timing options
117
+ if (options.waitUntil && options.waitUntil !== 'networkidle2') {
118
+ queryParams.waituntil = options.waitUntil;
119
+ }
120
+ if (options.timeWait) {
121
+ queryParams.timewait = options.timeWait;
122
+ }
123
+ if (options.scrollMotion) {
124
+ queryParams.scrollmotion = 'true';
125
+ }
126
+ // Add element targeting
127
+ if (options.element) {
128
+ queryParams.element = options.element;
129
+ }
130
+ if (options.hideElement) {
131
+ queryParams.hideelement = options.hideElement;
132
+ }
133
+ if (options.clickBefore) {
134
+ queryParams.click = options.clickBefore;
135
+ }
136
+ // Add page modifications
137
+ if (options.hideCookie === false) {
138
+ queryParams.hidecookie = 'false';
139
+ }
140
+ if (options.highlight) {
141
+ queryParams.highlight = options.highlight;
142
+ }
143
+ if (options.customCss) {
144
+ queryParams.customcss = options.customCss;
145
+ }
146
+ if (options.customJs) {
147
+ queryParams.customjs = options.customJs;
148
+ }
149
+ // Add delivery options
150
+ if (options.emailTo) {
151
+ queryParams.email = options.emailTo;
152
+ }
153
+ if (options.webhook) {
154
+ queryParams.webhook = options.webhook;
155
+ }
156
+ // Add filename options
157
+ if (options.urlFilename) {
158
+ queryParams.urlfilename = 'true';
159
+ }
160
+ if (options.filenamePrefix) {
161
+ queryParams.filenameprefix = options.filenamePrefix;
162
+ }
163
+ // Add authentication
164
+ if (options.authUser) {
165
+ queryParams.authuser = options.authUser;
166
+ }
167
+ if (options.authPassword) {
168
+ queryParams.authpassword = options.authPassword;
169
+ }
170
+ // Make the API request
171
+ const response = await this.helpers.requestWithAuthentication.call(this, 'getScreenshotApi', {
172
+ method: 'GET',
173
+ url: 'https://api.rasterwise.com/v1/get-screenshot',
174
+ qs: queryParams,
175
+ json: true,
176
+ });
177
+ // Check for API errors
178
+ if (response.status === 'failed') {
179
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Screenshot capture failed: ${response.message || 'Unknown error'}`, { itemIndex });
180
+ }
181
+ if (response.status === 'denied') {
182
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Access denied: ${response.message || 'Rate limit exceeded or invalid API key'}`, { itemIndex });
183
+ }
184
+ // Download the screenshot binary data
185
+ const screenshotUrl = response.screenshotImage || response.screenshotPDF;
186
+ if (!screenshotUrl) {
187
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No screenshot URL returned from API', { itemIndex });
188
+ }
189
+ // Fetch the binary data
190
+ const binaryResponse = await this.helpers.request({
191
+ method: 'GET',
192
+ url: screenshotUrl,
193
+ encoding: null,
194
+ resolveWithFullResponse: true,
195
+ });
196
+ // Determine MIME type and file extension
197
+ let mimeType;
198
+ let fileExtension;
199
+ if (outputFormat === 'pdf') {
200
+ mimeType = 'application/pdf';
201
+ fileExtension = 'pdf';
202
+ }
203
+ else if (outputFormat === 'jpeg') {
204
+ mimeType = 'image/jpeg';
205
+ fileExtension = 'jpg';
206
+ }
207
+ else if (outputFormat === 'webp') {
208
+ mimeType = 'image/webp';
209
+ fileExtension = 'webp';
210
+ }
211
+ else {
212
+ mimeType = 'image/png';
213
+ fileExtension = 'png';
214
+ }
215
+ // Create binary data object
216
+ const binaryData = await this.helpers.prepareBinaryData(Buffer.from(binaryResponse.body), `screenshot.${fileExtension}`, mimeType);
217
+ // Return both JSON metadata and binary data
218
+ return {
219
+ json: {
220
+ status: response.status,
221
+ url: response.url,
222
+ screenshotUrl,
223
+ width: response.width,
224
+ height: response.height,
225
+ format: outputFormat,
226
+ fullPage,
227
+ preset: preset !== 'none' ? preset : undefined,
228
+ capturedAt: new Date().toISOString(),
229
+ },
230
+ binary: {
231
+ data: binaryData,
232
+ },
233
+ pairedItem: { item: itemIndex },
234
+ };
235
+ }
236
+ async function executeUsage(itemIndex) {
237
+ const response = await this.helpers.requestWithAuthentication.call(this, 'getScreenshotApi', {
238
+ method: 'GET',
239
+ url: 'https://api.rasterwise.com/v1/usage',
240
+ json: true,
241
+ });
242
+ return {
243
+ json: {
244
+ usedQuota: response.usedQuota,
245
+ remainingQuota: response.remainingQuota,
246
+ totalQuota: response.totalQuota,
247
+ planName: response.planName,
248
+ resetDate: response.resetDate,
249
+ },
250
+ pairedItem: { item: itemIndex },
251
+ };
252
+ }
253
+ //# sourceMappingURL=GetScreenshot.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetScreenshot.node.js","sourceRoot":"","sources":["../../../nodes/GetScreenshot/GetScreenshot.node.ts"],"names":[],"mappings":";;;AAOA,+CAAkD;AAElD,yEAGwC;AACxC,+DAA6D;AAE7D,MAAa,aAAa;IACzB,WAAW,GAAyB;QACnC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,wBAAwB;QAC9B,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,8BAA8B;QACxC,WAAW,EAAE,mEAAmE;QAChF,QAAQ,EAAE;YACT,IAAI,EAAE,eAAe;SACrB;QACD,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE;YACZ;gBACC,IAAI,EAAE,kBAAkB;gBACxB,QAAQ,EAAE,IAAI;aACd;SACD;QACD,UAAU,EAAE;YACX;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;gBACf,gBAAgB,EAAE,IAAI;gBACt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AAE;YACL,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,cAAc,EAAE,QAAQ,CAAC,cAAc;YACvC,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,SAAS,EAAE,QAAQ,CAAC,SAAS;SAC7B;QACD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;KAC/B,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ export declare const screenshotProperties: INodeProperties[];
3
+ export declare const screenshotDescription: {
4
+ name: string;
5
+ value: string;
6
+ description: string;
7
+ action: string;
8
+ };
9
+ //# sourceMappingURL=screenshot.operation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot.operation.d.ts","sourceRoot":"","sources":["../../../../nodes/GetScreenshot/actions/screenshot.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,oBAAoB,EAAE,eAAe,EA+XjD,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAC"}
@@ -0,0 +1,386 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.screenshotDescription = exports.screenshotProperties = void 0;
4
+ exports.screenshotProperties = [
5
+ // Essential Fields (Always Visible)
6
+ {
7
+ displayName: 'URL',
8
+ name: 'url',
9
+ type: 'string',
10
+ default: '',
11
+ required: true,
12
+ placeholder: 'https://example.com',
13
+ description: 'The URL of the webpage to capture',
14
+ displayOptions: {
15
+ show: {
16
+ operation: ['screenshot'],
17
+ },
18
+ },
19
+ },
20
+ {
21
+ displayName: 'Device Preset',
22
+ name: 'preset',
23
+ type: 'options',
24
+ default: 'none',
25
+ description: 'Select a device preset or use custom dimensions',
26
+ displayOptions: {
27
+ show: {
28
+ operation: ['screenshot'],
29
+ },
30
+ },
31
+ options: [
32
+ {
33
+ name: 'Custom Dimensions',
34
+ value: 'none',
35
+ },
36
+ {
37
+ name: 'iPhone 12 (390×844)',
38
+ value: 'iphone12',
39
+ },
40
+ {
41
+ name: 'iPhone X (375×812)',
42
+ value: 'iphonex',
43
+ },
44
+ {
45
+ name: 'iPhone 6/7/8 (375×667)',
46
+ value: 'iphone678',
47
+ },
48
+ {
49
+ name: 'iPhone 6/7/8 Plus (414×736)',
50
+ value: 'iphone678_plus',
51
+ },
52
+ {
53
+ name: 'Pixel 2 (411×731)',
54
+ value: 'pixel2',
55
+ },
56
+ {
57
+ name: 'Pixel 2 XL (411×823)',
58
+ value: 'pixel2_xl',
59
+ },
60
+ {
61
+ name: 'iPad (768×1024)',
62
+ value: 'ipad',
63
+ },
64
+ {
65
+ name: 'iPad Pro (1024×1366)',
66
+ value: 'ipadpro',
67
+ },
68
+ {
69
+ name: 'HD (1280×800)',
70
+ value: 'wxga_s',
71
+ },
72
+ {
73
+ name: 'HD+ (1366×768)',
74
+ value: 'wxga_l',
75
+ },
76
+ {
77
+ name: 'SXGA (1280×1024)',
78
+ value: 'sxga',
79
+ },
80
+ {
81
+ name: 'WSXGA+ (1680×1050)',
82
+ value: 'wsxga_plus',
83
+ },
84
+ ],
85
+ },
86
+ {
87
+ displayName: 'Output Format',
88
+ name: 'outputFormat',
89
+ type: 'options',
90
+ default: 'png',
91
+ description: 'The format of the captured image',
92
+ displayOptions: {
93
+ show: {
94
+ operation: ['screenshot'],
95
+ },
96
+ },
97
+ options: [
98
+ {
99
+ name: 'PNG',
100
+ value: 'png',
101
+ },
102
+ {
103
+ name: 'JPEG',
104
+ value: 'jpeg',
105
+ },
106
+ {
107
+ name: 'WebP',
108
+ value: 'webp',
109
+ },
110
+ {
111
+ name: 'PDF',
112
+ value: 'pdf',
113
+ },
114
+ ],
115
+ },
116
+ {
117
+ displayName: 'Full Page',
118
+ name: 'fullPage',
119
+ type: 'boolean',
120
+ default: false,
121
+ description: 'Whether to capture the full scrollable page instead of just the viewport',
122
+ displayOptions: {
123
+ show: {
124
+ operation: ['screenshot'],
125
+ },
126
+ },
127
+ },
128
+ // Options Collection (Advanced Settings)
129
+ {
130
+ displayName: 'Options',
131
+ name: 'options',
132
+ type: 'collection',
133
+ placeholder: 'Add Option',
134
+ default: {},
135
+ displayOptions: {
136
+ show: {
137
+ operation: ['screenshot'],
138
+ },
139
+ },
140
+ options: [
141
+ // Viewport Options
142
+ {
143
+ displayName: 'Width',
144
+ name: 'width',
145
+ type: 'number',
146
+ default: 1280,
147
+ description: 'Viewport width in pixels (used when preset is "Custom Dimensions")',
148
+ typeOptions: {
149
+ minValue: 100,
150
+ maxValue: 3840,
151
+ },
152
+ },
153
+ {
154
+ displayName: 'Height',
155
+ name: 'height',
156
+ type: 'number',
157
+ default: 800,
158
+ description: 'Viewport height in pixels (used when preset is "Custom Dimensions")',
159
+ typeOptions: {
160
+ minValue: 100,
161
+ maxValue: 16384,
162
+ },
163
+ },
164
+ {
165
+ displayName: 'Device Scale Factor',
166
+ name: 'deviceFactor',
167
+ type: 'options',
168
+ default: '1',
169
+ description: 'Device pixel ratio (Retina displays use 2x or 3x)',
170
+ options: [
171
+ {
172
+ name: '1x (Standard)',
173
+ value: '1',
174
+ },
175
+ {
176
+ name: '2x (Retina)',
177
+ value: '2',
178
+ },
179
+ {
180
+ name: '3x (High DPI)',
181
+ value: '3',
182
+ },
183
+ ],
184
+ },
185
+ // Timing Options
186
+ {
187
+ displayName: 'Wait Until',
188
+ name: 'waitUntil',
189
+ type: 'options',
190
+ default: 'networkidle2',
191
+ description: 'When to consider the page loaded',
192
+ options: [
193
+ {
194
+ name: 'Network Idle (Recommended)',
195
+ value: 'networkidle2',
196
+ description: 'No more than 2 network connections for 500ms',
197
+ },
198
+ {
199
+ name: 'Network Idle (Strict)',
200
+ value: 'networkidle0',
201
+ description: 'No network connections for 500ms',
202
+ },
203
+ {
204
+ name: 'DOM Content Loaded',
205
+ value: 'domcontentloaded',
206
+ description: 'HTML fully parsed, resources may still load',
207
+ },
208
+ {
209
+ name: 'Load',
210
+ value: 'load',
211
+ description: 'Page and all resources loaded',
212
+ },
213
+ ],
214
+ },
215
+ {
216
+ displayName: 'Additional Wait Time (ms)',
217
+ name: 'timeWait',
218
+ type: 'number',
219
+ default: 0,
220
+ description: 'Additional milliseconds to wait after the page loads',
221
+ typeOptions: {
222
+ minValue: 0,
223
+ maxValue: 30000,
224
+ },
225
+ },
226
+ {
227
+ displayName: 'Scroll Page First',
228
+ name: 'scrollMotion',
229
+ type: 'boolean',
230
+ default: false,
231
+ description: 'Whether to scroll through the page before capturing (triggers lazy-loaded content)',
232
+ },
233
+ // Element Targeting
234
+ {
235
+ displayName: 'Capture Specific Element',
236
+ name: 'element',
237
+ type: 'string',
238
+ default: '',
239
+ placeholder: '#main-content, .hero-section',
240
+ description: 'CSS selector of a specific element to capture instead of the full viewport',
241
+ },
242
+ {
243
+ displayName: 'Hide Elements',
244
+ name: 'hideElement',
245
+ type: 'string',
246
+ default: '',
247
+ placeholder: '.ads, #popup, .cookie-banner',
248
+ description: 'CSS selectors of elements to hide before capturing (comma-separated)',
249
+ },
250
+ {
251
+ displayName: 'Click Before Capture',
252
+ name: 'clickBefore',
253
+ type: 'string',
254
+ default: '',
255
+ placeholder: '#accept-cookies, .close-modal',
256
+ description: 'CSS selector of an element to click before capturing',
257
+ },
258
+ // Page Modifications
259
+ {
260
+ displayName: 'Hide Cookie Banners',
261
+ name: 'hideCookie',
262
+ type: 'boolean',
263
+ default: true,
264
+ description: 'Whether to automatically hide common cookie consent banners',
265
+ },
266
+ {
267
+ displayName: 'Highlight Text',
268
+ name: 'highlight',
269
+ type: 'string',
270
+ default: '',
271
+ placeholder: 'important keyword',
272
+ description: 'Text to highlight with a yellow marker on the page',
273
+ },
274
+ {
275
+ displayName: 'Custom CSS',
276
+ name: 'customCss',
277
+ type: 'string',
278
+ default: '',
279
+ placeholder: 'body { background: white; }',
280
+ description: 'Custom CSS to inject into the page before capturing',
281
+ typeOptions: {
282
+ rows: 3,
283
+ },
284
+ },
285
+ {
286
+ displayName: 'Custom JavaScript',
287
+ name: 'customJs',
288
+ type: 'string',
289
+ default: '',
290
+ placeholder: "document.querySelector('.popup').remove();",
291
+ description: 'JavaScript to execute on the page before capturing',
292
+ typeOptions: {
293
+ rows: 3,
294
+ },
295
+ },
296
+ // PDF Options
297
+ {
298
+ displayName: 'PDF Paper Format',
299
+ name: 'pdfPaper',
300
+ type: 'options',
301
+ default: 'a4',
302
+ description: 'Paper size for PDF output',
303
+ options: [
304
+ {
305
+ name: 'Letter',
306
+ value: 'letter',
307
+ },
308
+ {
309
+ name: 'Legal',
310
+ value: 'legal',
311
+ },
312
+ {
313
+ name: 'Tabloid',
314
+ value: 'tabloid',
315
+ },
316
+ {
317
+ name: 'A4',
318
+ value: 'a4',
319
+ },
320
+ {
321
+ name: 'A3',
322
+ value: 'a3',
323
+ },
324
+ ],
325
+ },
326
+ // Delivery Options
327
+ {
328
+ displayName: 'Email Screenshot To',
329
+ name: 'emailTo',
330
+ type: 'string',
331
+ default: '',
332
+ placeholder: 'user@example.com',
333
+ description: 'Email address to send the screenshot to',
334
+ },
335
+ {
336
+ displayName: 'Webhook URL',
337
+ name: 'webhook',
338
+ type: 'string',
339
+ default: '',
340
+ placeholder: 'https://your-server.com/webhook',
341
+ description: 'URL to POST the screenshot result to',
342
+ },
343
+ // Filename Options
344
+ {
345
+ displayName: 'Use URL as Filename',
346
+ name: 'urlFilename',
347
+ type: 'boolean',
348
+ default: false,
349
+ description: 'Whether to use the captured URL as the filename instead of a random string',
350
+ },
351
+ {
352
+ displayName: 'Filename Prefix',
353
+ name: 'filenamePrefix',
354
+ type: 'string',
355
+ default: '',
356
+ placeholder: 'project-screenshots',
357
+ description: 'Custom prefix path for the stored screenshot file',
358
+ },
359
+ // Authentication
360
+ {
361
+ displayName: 'HTTP Basic Auth Username',
362
+ name: 'authUser',
363
+ type: 'string',
364
+ default: '',
365
+ description: 'Username for HTTP Basic Authentication on the target page',
366
+ },
367
+ {
368
+ displayName: 'HTTP Basic Auth Password',
369
+ name: 'authPassword',
370
+ type: 'string',
371
+ typeOptions: {
372
+ password: true,
373
+ },
374
+ default: '',
375
+ description: 'Password for HTTP Basic Authentication on the target page',
376
+ },
377
+ ],
378
+ },
379
+ ];
380
+ exports.screenshotDescription = {
381
+ name: 'screenshot',
382
+ value: 'screenshot',
383
+ description: 'Capture a screenshot or PDF of a webpage',
384
+ action: 'Capture a screenshot of a URL',
385
+ };
386
+ //# sourceMappingURL=screenshot.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screenshot.operation.js","sourceRoot":"","sources":["../../../../nodes/GetScreenshot/actions/screenshot.operation.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAsB;IACtD,oCAAoC;IACpC;QACC,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,qBAAqB;QAClC,WAAW,EAAE,mCAAmC;QAChD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;KACD;IACD;QACC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,iDAAiD;QAC9D,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,SAAS,EAAE,CAAC,YAAY,CAAC;aACzB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,mBAAmB;gBACzB,KAAK,EAAE,MAAM;aACb;YACD;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,UAAU;aACjB;YACD;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,SAAS;aAChB;YACD;gBACC,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,WAAW;aAClB;YACD;gB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+ export declare const usageProperties: INodeProperties[];
3
+ export declare const usageDescription: {
4
+ name: string;
5
+ value: string;
6
+ description: string;
7
+ action: string;
8
+ };
9
+ //# sourceMappingURL=usage.operation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.operation.d.ts","sourceRoot":"","sources":["../../../../nodes/GetScreenshot/actions/usage.operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,eAAe,EAAE,eAAe,EAAO,CAAC;AAErD,eAAO,MAAM,gBAAgB;;;;;CAK5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usageDescription = exports.usageProperties = void 0;
4
+ exports.usageProperties = [];
5
+ exports.usageDescription = {
6
+ name: 'usage',
7
+ value: 'usage',
8
+ description: 'Get current API usage and quota information',
9
+ action: 'Get API usage quota',
10
+ };
11
+ //# sourceMappingURL=usage.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.operation.js","sourceRoot":"","sources":["../../../../nodes/GetScreenshot/actions/usage.operation.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAsB,EAAE,CAAC;AAExC,QAAA,gBAAgB,GAAG;IAC/B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,6CAA6C;IAC1D,MAAM,EAAE,qBAAqB;CAC7B,CAAC"}
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" width="50" height="50">
2
+ <circle cx="25" cy="25" r="25" fill="#DB1425"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.118 19.9998H23.8846L21.7667 30.769H10L12.118 19.9998Z" fill="white"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M27.4641 19.9998H39.2307L37.1127 30.769H25.3461L27.4641 19.9998Z" fill="white"/>
5
+ </svg>
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "n8n-nodes-getscreenshot",
3
+ "version": "1.0.0",
4
+ "description": "n8n community node for GetScreenshot API - capture screenshots and PDFs of web pages",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n",
8
+ "screenshot",
9
+ "getscreenshot",
10
+ "web capture",
11
+ "pdf",
12
+ "automation"
13
+ ],
14
+ "license": "MIT",
15
+ "homepage": "https://getscreenshotapi.com",
16
+ "author": {
17
+ "name": "GetScreenshot",
18
+ "email": "support@getscreenshotapi.com"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/rasterwise/n8n-nodes-getscreenshot.git"
23
+ },
24
+ "engines": {
25
+ "node": ">=18.10"
26
+ },
27
+ "main": "dist/index.js",
28
+ "types": "dist/index.d.ts",
29
+ "scripts": {
30
+ "build": "tsc && gulp build:icons",
31
+ "dev": "tsc --watch",
32
+ "format": "prettier nodes credentials --write",
33
+ "lint": "eslint nodes credentials package.json",
34
+ "lintfix": "eslint nodes credentials package.json --fix",
35
+ "prepublishOnly": "npm run build && npm run lint"
36
+ },
37
+ "files": [
38
+ "dist"
39
+ ],
40
+ "n8n": {
41
+ "n8nNodesApiVersion": 1,
42
+ "credentials": [
43
+ "dist/credentials/GetScreenshotApi.credentials.js"
44
+ ],
45
+ "nodes": [
46
+ "dist/nodes/GetScreenshot/GetScreenshot.node.js"
47
+ ]
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^25.0.9",
51
+ "@typescript-eslint/parser": "^7.15.0",
52
+ "eslint": "^8.56.0",
53
+ "eslint-plugin-n8n-nodes-base": "^1.16.1",
54
+ "gulp": "^4.0.2",
55
+ "n8n-workflow": "^1.70.0",
56
+ "prettier": "^3.3.2",
57
+ "typescript": "~5.5.2"
58
+ },
59
+ "peerDependencies": {
60
+ "n8n-workflow": "^1.70.0"
61
+ }
62
+ }