\r\n

51Degrees Device Detection Node.js  4.4

51Degrees Device Detection for Node.js

DeviceDetectionPipelineBuilder Class Reference

Detailed Description

Examples
gettingStarted.js.

Inheritance diagram for DeviceDetectionPipelineBuilder:

[legend]

Collaboration diagram for DeviceDetectionPipelineBuilder:

[legend]

Public Member Functions

 constructor ({ licenceKeys=null, dataFile=null, autoUpdate=true, fileSystemWatcher=true, pollingInterval=30, updateTimeMaximumRandomisation=10, shareUsage=true, resourceKey=null, cacheSize=null, restrictedProperties, performanceProfile='LowMemory', updateMatchedUserAgent=false, maxMatchedUserAgentLength, drift, difference, allowUnmatched=false, usePredictiveGraph=true, usePerformanceGraph=false, updateOnStart=false, cloudEndPoint=null, cloudRequestOrigin=null })
Extension of pipelineBuilder class that allows for the quick generation of a device detection pipeline. More...

Member Function Documentation

◆ constructor()

DeviceDetectionPipelineBuilder::constructor (   { licenceKeys=null, dataFile=null, autoUpdate=true, fileSystemWatcher=true, pollingInterval=30, updateTimeMaximumRandomisation=10, shareUsage=true, resourceKey=null, cacheSize=null, restrictedProperties, performanceProfile='LowMemory', updateMatchedUserAgent=false, maxMatchedUserAgentLength, drift, difference, allowUnmatched=false, usePredictiveGraph=true, usePerformanceGraph=false, updateOnStart=false, cloudEndPoint=null, cloudRequestOrigin=null } )
inline

Extension of pipelineBuilder class that allows for the quick generation of a device detection pipeline.

Adds share usage, caching and toggles between on premise and cloud with simple paramater changes

Parameters
{object} - options the options for the pipeline builder
{string} - options.licenceKeys license key(s) used by the data file update service. A key can be obtained from the 51Degrees website: https://51degrees.com/pricing. This parameter MUST be set when using a data file. If you do not wish to use a key then you can specify an empty string, but this will cause automatic updates to be disabled.
{string} - options.resourceKey resourceKey, if using the cloud engine
{string} - options.dataFile dataFile path for the on premise engine
{boolean} - options.autoUpdate whether to autoUpdate the dataFile
{number} - options.pollingInterval How often to poll for updates to the datafile (minutes)
{number} - options.updateTimeMaximumRandomisation Maximum randomisation offset in seconds to polling time interval
{boolean} - options.fileSystemWatcher whether to monitor the datafile path for changes
{boolean} - options.updateOnStart whether to download / update a dataFile to the path specified in options.dataFile on start
{boolean} - options.shareUsage whether to include the share usage element
{number} - options.cacheSize size of the default cache (includes cache if set). NOTE: This is not supported for on-premise engine.
{Array} - options.restrictedProperties This setting only affects on-premise engines, not cloud. list of properties the engine will be restricted to
{string} - options.performanceProfile used to control the tradeoff between performance and system memory usage (Only applies to on-premise, not cloud) options are: LowMemory, MaxPerformance, Balanced, BalancedTemp, HighPerformance
{boolean} - options.updateMatchedUserAgent This setting only affects on-premise engines, not cloud. True if the detection should record the matched characters from the target User-Agent
{number} - options.maxMatchedUserAgentLength This setting only affects on-premise engines, not cloud. Number of characters to consider in the matched User-Agent. Ignored if updateMatchedUserAgent is false
{number} - options.drift This setting only affects on-premise engines, not cloud. Set maximum drift in hash position to allow when processing HTTP headers.
{number} - options.difference This setting only affects on-premise engines, not cloud. Set the maximum difference to allow when processing HTTP headers. The difference is the difference in hash value between the hash that was found, and the hash that is being searched for. By default this is 0.
{string} - options.allowUnmatched This setting only affects on-premise engines, not cloud. If set to false, a non-matching User-Agent will result in properties without set values. If set to true, a non-matching User-Agent will cause the 'default profiles' to be returned. This means that properties will always have values (i.e. no need to check .HasValue) but some may be inaccurate. By default, this is false.
{boolean} - options.usePredictiveGraph This setting on affects on-premise engines, not cloud. True, the engine will use the predictive optimized graph to in detections.
{boolean} - options.usePerformanceGraph This setting on affects on-premise engines, not cloud. True, the engine will use the performance optimized graph to in detections.
{string} - options.cloudEndPoint This setting only affects cloud engine, not on-premise. Choose a non default endpoint for the cloud request engine
{string} - options.cloudRequestOrigin This setting only affects cloud engine, not on-premise. Set the value to use for the Origin header when making requests to the cloud service.