Skip to content

Commit d78401d

Browse files
committed
feat: add more tasks samples
1 parent 1c68faa commit d78401d

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ApifyClient } from 'apify-client';
2+
3+
const apifyClient = new ApifyClient({ token: 'my-token' });
4+
// Replace apify~my-sample-task with your task's ID or technical name
5+
const input = await apifyClient.task('apify~my-sample-task').getInput();
6+
7+
console.log(input);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ApifyClient } from 'apify-client';
2+
3+
const apifyClient = new ApifyClient({ token: 'my-token' });
4+
// Replace apify~my-sample-task with your task's ID or technical name
5+
const updatedInput = await apifyClient.task('apify~my-sample-task')
6+
.updateInput({
7+
// Your input here
8+
});
9+
10+
console.log(updatedInput);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ApifyClient } from 'apify-client';
2+
3+
const apifyClient = new ApifyClient({ token: 'my-token' });
4+
// Replace apify~my-sample-task with your task's ID or technical name
5+
const { items } = await apifyClient.task('apify~my-sample-task')
6+
.runs()
7+
.list();
8+
9+
console.log(items);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ApifyClient } from 'apify-client';
2+
3+
const apifyClient = new ApifyClient({ token: 'my-token' });
4+
// Replace apify~my-sample-task with your task's ID or technical name
5+
const run = await apifyClient.task('apify~my-sample-task').start();
6+
7+
console.log(run);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ApifyClient } from 'apify-client';
2+
3+
const apifyClient = new ApifyClient({ token: 'my-token' });
4+
// Replace apify~my-sample-task with your task's ID or technical name
5+
const { items } = await apifyClient.task('apify~my-sample-task')
6+
.webhooks()
7+
.list();
8+
9+
console.log(items);

0 commit comments

Comments
 (0)