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
staticoptionalglobalConfig
Methods
get
Type parameters
- T: keyof ConfigurationOptions
- U: undefined | string | number | boolean | StorageClient | EventManager | Dictionary<any> | (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
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
APIFY_MEMORY_MBYTES
headless
APIFY_HEADLESS
persistStateIntervalMillis
APIFY_PERSIST_STATE_INTERVAL_MILLIS
60e3
token
APIFY_TOKEN
isAtHome
APIFY_IS_AT_HOME
defaultDatasetId
APIFY_DEFAULT_DATASET_ID
'default'
defaultKeyValueStoreId
APIFY_DEFAULT_KEY_VALUE_STORE_ID
'default'
defaultRequestQueueId
APIFY_DEFAULT_REQUEST_QUEUE_ID
'default'
Advanced Configuration Options
actorEventsWsUrl
APIFY_ACTOR_EVENTS_WS_URL
actorId
APIFY_ACTOR_ID
actorRunId
APIFY_ACTOR_RUN_ID
actorTaskId
APIFY_ACTOR_TASK_ID
apiBaseUrl
APIFY_API_BASE_URL
'https://api.apify.com'
containerPort
APIFY_CONTAINER_PORT
4321
containerUrl
APIFY_CONTAINER_URL
'http://localhost:4321'
inputKey
APIFY_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