1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "demo",
12 "captureConfig": {
13 "port": 3000,
14 "captureEndpoint": "/webhook",
15 "validateSignatures": false,
16 "signatureHeader": "X-Signature",
17 "signatureSecret": "",
18 "maxCaptureMinutes": 60,
19 "autoStop": true
20 },
21 "replayConfig": {
22 "targetUrl": "",
23 "replayAll": true,
24 "eventIds": [],
25 "filterByEventType": "",
26 "addReplayHeaders": true,
27 "delayBetweenRequests": 100
28 },
29 "queryConfig": {
30 "filterByEventType": "",
31 "filterBySource": "",
32 "dateFrom": "",
33 "dateTo": "",
34 "limit": 100,
35 "includePayload": true
36 },
37 "storageDatasetId": ""
38};
39
40
41const run = await client.actor("fiery_dream/webhook-event-store").call(input);
42
43
44console.log('Results from dataset');
45console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51