API Docs for: 2.0.1
Show:

Config Class

DeviceAtlas Cloud API configuration. An instance of this class must be created with the licence key and passed into the Client instance. This class provides setter methods to change the default client behaviour.

Constructor

Config

(
  • licenceKey
)

Parameters:

  • licenceKey String

Methods

cacheDirectory

()

A directory used by the file cache.

cacheDirectory

(
  • cacheDirectory
)

Sets a directory for the file cache.

The default directory is the system's temporary directory.

Parameters:

  • cacheDirectory String

cacheExpirySeconds

() Number

Returns the time (in seconds) that items remain cached for.

Returns:

Number:

cacheExpirySeconds

(
  • cacheExpirySeconds
)

Sets the time (in seconds) that items remain cached for.

The default cache expiry is 30 days (2592000 seconds).

Parameters:

  • cacheExpirySeconds Number

cookieName

() String

Returns the name of the cookie where the client-side properties are located.

Returns:

String:

cookieName

(
  • cookieName
)

Sets the name of the cookie where the client-side properties are located. The default cookie name is DAPROPS.

For additional information, please see the Client-side Component documentation at:

https://docs.deviceatlas.com/apis/clientside/latest/README.ClientSide.html.

Parameters:

  • cookieName String

licenceKey

()

Returns a licence key which was used to initialize the Config.

timeoutSeconds

() Number

Returns the timeout in seconds allowed for the Cloud API connections.

Returns:

Number:

timeoutSeconds

(
  • timeoutSeconds
)

Sets the timeout (in seconds) to allow to obtain the device properties from the Cloud API endpoint.

The default timeout is 2 seconds.

Parameters:

  • timeoutSeconds Number

useCache

()

Returns true if the in-memory cache is used.

useCache

(
  • useCache
)

Turns on/off the in-memory cache.

The in-memory cache is enabled by default.

Parameters:

  • useCache Boolean

useFileCache

()

Returns true if the file cache is used.

useFileCache

(
  • useFileCache
)

Turns on/off the file cache.

The file cache is enabled by default.

Parameters:

  • useFileCache Boolean