1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "generate-from-text",
12 "imageData": "",
13 "imageUrl": "",
14 "text": "F",
15 "backgroundColor": "#333333",
16 "foregroundColor": "#FFFFFF",
17 "outputFormats": [
18 "png",
19 "ico"
20 ],
21 "filePrefix": "favicon",
22 "appName": "My PWA App",
23 "shortName": "",
24 "description": "",
25 "themeColor": "#FFFFFF",
26 "scope": "/",
27 "startUrl": "/",
28 "batch": [
29 {
30 "text": "F",
31 "backgroundColor": "#4A90D9",
32 "foregroundColor": "#FFFFFF",
33 "format": "png"
34 },
35 {
36 "text": "A",
37 "backgroundColor": "#E74C3C",
38 "foregroundColor": "#FFFFFF",
39 "format": "ico"
40 },
41 {
42 "text": "M",
43 "backgroundColor": "#2ECC71",
44 "foregroundColor": "#FFFFFF",
45 "format": "svg"
46 }
47 ]
48};
49
50
51const run = await client.actor("perryay/favicon-generator").call(input);
52
53
54console.log('Results from dataset');
55console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
56const { items } = await client.dataset(run.defaultDatasetId).listItems();
57items.forEach((item) => {
58 console.dir(item);
59});
60
61