Solution Builder API

SPLauncher JavaScript Object

6min

Overview

For background information, see Basic Uploader.

The Basic Uploader JavaScript creates the SPLauncher JavaScript object, which you use to launch ScreenPal and commuicate with it.

You may pass it custom data and specify a callback. You may also set up a WebHook callback from ScreenPal servers to your servers when a recording is uploaded.

Start the Recorder

Include this in your JavaScript file: 

JS


Then call the SPLauncher.launch(...) function to start the recorder.

Custom Data and Callback

When you embed the JavaScript you can add some extra settings, using customData and callback as seen below:

JS


Setting a customData object with key/value pairs will save the data so it's passed back in the callback function and in JSON for the WebHook, if you have one defined.

Setting a callback function will allow you to receive a JavaScript callback after the ScreenPal Recorder is closed.  If a recording is uploaded, then the function will be called back with a JavaScript object containing details for the upload OR undefined if no recording was uploaded.  

When using the JavaScript callback, the end user should not navigate away from the page where the recorder is launched or else the JavaScript callback won't be called.

The JavaScript object will contain the following details:

JS


If you enabled the option to "Include links and embed tag in javascript callback", then you will also get links and an embed tag to what was uploaded:

JS


WebHook Callback

You can set up a WebHook callback so a POST request is made from the ScreenPal servers back to your servers when an upload is made.  You can supply either an HTTP or HTTPS URL, which can also be prefixed with a username and password for basic authentication like: username:password@http://.... The POST request will contain JSON with the same data provided in the JavaScript callback with all the links to the upload that was created like:

JS


If the system fails to post to your server then it will retry until it successfully posts.

SPLauncher Properties

When calling SPLauncher.launch(...), you may specify options using properties. See SPLauncher Properties for details on those properties.