Web apps built with Apps Script can be distributed in the G Suite Marketplace, where G Suite domain administrators can find, install and authorize them for all or some users in their domains.
This section lists a number of considerations and details that you should address when you distribute a web app.
Team ownership of the web app
If you are building the web app as part of a team, think carefully about which account you want to publish from. Collaborating with Team Drives is recommended. Alternatively, you may wish to create a common team account to serve as the owner of the script project. Avoid situations where you lose access to your add-on's code and console settings because a member of your team left your organization.
Changing web app ownership across domains
Web apps deployed in one domain cease to function if their ownership changes to a Team Drive or account in a different domain. This can be corrected by having the new owner or collaborator redeploy the web app in the new domain. Alternatively, if the web app is moved back to its original domain the web app will start functioning again for that domain without redeploying.
Steps to prepare for distribution
Prior to distributing, you should:
- Ensure your web app is in good working order and is complete — works in progress should not be published.
- Make sure the web app meets the requirements for web apps.
- Create the following graphic assets; be sure to follow the Chrome Web Store image guidelines when creating them:
- You will also be asked for the following icons; if you provide an icon of a
different size it will be resized for you:
- a 32x32-pixel app icon
- a 48x48-pixel app icon
- a 96x96-pixel app icon
- Make sure to have a URL pointing to a terms of service page for your web app; this will be presented with your web app entry in the G Suite Marketplace.
Domain-wide distribution instructions
Domain-wide distribution requires configuring the G Suite Marketplace SDK for your web app. In order to do this, you must have access to the Cloud Platform project the add-on uses, which may not be the case if the script resides in Team Drive. If necessary you can switch your script to use a standard Cloud Platform project that you can access.
In addition, domain-wide distribution also requires a manual modification of the web app's Chrome Web Store manifest and republication before it can be installed by G Suite domain admins. The full procedure is outlined in the steps below.
Configure the G Suite Marketplace SDK
- If you have not done so already, distribute your web app to the Chrome Web Store. When filling out the Edit Item form, make sure the Visibility options is set to Private.
- Open your web app script in the Apps Script editor.
- Click Resources > Cloud Platform project. In the dialog that appears, click the name of the project your script is associated with.
- In the console's left navigation, expand the section APIs & auth and click APIs.
- In the filter box, type "marketplace", then click G Suite Marketplace SDK (not the API) once you see it.
- On the next screen, click Enable API.
- You may be prompted to accept the Google APIs Terms of Service and the G Suite Marketplace SDK Terms of Service Read the terms carefully, then check the box and click Accept.
- Once the G Suite Marketplace SDK has been enabled, click the Configuration tab. This will open the SDK configuration form.
- In this form enter the following:
- the Application Description
- the four Application Icons (they will be automatically resized if needed)
- a Terms of Service URL that points to terms of service documentation for your web app.
- Under Extensions, check the Enable Universal Navigation extension
box. This will bring up a text field for your web app's URL. You can find
this URL in the script editor:
- Click Publish > Deploy as web app.
- Copy the URL listed under Current web app URL.
- Paste this URL into the Universal Navigation extension field.
- Click Save changes at the bottom of the console.
Download and edit the web app manifest file
- Open the Chrome Web Store Developer Dashboard.
- Find the entry for the web app. On the right side of the entry, click More info.
- In the small window that opens, click main.crx next to the Download label to download the web app manifest and associated files (in a compressed archive).
- Move the downloaded .crx file to an empty working directory.
- Uncompress the .crx file as you would a .zip file (on most Linux machines you
can do this with the command
unzip; you may need to rename the file to have a .zip extension first). It will inflate into several files, including "manifest.json".
- Open "manifest.json" in a text editor. You can add additional whitespace to make this file more readable, but be careful not to change the text.
- Increment the value for the
- Add the following top-level key:
- Add the following top-level key:
"api_console_project_id": "your_web_app_project_number". Your web app project number can be found through the script editor:
- In the script editor, select Resources > Cloud Platform project.
- In the dialog that appears, click the name of the project your script is associated with.
- In the new window that opens, click the down arrow next to the project's ID. The console will then show your Project number, which consists only of numerals.
- Copy this project number into the "manifest.json" file as the
api_console_project_id. Close the window.
- The manifest file should now have a structure similar to the manifest file documentation. Verify that the structure matches and save the file.
Upload the edited manifest and republish
- Create a new "updated.zip" file, containing all the original files and your updated manifest. Do not include the original .zip or .crx file.
- In the Chrome Web Store Developer Dashboard, find the entry for your web app. On the right side of the entry, click Edit. This will open the Edit Item form you filled out previously.
- Under Upload, click the Upload Updated Package button.
- In the new window, click the Choose file button. Find the "updated.zip" file you created and select it. Click Open.
- Click the Upload button.
- If there are any problems with your manifest file, you will be alerted to them now. Correct any problem and repeat the file upload steps.
- When the upload completes correctly, you will be taken back to the Edit Item form. Click the Publish changes button at the bottom.
- Visit the Chrome Web Store developer dashboard to see the status of your web app. Note that the publication process can take up to an hour to finish. Note that the Status column will now have two items, indicating the publication status, one for the Chrome Web Store and another the G Suite Marketplace. When both read as "Published", you're done!
Install a published web app for a domain
To install the published web app on for all users in a G Suite domain, see this support article. Note that only an administrator can install an app for all users in the domain.