Google Apps script publishing addon for internal use

陌路散爱 提交于 2019-11-29 23:14:09

An Add-On can be published to be restricted to the domain/G Suite Account that the Apps Script file is in.

https://developers.google.com/apps-script/add-ons/publish

If the Add-on is not being published publicly, then it does not go through the approval process.

Add-ons must be published to the G Suite Marketplace, which means that you need to create a "standard" Google Cloud Project, associate it with your Apps Script project, and then enable the G Suite Marketplace SDK, and configure settings in the G Suite Marketplace SDK.

To get to your Google Cloud Platform dashboard, use the URL

https://console.cloud.google.com/home/dashboard

  • From "IAM and Admin" navigate to "Manage Resources"
  • If you don't have an organization name, then create an organization
  • Create a new GCP project
  • Get the GCP Project Number
  • Put the GCP Project Number into the Apps Script project
  • Navigate to the APIs and Services dashboard.
  • Make sure that the project that you want to use is listed in the drop down
  • Click "Enable APIs and Services"
  • Search for G Suite Marketplace
  • Enable the G Suite Marketplace SDK
  • Configure the G Suite Marketplace SDK

There is also the option to make an Apps Script project file available to other Apps Script projects as a "library." A library can be made available to other Apps Script projects, by providing the "project key" of the source Apps Script (library).

Whoever wants to use the source Apps Script file as a library needs the project key. To find the project key, from the code editor choose "File" - "Project Properties" and look for "Project key (Deprecated)"

To add an Apps Script file as a library, from the code editor, choose "Resources" - "Libraries". You don't need to do anything to create a Library. Every Apps Script project is available as a Library. All you need to do is share the Project Key.

You can add an "Add-On" menu item to a Google Spreadsheet or Doc, without publishing an Add-On, and that Add-On menu item will run any code that is in that document, just like an add on. But you would need to edit the document of every user you wanted to deploy the code to, and manually add the code to their document.

If the Apps Script file is not published as an add-on, then there's no point in creating an Add-On menu, since you can create a custom menu.

By selecting Publish > Deploy as Spreadsheets Add-on under the Script Editor, will create a new item under the Chrome Web Store. This item will be linked to your CWS developer account, and you can publish the item as 'private', or as a draft available to testers, so that only people internal to your domain can access it.

The upvoted answer is out of date. You can publish an add-on using G Suite Marketplace SDK which has its own "Integrate With Google" button in its configuration tab for local integration. See https://developers.google.com/gsuite/marketplace/sdk.

Google's help on the subject is decent enough, at https://developers.google.com/gsuite/add-ons/how-tos/publishing-editor-addons.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!