Page Summary
-
Google Workspace add-on manifest configurations for Editor extensions require specific components, especially if they extend the Editor.
-
The
onFileScopeGrantedTriggeris necessary if your add-on interacts with the current Editor document after the user grantsdrive.filescope. -
linkPreviewTriggers[]are mandatory for enabling link previews in Docs, Sheets, or Slides. -
createActionTriggers[]are required for allowing the creation of third-party resources via the @ menu. -
The
runFunctionfield in triggers specifies the function to execute when the trigger fires.
The resource configuration used to define Google Workspace add-on content and behavior within the editors. Google Workspace add-on manifests must include all components marked as Requiredif they extend the Editor.
Editors
The Google Workspace add-on manifest configuration for Editor extensions. See Extending Editors with Google Workspace add-ons for details.
| JSON representation |
|---|
{ "homepageTrigger": { object ( HomepageTrigger ) }, "onFileScopeGrantedTrigger": { object ( OnFileScopeGrantedTrigger ) }, "linkPreviewTriggers": [ { object ( LinkPreviewTriggers ) } ], "createActionTriggers": [ { object ( CreateActionTriggers ) } } |
| Fields | |
|---|---|
homepageTrigger
|
This trigger function creates the add-on homepage
in the host app. This overrides |
onFileScopeGrantedTrigger
|
Required if the add-on includes behavior
specific to the current document
, triggered when the user
authorizes the |
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[]
|
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 uses CardService.newEditorFileScopeActionResponseBuilder().requestFileScopeForActiveDocument().build();
and the user grants drive.file
scope authorization.
| JSON representation |
|---|
{
"runFunction": string
}
|
| Fields | |
|---|---|
runFunction
|
drive.file
scope is
granted. The function must return an array of Card
objects for the UI. |
LinkPreviewTriggers
The configuration for a trigger that fires when a user types or pastes a link from a third-party 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
|
Example: Support case
. This text
is static. |
localizedLabelText
|
labelText
to localize into other
languages. Format the language in ISO 639
and country/region in ISO 3166
,
separated by a hyphen -
. |
patterns[]
|
|
runFunction
|
https://www.googleapis.com/auth/workspace.linkpreview
scope. The function must accept an event object, which includes a matchedUrl.url
property containing the URL to preview, and
return a Card
object. |
logoUrl
|
logoUrl
. |
UriPattern
The configuration for each URL pattern that triggers a link preview.
| JSON representation |
|---|
{
"hostPattern": string,
"pathPrefix" : string
}
|
| Fields | |
|---|---|
hostPattern
|
*
). |
pathPrefix
|
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
|
[a-zA-Z0-9-]+.
format. |
labelText
|
Create support case
. |
localizedLabelText
|
labelText
to localize. Format the
language in ISO 639
and country/region in ISO 3166
,
separated by a hyphen -
. |
runFunction
|
|
logoUrl
|
logoUrl
. |

