1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 "https://github.com/",
13 "https://www.mozilla.org/en-US/",
14 "https://www.gov.uk/"
15 ],
16 "required_headers": {
17 "strict-transport-security": {
18 "min_max_age": 31536000
19 },
20 "x-content-type-options": {
21 "allowed_values": [
22 "nosniff"
23 ]
24 }
25 },
26 "fail_on": "high",
27 "baseline_name": "",
28 "reset_baseline": false,
29 "alert_webhook_url": "",
30 "request_timeout_seconds": 15,
31 "concurrency": 10,
32 "max_redirects": 5,
33 "max_run_seconds": 240
34};
35
36
37const run = await client.actor("kingii98/security-response-header-regression-gate").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47