r/GoogleAppsScript • u/imthenachoman • Aug 12 '23
Guide How To Guide - Developing a GAS Powered Google Workspace Add-on And Launching It To The Marketplace
A while ago I started developing my first GAS powered Google Workspace add-on and I documented what I learned in a how-to guide. I'm sharing here in case folks find it helpful.
https://gist.github.com/imthenachoman/6cff4a1170390f01c15d4da87110124a
2
u/lydiastepanek Aug 15 '23
But, again, start with building your add-on in GAS and if you hit a wall, you can move to your on backend.
Are there any tutorials out there about how to move app scripts code to your own backend? I haven't found any
1
u/imthenachoman Aug 15 '23
You can't move apps script code to your own backend. Google does not provide the GAS code.
You'll have to rewrite your code and do what your GAS project does by making Google API calls.
2
u/lydiastepanek Aug 15 '23
I don't see how moving to making API calls would get around the service quotas though? At the end of the day, if you're using the app scripts interface or your own backend API to manage your app scripts service, you're still gonna hit the same quotas, right?
1
u/imthenachoman Aug 15 '23
Sure. But if you use your own backend, you have to manage the server/compute. That means patching and securing. With GAS you don't have to worry about any of that.
So I always use GAS when I can cause I don't have to fuck with managing a server. But that only works if the work you want to do can be done all in GAS. Say you wanted to make an add-on that resized an image and you didn't want to use some online API for this. You'd have to have a backend server you could use to "download" the image and then resize and then send back.
Plus, I guess some Google Cloud functions don't work well in GAS but I don't have much experience with those yet.
2
u/lydiastepanek Aug 17 '23
I started building a Gmail Addon in Cloud Functions yesterday (used this tutorial for reference), it was not so bad. No servers or containers to manage (and the tutorial shows you how to write the Dockerfile needed for cloud functions` container management)
1
u/imthenachoman Aug 18 '23
Creating a project in GCP is not something end-users can do in enterprise orgs that take security very seriously. There is a huge uplift in using GCP/GCF/etc.
That is why GAS is so brilliant. Anyone can start solving a problem instantly.
2
u/lydiastepanek Aug 18 '23
Doesn't GAS pose the same security risks as GCP, in that you're hosting your code on someone else's infrastructure that you can't control? Genuinely curious why GAS is less of a security threat than GCP
2
u/imthenachoman Aug 22 '23
You need certain privilegs to be able to create a GCP project. That means more admin work for the admin team. For any enterprise org using Google Workspace, it can be a heavy lift for someone get a GCP project.
GAS, they can hit the ground running as soon as they have an idea.
I am not a G admin so I don't know the details but I've been told by my security folks that GCP does create some unique security challenges. I don't know what they are though...
3
u/dimudesigns Aug 16 '23 edited Aug 16 '23
I don't see how moving to making API calls would get around the service quotas though?
Services quotas will remain the same for the most part. But for the limitations inherent to GAS, you can make major gains moving to an enterprise-grade Google product
App Script has a 6 minute execution quota per invocation. Cloud Functions (an enterprise-grade Google product that you can use to build out your own backend API) gives you up to an hour.
App Script time-based triggered script executions max out at 90 minutes (cumulative runtime) per day. Cloud Scheduler and Cloud Task (enterprise-grade Google products) don't have that limitation, and they are more precise (App Script time-based triggers have a 15 minute margin of error in some scenarios).
Apps Script URLFetchApp payload is limited to around 50MB, Cloud Functions allow you to provision Terabyte scale memory - not free though.
And more.
2
u/lydiastepanek Aug 16 '23
I'm new to Google Cloud, so maybe this is a dumb question, but are there any *good* tutorials about building Google Addons using Cloud Functions? I've found the App Scripts tutorials to be hit or miss.
(I'm used to AWS where there's a tutorial for everything.)
3
u/dimudesigns Aug 16 '23
2
u/lydiastepanek Aug 16 '23 edited Aug 17 '23
Ah thank you!
Whoops, totally did this one last week and promptly forgot about it. (I'm trying to remember, I think I moved on to another one because I couldn't figure out how to import the CardService dependency into my cloud function...)
EDIT: Now I see some tutorials have code examples for Node.js runtimes that can be used inside Google Cloud Functions (woohoo!): https://developers.google.com/workspace/add-ons/guides/preview-links-smart-chips#node.js_2
2
u/lydiastepanek Oct 30 '23
How did you get the Google Trust & Safety team to reply to your emails about your case?
(FWIW here's some back story on my app submission, it's been 15+ days since I submitted:
https://stackoverflow.com/questions/77370022/how-long-does-it-take-the-google-trust-and-safety-team-to-do-oauth-scope-review)
1
u/imthenachoman Oct 30 '23
I didn't do anything special. I just kept following up by email. What is the address you're sending to?
2
u/lydiastepanek Oct 30 '23
I emailed api-oauth-dev-verification-reply+<case_id>@google.com and [email protected] :(
1
u/imthenachoman Oct 31 '23
Yeah, I just replied to them. Sometimes it took them a few days but never more than 2 weeks. I wish there was an easier way to reach support.
2
2
2
u/dimudesigns Aug 12 '23
GAS is good (up to a point) - but once you start using GCP Cloud Functions for Add-on development (look into alternate runtimes), GAS loses a lot of its luster...