Configuration
Hierarchy
- Configuration
- Configuration
Index
Constructors
externalconstructor
Creates new
Configurationinstance with provided options. Env vars will have precedence over those.Parameters
externaloptionaloptions: ConfigurationOptions
Returns Configuration
Properties
staticoptionalglobalConfig
Methods
get
Type parameters
- T: keyof ConfigurationOptions
- U: undefined | string | number | boolean | Dictionary<any> | StorageClient | EventManager | (radix) => string | (fractionDigits) => string | (fractionDigits) => string | (precision) => string | () => number | ({ (locales, options): string; (locales, options): 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
Configurationinstance, the value will not be propagated down to the env var. To reset a value, we can omit thevalueargument or passundefinedthere.Parameters
externalkey: keyof ConfigurationOptions
externaloptionalvalue: any
Returns void
staticexternaluseStorageClient
Parameters
externalclient: StorageClient
Returns void
Configurationis a value object holding the SDK configuration. We can use it in two ways:Actorclass, we can get the instance configuration viasdk.configSupported Configuration Options
memoryMbytesACTOR_MEMORY_MBYTESheadlessAPIFY_HEADLESSpersistStateIntervalMillisAPIFY_PERSIST_STATE_INTERVAL_MILLIS60e3tokenAPIFY_TOKENisAtHomeAPIFY_IS_AT_HOMEdefaultDatasetIdACTOR_DEFAULT_DATASET_ID'default'defaultKeyValueStoreIdACTOR_DEFAULT_KEY_VALUE_STORE_ID'default'defaultRequestQueueIdACTOR_DEFAULT_REQUEST_QUEUE_ID'default'Advanced Configuration Options
actorEventsWsUrlACTOR_EVENTS_WEBSOCKET_URLactorIdACTOR_IDactorRunIdACTOR_RUN_IDactorTaskIdACTOR_TASK_IDapiBaseUrlAPIFY_API_BASE_URL'https://api.apify.com'containerPortACTOR_WEB_SERVER_PORT4321containerUrlACTOR_WEB_SERVER_URL'http://localhost:4321'inputKeyACTOR_INPUT_KEY'INPUT'metamorphAfterSleepMillisAPIFY_METAMORPH_AFTER_SLEEP_MILLIS300e3proxyHostnameAPIFY_PROXY_HOSTNAME'proxy.apify.com'proxyPasswordAPIFY_PROXY_PASSWORDproxyPortAPIFY_PROXY_PORT8000proxyStatusUrlAPIFY_PROXY_STATUS_URL'http://proxy.apify.com'userIdAPIFY_USER_IDxvfbAPIFY_XVFBchromeExecutablePathAPIFY_CHROME_EXECUTABLE_PATHdefaultBrowserPathAPIFY_DEFAULT_BROWSER_PATH