The SoundProof Object
This page describes the SoundProof object, which is the object which has to be instantiated when performing SoundProof authentication. It is defined in the soundproof namespace.
|version||string||The version of the SoundProof JS library.|
Initialize a SoundProof authentication process.
|config||Object||An object containing configuration properties and callback functions, which are triggered upon various events during the SoundProof authentication process.|
|config.baseURL||string||Optional. The base URL of the Futurae server backend to which the SoundProof object should connect to. Default value is “https://api.futurae.com”.|
|config.audio.deviceId||string||Optional. A string specifying the device Id which is required to be used as a microphone input for SoundProof. See MediaDevices.enumerateDevices() for information on how to enumerate devices and select a specific device. Omitting this param makes SoundProof try to heuristically find and use the builtin microphone, if possible, or fallback to the default system input. Specify “default” to force use of default system input.|
|config.callback.onAudioInitSuccess||onAudioInitSuccess||Optional. Called once the browser audio recording interface has been initialized successfully.|
|config.callback.onComplete||onComplete||Optional. Called once SoundProof authentication has been completed.|
|config.callback.onDeviceTimeout||onDeviceTimeout||Optional. Called if the user's device cannot be activated remotely in order to perform SoundProof within a reasonably short amount of time. This callback will be immediately followed by more callbacks about the status of the authentication attempt.|
|config.callback.onError||onError||Optional. Called if there is an error during SoundProof authentication. Note that depending on the error, SoundProof may or may not continue.|
|config.callback.onNewDeviceMustApprove||onNewDeviceMustApprove||Optional. Called if SoundProof failed because the user is logging in for the first time from this browser, and he must manually approve the login (see “new_device_must_approve” param in /user/auth endpoint of the Futurae Auth API).|
|config.callback.onRecordingStart||onRecordingStart||Optional. Called when SoundProof starts recording audio.|
|config.callback.onRecordingEnd||onRecordingEnd||Optional. Called when SoundProof finishes recording audio.|
|config.callback.onRecordingTooSilent||onRecordingTooSilent||Optional. Called if SoundProof detects that there is not enough audio energy in the environment.|
|config.callback.onRetry||onRetry||Optional. Called if the audio comparison fails for some reason and SoundProof automatically retries (one or maximum two times).|
|config.callback.onSoundProofFailed||onSoundProofFailed||Optional. Called if SoundProof fails while performed with the approve combo enabled.|
|config.callback.onTimeout||onTimeout||Optional. Called if SoundProof times out before the protocol has been completed.|
|config.socket.transports||array||Optional. SoundProof makes use of SockJS in order to establish a WebSocket connection with the Futurae server. SockJS supports a number of fallback transports in case a WebSocket is not feasible. This option allows you to supply a list transports that may be used by SockJS. By default all available transports will be used. For example, by specifying [‘xhr-streaming’, ‘xhr-polling’] you allow only XHR-based transports. For more information see also https://github.com/sockjs/sockjs-client.|
Start the SoundProof authentication process.
Kind: instance method of SoundProof
|sessionToken||string||The session token, which is retrieved by calling the /user/auth_prep endpoint of the Auth API in the backend.|
Check browser support. Returns the result in a callback.
Kind: static method of SoundProof
|cb||checkSupportCallback||A callback with the result of the SoundProof support check.|