Editor manifest resource

The resource configuration that is used to define Google Workspace add-on content and behavior within the editors. Google Workspace add-on manifests must have all the components marked as Required if they extend the Editor.

Editors

The Google Workspace add-on manifest configuration for Editor extensions. See Extending Editors with Google Workspace add-ons for more information.

JSON representation
  {
    "homepageTrigger": {
      object (HomepageTrigger)
    },
    "onFileScopeGrantedTrigger": {
      object (OnFileScopeGrantedTrigger)
    },
    "linkPreviewTriggers": [
      {
        object (LinkPreviewTriggers)
      }
    ],
    "createActionTriggers": [
      {
        object (CreateActionTriggers)
      }
  }
Fields
homepageTrigger

object (HomepageTrigger)

This trigger function creates the add-on homepage in the host app. This overrides addOns.common.homepageTrigger.

onFileScopeGrantedTrigger

object (OnFileScopeGrantedTrigger)

Required if your add-on includes behavior specific to the current Editor document, triggered when the user authorizes the drive.file scope.

linkPreviewTriggers[]

object (LinkPreviewTriggers)

Required for link previews. A list of triggers for previewing links in a Google Docs, Sheets or Slides file. For details, see Preview links with smart chips.

createActionTriggers[]

object (createActionTriggers)

Required for third-party resource creation. A list of triggers for creating resources in a third-party service from the @ menu. For details, see Create third-party resources with smart chips.

OnFileScopeGrantedTrigger

A configuration for a contextual trigger that fires when the request file scope dialog using CardService.newEditorFileScopeActionResponseBuilder() .requestFileScopeForActiveDocument().build(); and the user grants drive.file scope authorization.

JSON representation
{
  "runFunction": string
}
Fields
runFunction

string

The name of the function to run if drive.file scope is granted. If specified, you must implement this function to build and return an array of Card objects for display in the add-on UI.

LinkPreviewTriggers

The configuration for a trigger that fires when a user types or pastes a link from a third-party or non-Google service into a Docs, Sheets, or Slides file.

To set up this trigger for a Google Workspace add-on, see Preview links with smart chips.

JSON representation
{
  "labelText": string,
  "localizedLabelText": {
    string: string,
    ...
  },
  "runFunction": string,
  "logoUrl": string,
  "patterns": [
    {
      object(patterns)
    }
  ]
}
Fields
labelText

string

Required. The text for an example smart chip that prompts users to preview the link, such as Example: Support case. This text is static and displays before users execute the add-on.
localizedLabelText

map (key: string, value: string)

Optional. A map of labelText to localize into other languages. Format the language in ISO 639 and country/region in ISO 3166, separated by a hyphen -. For example, en-US.

If a user's locale is present in the map's keys, the user sees the localized version of the labelText.

patterns[]

object (UriPattern)

Required. An array of URL patterns that trigger the add-on to preview links.
runFunction

string

Required. The name of the function to run when the user authorizes the https://www.googleapis.com/auth/workspace.linkpreview scope. If specified, you must implement this function to accept an event object containing EDITOR_NAME.matchedUrl.url as an argument and return a single Card object that displays a link preview in the add-on UI.
logoUrl

string

Optional. The icon that displays in the smart chip and preview card. If omitted, the add-on uses its toolbar icon, logoUrl.

UriPattern

The configuration for each URL pattern that triggers a link preview.

JSON representation
{
  "hostPattern": string,
  "pathPrefix" : string
}
Fields
hostPattern

string

Required for each URL pattern to preview.The domain of the URL pattern. The add-on previews links that contain this domain in the URL. To preview links for a specific subdomain, like subdomain.example.com, include the subdomain. To preview links for the entire domain, specify a wildcard character with an asterisk (*) as the subdomain.

For example, *.example.com matches subdomain.example.com and another.subdomain.example.com.

pathPrefix

string

Optional. The path that appends the domain of the hostPattern.

For example, if the URL host pattern is support.example.com, to match URLs for cases hosted at support.example.com/cases/, use cases.

To match all URLs in the host pattern domain, leave pathPrefix empty.

CreateActionTriggers

The configuration for a trigger that fires when a user selects a third-party integration menu item from the Google Docs @ menu.

To set up this trigger for a Google Workspace add-on, see Create third-party resources with smart chips.

JSON representation
{
  "id": string,
  "labelText": string,
  "localizedLabelText": {
    string: string,
    ...
  },
  "runFunction": string,
  "logoUrl": string,
}
Fields
id

string

Required. The unique ID to differentiate this extension point. The ID can have up to 64 characters and should be in the format of [a-zA-Z0-9-]+..
labelText

string

Required. The text that appears in the @ menu, such as Create support case.
localizedLabelText

map (key: string, value: string)

Optional. A map of labelText to localize into other languages. Format the language in ISO 639 and country/region in ISO 3166, separated by a hyphen -. For example, en-US.

If a user's locale is present in the map's keys, the user sees the localized version of the labelText.

runFunction

string

Required. The name of the function to run when a user selects an extension point from the @ menu. The function should return a form card with inputs for creating the third-party resource.
logoUrl

string

Optional. The icon that displays in the @ menu. If omitted, the add-on uses its toolbar icon, logoUrl.