Using github repo in apps script

641 Views Asked by At

I'm working with apps script and the plivo api (https://www.plivo.com/docs/sms/api/message#list-all-messages). I'd like to be able to use the plivo node sdk (https://www.plivo.com/docs/sdk/server/node-sdk/) inside apps script. Is there a way to install this or use this from github or some other source directly?

1

There are 1 best solutions below

0
On

Answer

In a summary you can't install or use plivo by using Apps Script.

You can use your own libraries or a shared library. Third party (external and not shared) libraries in Google Apps Script are not allowed directly.

As per the Google Apps Script documentation says Google Apps Script is a rapid application development platform that makes it fast and easy to create business applications that integrate with G Suite. Apps Script goal is mainly interact with other Google Services/APIs.

Why using third party libraries is not allowed/recommended?

It's possible to use the eval and UrlFetchApp.fetch() function in order to get the content of a specific JS and execute it like:

eval(UrlFetchApp.fetch('http://URL/javascript.js').getContentText());

However, it's adding more computing time when it comes to run an Apps Script and depending on your kind of user there's a limit to successfully execute a script.

External services like plivo or another VOIP services are not allowed due to the reasons I mentioned above. As a workaround I'd suggest to take a look into GCP products like App Engine or Compute Engine and make use of your third party library from there.