Skip to content

Commit 836ea08

Browse files
committed
Merge branch 'feat/code-samples-actor-obj' into feat/code-samples-versions
2 parents b90c617 + cd5c119 commit 836ea08

File tree

6 files changed

+33
-14
lines changed

6 files changed

+33
-14
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: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
const { items } = await apifyClient.actors().list();
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const { items } = await apifyClient
7+
.actors()
8+
.list();
59

610
console.log(items);
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { ApifyClient } from 'apify-client';
22

3-
const apifyClient = new ApifyClient({ token: 'my-token' });
4-
const myActor = await apifyClient.actors().create({ name: 'my-sample-actor' });
3+
const apifyClient = new ApifyClient({
4+
token: '<TOKEN>',
5+
});
6+
const myActor = await apifyClient
7+
.actors()
8+
.create({
9+
name: '<ACTOR NAME>',
10+
});
511

612
console.log(myActor);

sources/platform/actors/development/programming_interface/environment_variables.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ Here's a table of key system environment variables:
2323
| Environment Variable | Description |
2424
|----------------------|-------------|
2525
| `ACTOR_ID` | ID of the Actor. |
26+
| `ACTOR_FULL_NAME` | Full technical name of the Actor, in the format `owner-username/actor-name`. |
2627
| `ACTOR_RUN_ID` | ID of the Actor run. |
2728
| `ACTOR_BUILD_ID` | ID of the Actor build used in the run. |
2829
| `ACTOR_BUILD_NUMBER` | Build number of the Actor build used in the run. |
30+
| `ACTOR_BUILD_TAGS` | A comma-separated list of tags of the Actor build used in the run. Note that this environment variable is assigned at the time of start of the Actor and doesn't change over time, even if the assigned build tags change. |
2931
| `ACTOR_TASK_ID` | ID of the Actor task. Empty if Actor is run outside of any task, e.g. directly using the API. |
3032
| `ACTOR_EVENTS_WEBSOCKET_URL` | Websocket URL where Actor may listen for [events](/platform/actors/development/programming-interface/system-events) from Actor platform. |
3133
| `ACTOR_DEFAULT_DATASET_ID` | Unique identifier for the default dataset associated with the current Actor run. |

0 commit comments

Comments
 (0)