File tree Expand file tree Collapse file tree 10 files changed +54
-34
lines changed
apify-api/openapi/code_samples/javascript Expand file tree Collapse file tree 10 files changed +54
-34
lines changed Original file line number Diff line number Diff line change 11import { 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 ( ) ;
Original file line number Diff line number Diff line change 11import { 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 ( ) ;
Original file line number Diff line number Diff line change 11import { 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 ( ) ;
Original file line number Diff line number Diff line change 11import { 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
1315console . log ( updatedEnvVar ) ;
Original file line number Diff line number Diff line change 11import { 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 ( ) ;
Original file line number Diff line number Diff line change 11import { 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
Original file line number Diff line number Diff line change 11import { 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
Original file line number Diff line number Diff line change 11import { 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 updatedVersion = await apifyClient . actor ( 'apify/my-sample-actor' )
3+ const apifyClient = new ApifyClient ( {
4+ token : '<TOKEN>' ,
5+ } ) ;
6+ const updatedVersion = await apifyClient
7+ . actor ( '<ACTOR ID>' )
68 . version ( '0.1' )
79 . update ( {
8- gitRepoUrl : 'https://github.com/my-github-account/new-actor-repo ' ,
10+ buildTag : 'latest ' ,
911 } ) ;
1012
1113console . log ( updatedVersion ) ;
Original file line number Diff line number Diff line change 11import { 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 . versions ( )
79 . list ( ) ;
810
Original file line number Diff line number Diff line change 11import { 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 . versions ( )
79 . create ( {
810 versionNumber : '0.1' ,
911 sourceType : 'GIT_REPO' ,
10- gitRepoUrl : 'https://github.com/my-github-account/actor- repo' ,
12+ gitRepoUrl : 'https://github.com/my/ repo' ,
1113 } ) ;
1214
1315console . log ( version ) ;
You can’t perform that action at this time.
0 commit comments