Zero-Touch (SoundProof) JS SDK
Current Version: 0.2.6 (Change log)
Quick Start Guide
This guide will show you how to import and use the SoundProof JS SDK in four easy steps.
The instructions assume that your website (on which you wish to deploy SoundProof for authentication) is at
In order to use SoundProof in your page you need to first download the following files:
where “xxxxxx.futurae.com” is your Service hostname. Then, place these files under a common path under which they will be served by your server, for example:
soundproof.min.js in the page where SoundProof will be executed:
If the file is imported successfully, then the
soundproof namespace which includes all relevant functionality will become available to the page. Note that you must not explicitly import the rest of the JS files in your page using a
<script> tag. They will be fetched and loaded automatically by
Initialize the SoundProof object at page load, supplying the various callback functions in order to track various events during the authentication. You can also configure the base URL (which should be the Service hostname) as well as other optional parameters (see here for details). Here is an example on how to do it:
Start the SoundProof authentication step by providing the session_token that your backend server retrieved by calling Auth API’s /user/auth. This can be achieved with a variety of ways. For example, you can:
- use XHR or WebSocket, or
- place the
session_token is available you can call:
When SoundProof has been completed, you have to call Auth API’s /user/auth_status to get the final result of the authentication step (NOTE: the result of the authentication can only be retrieved by the backend API and not via the SoundProof JS SDK).
By implementing the SoundProof callbacks you can respond to any kind of event, e.g.
onError(). In order to retrieve the authentication step status, you can:
- wait for SP
onComplete()callback to be called and then make an XHR (or WebSocket send) to your backend server, which in turn makes the call to /user/auth_status. The latter will respond with a final status (allow, deny) once the final result is available.
- make an XHR (or WebSocket send) to your backend server, which in turn makes a synchronous call to /user/auth_status with
final_result=trueright after starting SP and wait for the response (using a deferred object or promise)