From time to time we see a need to use parameters that should be received from an external source and/or to be shared with other systems. The following code sample demonstrates how we read a URL from external DB and use it in the test script.
For this sample, we use Firebase DB with an entry called ‘url’.
client.rtcActivateWebhook("https://[Firebase-account].firebaseio.com/url.json", function(url) {
// Remove quotes from the url string
url = url.substr(1,url.length -2);
client.rtcInfo('Received URL using rtcActivateWebhook. url = ' + url);
// Go to the received URL
client.url(url);
})
Code language: JavaScript (javascript)