Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apify-api/openapi/code_samples/javascript/act_delete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({
token: '<TOKEN>',
});
await apifyClient.actor('<ACTOR ID>').delete();
10 changes: 10 additions & 0 deletions apify-api/openapi/code_samples/javascript/act_get.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({
token: '<TOKEN>',
});
const actor = await apifyClient
.actor('<ACTOR ID>')
.get();

console.log(actor);
12 changes: 12 additions & 0 deletions apify-api/openapi/code_samples/javascript/act_put.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({
token: '<TOKEN>',
});
const updatedActor = await apifyClient
.actor('<ACTOR ID>')
.update({
title: 'New title',
});

console.log(updatedActor);
8 changes: 6 additions & 2 deletions apify-api/openapi/code_samples/javascript/acts_get.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({ token: 'my-token' });
const { items } = await apifyClient.actors().list();
const apifyClient = new ApifyClient({
token: '<TOKEN>',
});
const { items } = await apifyClient
.actors()
.list();

console.log(items);
10 changes: 8 additions & 2 deletions apify-api/openapi/code_samples/javascript/acts_post.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { ApifyClient } from 'apify-client';

const apifyClient = new ApifyClient({ token: 'my-token' });
const myActor = await apifyClient.actors().create({ name: 'my-actor' });
const apifyClient = new ApifyClient({
token: '<TOKEN>',
});
const myActor = await apifyClient
.actors()
.create({
name: '<ACTOR NAME>',
});

console.log(myActor);
Loading