1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\" width=\"200\" height=\"200\"> <defs> <linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"> <stop offset=\"0\" stop-color=\"#f97316\"/> <stop offset=\"1\" stop-color=\"#dc2626\"/> </linearGradient> </defs> <circle cx=\"100\" cy=\"100\" r=\"90\" fill=\"url(#g)\"/> <path d=\"M60 110 L90 140 L145 70\" fill=\"none\" stroke=\"#ffffff\" stroke-width=\"18\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/> </svg>",
12 "sizes": [
13 16,
14 32,
15 48,
16 180,
17 192,
18 512
19 ]
20};
21
22
23const run = await client.actor("mauberme/logo-to-social-images").call(input);
24
25
26console.log('Results from dataset');
27console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
28const { items } = await client.dataset(run.defaultDatasetId).listItems();
29items.forEach((item) => {
30 console.dir(item);
31});
32
33