1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sourceJsonRecords": [
12 {
13 "id": "demo-1001",
14 "name": "Amina Yusuf",
15 "email": "amina.yusuf@example.test",
16 "phone": "+1-202-555-0141",
17 "company": "Northwind Analytics",
18 "notes": "Priority lead for regional expansion."
19 },
20 {
21 "id": "demo-1002",
22 "name": "Luca Moretti",
23 "email": "luca.moretti@example.test",
24 "phone": "+39-06-5550-0142",
25 "company": "Blue Cedar Systems",
26 "notes": "Interested in quarterly exports only."
27 }
28 ],
29 "fieldsToEncrypt": [
30 "email",
31 "phone"
32 ],
33 "passphrase": "Apify-demo-passphrase-change-in-production"
34};
35
36
37const run = await client.actor("sovanza.inc/encrypted-data-integration").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