Configuration
Hierarchy
- Configuration
- Configuration
Index
Constructors
externalconstructor
Creates new
Configuration
instance with provided options. Env vars will have precedence over those.Parameters
externaloptionaloptions: ConfigurationOptions
Returns Configuration
Properties
externalreadonlystorageManagers
staticoptionalglobalConfig
Methods
get
Type parameters
- T: keyof ConfigurationOptions
- U: undefined | string | number | boolean | Dictionary | StorageClient | EventManager | (radix?: number) => string | (fractionDigits?: number) => string | (fractionDigits?: number) => string | (precision?: number) => string | () => number | ({ (locales?: string | string[], options?: NumberFormatOptions): string; (locales?: LocalesArgument, options?: NumberFormatOptions): string })
Parameters
key: T
optionaldefaultValue: U
Returns U
externalgetEventManager
Returns EventManager
set
Parameters
key: keyof ConfigurationOptions
optionalvalue: any
Returns void
externaluseEventManager
Parameters
externalevents: EventManager
Returns void
externaluseStorageClient
Parameters
externalclient: StorageClient
Returns void
staticexternalgetEventManager
Gets default EventManager instance.
Returns EventManager
staticgetGlobalConfig
Returns Configuration
staticexternalgetStorageClient
Gets default StorageClient instance.
Returns StorageClient
staticresetGlobalState
Resets global configuration instance. The default instance holds configuration based on env vars, if we want to change them, we need to first reset the global state. Used mainly for testing purposes.
Returns void
staticexternalset
Sets value for given option. Only affects the global
Configuration
instance, the value will not be propagated down to the env var. To reset a value, we can omit thevalue
argument or passundefined
there.Parameters
externalkey: keyof ConfigurationOptions
externaloptionalvalue: any
Returns void
staticexternaluseStorageClient
Parameters
externalclient: StorageClient
Returns void
Configuration
is a value object holding the SDK configuration. We can use it in two ways:Actor
class, we can get the instance configuration viasdk.config
Supported Configuration Options
memoryMbytes
ACTOR_MEMORY_MBYTES
headless
APIFY_HEADLESS
persistStateIntervalMillis
APIFY_PERSIST_STATE_INTERVAL_MILLIS
60e3
token
APIFY_TOKEN
isAtHome
APIFY_IS_AT_HOME
defaultDatasetId
ACTOR_DEFAULT_DATASET_ID
'default'
defaultKeyValueStoreId
ACTOR_DEFAULT_KEY_VALUE_STORE_ID
'default'
defaultRequestQueueId
ACTOR_DEFAULT_REQUEST_QUEUE_ID
'default'
Advanced Configuration Options
actorEventsWsUrl
ACTOR_EVENTS_WEBSOCKET_URL
actorId
ACTOR_ID
actorRunId
ACTOR_RUN_ID
actorTaskId
ACTOR_TASK_ID
apiBaseUrl
APIFY_API_BASE_URL
'https://api.apify.com'
containerPort
ACTOR_WEB_SERVER_PORT
4321
containerUrl
ACTOR_WEB_SERVER_URL
'http://localhost:4321'
inputKey
ACTOR_INPUT_KEY
'INPUT'
metamorphAfterSleepMillis
APIFY_METAMORPH_AFTER_SLEEP_MILLIS
300e3
proxyHostname
APIFY_PROXY_HOSTNAME
'proxy.apify.com'
proxyPassword
APIFY_PROXY_PASSWORD
proxyPort
APIFY_PROXY_PORT
8000
proxyStatusUrl
APIFY_PROXY_STATUS_URL
'http://proxy.apify.com'
userId
APIFY_USER_ID
xvfb
APIFY_XVFB
chromeExecutablePath
APIFY_CHROME_EXECUTABLE_PATH
defaultBrowserPath
APIFY_DEFAULT_BROWSER_PATH