Adding javascript libraries to a script so that it can use them

This will be available in the next release, due out in a few days. Any script will be able to include other custom scripts. As an example say my-lib.js is your library script, a custom script on your dsp.

// my-lib.js
function myFunction() {
    return true;
}

Your script can then include that library.

var result;

try
{
    eval(include('my-lib.js'));
    result = 'myFunction() available: ' + myFunction();
} 

catch (_ex )
{
    result = 'myFunction() is NOT available: ' + _ex.message;
}

return result;
2 Likes