Cannot start publishing my Google App Script as Add-on - google-apps-script

I have created a Google App Script, which is bound to Document. But now I need to publish this script as an Add-on for our domain.
In order to publish the add-on, I have read the documentation below:
https://developers.google.com/apps-script/add-ons/publish#development_checklist
As described in this article, I registered a version of my script through "Manage Version".
But when I go to the "Publish" menu of the script editor, I only have the option "Deploy as web-app". I do not see any menu item "Deploy as add-on".
How can I start the publishing process for my App Script?

Before you can publish an add-on you must go through the application and review process:
https://developers.google.com/apps-script/add-ons/publish#apply_to_publish
The "Deploy as add-on" option will only appear after you are approved.

To deploy your add-on, you have to first get approval from the Apps Script Advisor. To do this you have to go to:
The Publishing Documentation
Then you have to fill out the Google Form there.
Hope this helps!
Notice: It might take a few weeks before they respond back to you!

The reason you are not able to see that "Deploy as add-on" option because, you might be opening the normal Apps script console(script.google.com).
But if you want to publish your script code as an add-on, you have to open the script editor from the Doc or sheet which is bound to the script.
Open the Doc, Tools--> Script editor.
Then go to Publish, now you can see an option for "Deploy as add-on".
Hope that helps!

Related

How can I "publish" an editor add-on to be used by just me?

I'm involved in a standards development group where the meeting invitations are sent out, not as calendar invites, but as Word docs. I've written a script that allows me to take the Word doc uploaded to Google Drive, and run the script to create an entry on a Google calendar that I maintain.
At the moment, the script is unpublished, and to run it on the docs I use the "Test as Add-On" function from the script editor. That's a bit cumbersome because I have to go through the selection dialog to select the doc I want to run it on. Additionally, in the new scripts editor, it won't be possible to delete old tests and so my test dialog will end up getting filled up with every run of the script I've ever carried out.
It would be much better if I could have the script available to me, and me only, from the Extensions->Add-Ons menu when I open a doc. The script is not suitable for general publication: it works only on docs with the exact format of these meeting notices, so it should only be run by someone who knows what they're doing, and it accesses a calendar that I own, so I don't want to make it public. But I would like to be able to put it into some kind of "deployed" state so that, as I say, when I open any doc when I'm logged in as me, the script is just available directly from the Add-Ons menu.
Is there any way to achieve this? Or is there an alternative approach possible to this general problem, of having a script that you want to run on multiple documents that you own without having to formally publish it?
One option to "test as add-on" without publishing the script as an editor add-on, is to use installable triggers instead of simple triggers. This triggers should be created by using code in order to avoid having to add any code to each spreadsheet.
If you are determined to take the publishing path you can set your add-on listing to be "unlisted", this means that the add-on will not appear on the Google Workspace Marketplace, people will need to know the installation URL to be able to install the add-on.
Other options:
If you have a Google Workspace account you could publish the add-on privately for your domain. If you don't have this account type or if this is "not good enough", you might make your Google Apps Script add-on publicly installable but limit its core features to be used only by you by making use of a dynamic custom menu. For details please checkout Editor add-on authorization
The dynamic custom menu might based on a setting depending on the user email address. To make this work, as the Session.getActiveUser() requires authorization to run, it can't be executed by simple triggers, but you might implement a workflow to save it or a flag, i.e. add an option to the custom menu to initialize the editor add-on.
Another option is to make the dynamic custom menu based on the spreadsheet structure and/or content.
References
Installable Triggers
Enable and configure the Google Workspace Marketplace SDK
Related
Google Apps Script: Dynamically creating spreadsheet menu items
Publish an add-on privately

Publish Sheet add-on always shows dialog "Go to the G Suite Marketplace SDK..."

I have configured the "Google Workspace Marketplace SDK" configuration panel. My app is internal to my organization domain, hopefully won't need any OAuth review nor the app preview.
When I click the Publish-->Deploy as add-on
it always shows a dialog box
Go to the G Suite Marketplace SDK. If you are publishing a new add-on follow this guide. To update an existing add-on follow these steps.
I have connected my Apps Script with GCP standard project, configured the scopes everywhere.
Who can tell me what to do next steps? I want to to publish an internal (private use only) add-on.
Btw, the "G Suite Marketplace API" doesn't have a place to configure apps publication, I did it from the "Google Workspace Marketplace SDK". They are super confusing names...
After you finished your "App Configuration" screen for Google Workspace Marketplace SDK (which is opened by default when you click "open SDK" link from Apps Script editor) you also need to make sure your listing is created - this may need to be done just once on initial add-on publishing.
Click on "Store Listing", make sure you filled all required sections, and submit the form.
After successful form submit you will be able to see your listing status:

How to easily publish add-on to avoid re-authorization request for a copied Spreadsheet?

I have created a Google Sheet that uses some very simple lines of script (made with Tools --> Script editor inside the Sheet). The script only adds simple functionalities, e.g. to click some buttons or extract the Sheet's filename. Now, the workflow in my company is to make a copy of the main Sheet, and work in the copied version. However, when I call the script in the copied version (e.g. by clicking a button) each time an authorization request is shown. I want to avoid this request. Only 1 user needs the funcionality.
I know that this problem can be solved by publishing my script as an add-on (see How to avoid re-authorization request for a copied Google Spreadsheet + script). When publishing the script I am prompted to create a "User-managed Cloud Platform project". Tried this, but I have zero experience with cloud platform projects, OAuth, JavaScript or whatsoever.
Is there any tutorial or simple explanation available for publishing an add-on to solve this (relatively simple) problem? Or should I not even try without any experience?
Help is much appreciated!
To create a Cloud project you just have to go to https://console.developers.google.com -> click create project -> Fill the project info and click in create button [1]. The add-on can help you with your simple problem if you install the add-on for the entire domain so the add-on will be automatically installed in the Spreadsheet App without the need of the authorization request. Here you have some documentation on how to publish your add-on [2][3] and install it for domain-wide [4].
[1] https://cloud.google.com/resource-manager/docs/creating-managing-projects
[2] https://developers.google.com/gsuite/add-ons/how-tos/publishing-editor-addons
[3] https://ctrlq.org/google.apps.script/docs/add-ons/domain-wide.html
[4] https://support.google.com/a/answer/172482

Publish an add-on from Standalone Google Apps script

I have developed a google sheet addon, I had succefully published that add-on from Google sheet bound script ie from tools->Script editor.
But If I made direct google apps script project(standalone project),I am unable to publish it,And a notification is popped up.
I research that I need it to setup it from google console,to publish standalone google app script to add-on ,But I don't found exact options to proceed.
The instruction is a very confusing for a first timer. Google keeps redirecting you to the page describing publishing editor addons, but what you really need is the page describing how to create a project on cloud platform.
https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project
Steps:
Create Project and get Project Number using instructions from link above
Go to you script. Select in the menu Resources > Cloud Platform projects... and enter your project number there
Then google will ask you to setup OAuth
After that, you can move your script to cloud platform and publish.
To publish an addon for G Suite Document editors follow the instructions here
https://developers.google.com/gsuite/add-ons/how-tos/publishing-editor-addons
The specific part about the GCP project is
Technical
The add-on script project must use a standard Cloud Platform (GCP) project. If the script project currently uses a default GCP project, you must switch to a standard GCP project. All collaborators working on the add-on should have access to the standard GCP project.

What happened to the "Publish to Gallery" option in Google Apps Script?

The Google Apps Script documentation claims:
"With the script loaded in the script editor click Publish > Publish to Gallery in the menu bar."
After starting a new script (for spreadsheets) project, I attempted to publish to the gallery. But there is no such option:
Was it recently removed? Do I need to change a setting somewhere?
I don't think it's available on Google Apps / business accounts. I've had to make a copy to a consumer account, then publish.