Search code examples
google-apps-scriptgoogle-cloud-platformgoogle-oauthadd-on

Testing the installation of an unpublished Apps Script add-on


I'm developing a container-bound Apps Script add-on. I need to demonstrate the installation process as part of the OAuth verification process. I can't publish my add-on without OAuth verification, and there doesn't seem to be any other way to demonstrate the installation.

Some options I've considered are:

  • Publishing as a private add-on. However this isn't an available option for me. It's not visible in my console, possibly because I've already set it as a public add-on and the link above indicates it's not possible to change visibility
  • Installing an unpublished addon-on. This also doesn't seem to work, possibly because my script is container-bound, or for some other reason. I can share the script with other accounts, but they're unable to install it; they have no visible installation button.

So I feel like I'm caught in an unfortunate loop whereby I can never get my app verified without it already being verified.


Solution

  • Actually it turns out I was able to do this without publishing it at all. Following @TheMaster's advice, I created a new standalone Apps Script project, and then copied all the code from my previous add-on.

    Then, I ran Run → Test as Add-on in the Apps Script IDE, chose a spreadsheet to test it in, and clicked on the add-on menu. Note: you have to actually click an add-on menu item, the authorization screen won't appear before then.

    This time, because the add-on is now standalone, this prompted me to authorize, which looked like this: enter image description here

    At this point if you start recording, it shows the required authorization prompts, including the client ID in the window URL bar. I submitted this video for Google's OAuth verification and they accepted it, so it looks like this is the easiest way.