Skip to content

Commit 43340ad

Browse files
committed
Merge branch 'feat/code-samples-versions' into feat/code-samples-webhooks-builds-runs
2 parents dfb8ec2 + 766838e commit 43340ad

15 files changed

+85
-48
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
await apifyClient.actor('apify~my-sample-actor').delete();
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
await apifyClient.actor('<ACTOR ID>').delete();
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
const actor = await apifyClient.actor('apify~my-sample-actor').get();
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const actor = await apifyClient
7+
.actor('<ACTOR ID>')
8+
.get();
69

710
console.log(actor);
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
const updatedActor = await apifyClient.actor('apify~my-sample-actor').update({
6-
title: 'New title',
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
75
});
6+
const updatedActor = await apifyClient
7+
.actor('<ACTOR ID>')
8+
.update({
9+
title: 'New title',
10+
});
811

912
console.log(updatedActor);
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
await apifyClient.actor('apify~my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.delete();
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
await apifyClient.actor('apify~my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVar('MY_ENV_VAR')
810
.delete();

apify-api/openapi/code_samples/javascript/act_version_envVar_get.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
const envVar = await apifyClient.actor('apify~my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const envVar = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVar('MY_ENV_VAR')
810
.get();
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
const updatedEnvVar = await apifyClient.actor('apify~my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const updatedEnvVar = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVar('MY_ENV_VAR')
810
.update({
911
name: 'MY_ENV_VAR',
10-
value: '54321',
12+
value: 'my-new-value',
1113
});
1214

1315
console.log(updatedEnvVar);

apify-api/openapi/code_samples/javascript/act_version_envVars_get.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
const { items } = await apifyClient.actor('apify~my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const { items } = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVars()
810
.list();

apify-api/openapi/code_samples/javascript/act_version_envVars_post.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
const envVar = await apifyClient.actor('apify~my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const envVar = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.envVars()
810
.create({
911
name: 'MY_ENV_VAR',
10-
value: '12345',
12+
value: 'my-new-value',
1113
isSecret: true,
1214
});
1315

apify-api/openapi/code_samples/javascript/act_version_get.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
// Replace apify~my-sample-actor with your Actor's ID or technical name
5-
const version = await apifyClient.actor('apify~my-sample-actor')
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const version = await apifyClient
7+
.actor('<ACTOR ID>')
68
.version('0.1')
79
.get();
810

0 commit comments

Comments
 (0)