Client Class
DeviceAtlas Cloud API.
This client library can be used to easily get device data from the DeviceAtlas Cloud service. To reduce cloud calls and improve performance the API locally caches the data returned from the cloud service. This API caches data in memory and on the disk.
Constructor
Item Index
Methods
getProperties
-
headers
-
[clientSideString]
Gets the device data for the provided headers and Client-side string from DeviceAtlas Cloud.
Once data has been returned from DeviceAtlas Cloud it can be cached locally to speed up subsequent requests. If device data provided by "DeviceAtlas Client Side Component" exists in a cookie then cloud data will be merged with the cookie data.
If en error occurs during device identification the returned object will contain an "error" key e.g.
{"error": "Error message"}
Parameters:
-
headers
Object.A set of HTTP headers
-
[clientSideString]
String optionalA client-side component string
Returns:
A promise that contains a list of detected properties.
getPropertiesFromRequest
-
request
Gets the device data for the provided request from DeviceAtlas Cloud.
Once data has been returned from DeviceAtlas Cloud it can be cached locally to speed up subsequent requests. If device data provided by "DeviceAtlas Client Side Component" exists in a cookie then cloud data will be merged with the cookie data.
If en error occurs during device identification the returned object will contain an "error" key e.g.
{"error": "Error message"}
Parameters:
-
request
RequestA request object
Returns:
A promise that contains a list of detected properties.
getVersion
()
Gets the API version.
Returns:
string