1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "apiBaseUrl": "https://api.github.com",
12 "paths": [
13 "/",
14 "/rate_limit"
15 ],
16 "expectedAllowOrigins": [
17 "https://app.example.com"
18 ],
19 "expectedDenyOrigins": [
20 "https://evil.example.com",
21 "null",
22 "http://attacker.example"
23 ],
24 "includeSubdomainProbe": true,
25 "methods": [
26 "GET",
27 "POST",
28 "PUT",
29 "DELETE"
30 ],
31 "requestHeaders": [
32 "authorization",
33 "content-type"
34 ],
35 "authorizationStatement": "I own this API, or I am authorized to test it. The Actor sends only OPTIONS and GET requests.",
36 "trackMatrix": true,
37 "matrixKey": "",
38 "timeoutSeconds": 15,
39 "maxConcurrency": 5,
40 "maxRequests": 900,
41 "maxRedirects": 0
42};
43
44
45const run = await client.actor("kingii98/browser-api-cors-allowlist-and-credential-exposure-gate").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55