Configuration Options

The following properties are exposed as configuration options:

Required

  • authToken (string): Please see the authorization section for details on how to use this property. Not required if the apiKey and authEndpoint properties are used.

  • apiKey (string): Your API key as provided by Sybrin. Please see the authorization section for details on how to use this property. Not required if the authToken property is used.

  • authEndpoint (string): The endpoint that will be used to authorize. Only required when the integrationMode property is set to 0 (direct).

  • dataExtractionEndpoint (string): The endpoint that will be used to execute data extraction.

Optional

  • assetHeadersCallback (function): A callback function that may be used to modify the headers of the assets HTTP request. As parameters, this function provides the headers object before modification. The function expects the modified headers object to be returned.

  • authBodyCallback (function): A callback function that may be used to modify the body of the authorization API call. As parameters, this function provides the body object before modification. The function expects the modified body object to be returned.

  • authHeadersCallback (function): A callback function that may be used to modify the headers of the authorization API call. As parameters, this function provides the headers object before modification. The function expects the modified headers object to be returned.

  • authHttpMethod (string: GET | POST | PUT): Overrides the HTTP method type for the authorization API call.

  • blurThreshold (number): The threshold that the blur detection algorithm must pass for the image to be considered clear enough. A higher value is stricter. A lower value is less strict. Default 6.7

  • blurThresholdMobileModifier (number): The factor by which blur threshold is adjusted on mobile devices. A higher value makes blur detection stricter on mobile. Default 1.25.

  • cameraButtonDisplayIcon (boolean): Sets whether or not the manual capture button should display an icon. Only applicable while invoking the openScanDocument function if captureMode is provided as a value of 1 (manual) or 2 (semi-automatic).

  • cameraButtonDisplayText (boolean): Sets whether or not the manual capture button should display capture text. Only applicable while invoking the openScanDocument function if captureMode is provided as a value of 1 (manual) or 2 (semi-automatic).

  • dataExtractionBodyCallback (function): A callback function that may be used to modify the body of the data extraction API call. As parameters, this function provides the body object before modification as well as a SnapshotData object (please see Middleware section for more details). The function expects the modified body object to be returned.

  • dataExtractionHeadersCallback (function): A callback function that may be used to modify the headers of the data extraction API call. As parameters, this function provides the headers object before modification as well as a SnapshotData object (please see Middleware section for more details). The function expects the modified headers object to be returned.

  • dataExtractionHttpMethod (string: GET | POST | PUT): Overrides the HTTP method type for the data extraction API call.

  • debugInfoEndpoint (string): The endpoint that will be used to post debug information to upon using the upload debug info function.

  • encryptionKey (string): The 32-character AES encryption key that will be used for encrypting network traffic from the SDK to the backend API. This value must match the key used by the decryption algorithm in the backend.

  • videoInterval (number): The interval (in milliseconds) at which document detection should run on the video feed. Default 500.

  • instructionTextPosition (string: top | bottom | topandbottom): Location of the instruction text while the video feed is being processed. The default value is "topandbottom".

  • integrationMode (0 - direct | 1 - middleware): Sets how the web SDK integrates with backend services to extract document data. If you wish to use the companion API included with the SDK, or your own middleware implementation, please see the Middleware section. Default 0 (direct).

  • maxUploadFileSize (integer): The maximum size, in bytes, that uploaded files may be. Default 5242880

  • mediaStreamRetryCount (integer): The number of times that the SDK must retry gaining access to the camera if it fails the first time.

  • mediaStreamRetryDelay (integer): The duration that the SDK must wait before retrying gaining access to the camera if it fails the first time.

  • mediaStreamStartTimeout (integer): The time (in milliseconds) that the SDK is given to enable and hook onto the user's camera before it times out. The default value is 6000.

  • overexposedThreshold (number): The percentage of overexposed pixels that should be present for an image to be considered overexposed. Default 50.

  • overexposedValue (number): The grayscale RGB value (0-255) that a pixel's color must be larger than in order to be considered overexposed. Default 220.

  • recordDebugInfo (string: never | always | onerror | onsuccess): Sets whether and when debug info should be recorded for use by download or upload functionality. The default value is "never".

    • never: No debug info is ever recorded.

    • always: Debug info is recorded after every data extraction attempt.

    • onerror: Debug info is only recorded when an error occurs.

    • onsuccess: Debug info is only recorded on a successful data extraction.

  • samplesPath (string): Path to the samples used for document detection. Default "assets/samples"

  • showDebugOverlay (boolean): Sets whether or not the debug overlay should be shown.

  • takePictureDelay (number): The delay (in milliseconds) before the photo is taken once a document is detected in frame. Default 5000.

  • thresholdAdjustAmount (number): The amount by which blur threshold will be adjusted if face detection is taking a long time. Default value is 1.

  • thresholdAdjustFactor (number): The factor at which to apply the image matching threshold adjustment when it occurs. Default 0.8.

  • thresholdAdjustInterval (number): The interval (in milliseconds) at which to adjust the confidence threshold on the current document. Default 4000.

  • thresholdAdjustMaximum (number): The maximum amount that the image matching threshold may be adjusted by. Default 0.5.

  • tokenTimeout (number): The duration (in milliseconds) that a token is valid and will be reused for before a new authorization call is made. Default 120000.

  • underexposedThreshold (number): The percentage of underexposed pixels that should be present for an image to be considered underexposed. Default 40.

  • underexposedValue (number): The grayscale RGB value (0-255) that a pixel's color must be smaller than in order to be considered underexposed. Default 30.

  • useCutout (boolean): Sets whether or not the document cutout overlay must be displayed over the video feed. Default true.