부가기능은 매니페스트 파일을 사용하여 앱과 앱의 작동에 관한 특정 세부정보를 구성합니다.
이 문서에서는 Google Workspace 부가기능의 매니페스트를 구성하는 방법을 자세히 설명합니다.
Google Workspace 부가기능의 매니페스트 구조
Google Workspace 부가기능은 매니페스트 파일을 사용하여 부가기능의 외관과 동작의 여러 측면을 정의합니다.
Google Workspace 부가기능의 매니페스트 속성은 매니페스트 객체 구조의 addOns
섹션 아래에 정리되어 있습니다.
Apps Script 매니페스트 파일에 관한 자세한 내용은 매니페스트 구조를 참고하세요.
HTTP 엔드포인트로 빌드된 부가기능의 매니페스트 파일에 관한 자세한 내용은
projects.deployments
리소스를 참고하세요.
Google Chat 매니페스트
Google Workspace 부가기능이 Google Chat을 확장하는 경우 Google Cloud 콘솔에서 Google Chat API를 사용 설정하고 구성하여 Google Chat 앱을 구성해야 합니다.
일반적인 매니페스트 구성 설정 (addons.common
포함)은 Chat에서 무시됩니다. 부가기능 매니페스트를 사용하는 대신 Chat API를 사용하여 다음 Chat 설정을 구성합니다.
- 채팅 UI에만 표시되는 채팅 앱의 이름, 로고, 설명
- 채팅 앱 트리거
Apps Script에서 부가기능을 빌드한 경우 매니페스트에 다음 객체를 추가하거나 업데이트해야 합니다.
addons.chat
(필수)oauthScopes
(Google Chat 앱이 OAuth 범위를 사용하는 경우 필수)
부가기능의 Chat 설정을 구성하는 단계는 Google Chat 앱 구성을 참고하세요.
Google Workspace 부가기능 매니페스트 구성 샘플
다음 매니페스트 샘플은 다음 측면을 포함하여 Google Workspace 부가기능을 정의하는 매니페스트 파일의 섹션을 보여줍니다.
매니페스트의
addOns.common
섹션은 부가기능의 이름, 로고 URL, 색상, 기타 일반적인 호스트 독립 설정을 정의합니다.매니페스트는 일반 홈페이지를 정의할 뿐만 아니라 Calendar, Drive, Docs, Sheets, Slides별 홈페이지도 정의합니다. Gmail에서 기본 홈페이지를 사용합니다.
샘플 매니페스트 설정은 다음을 사용 설정합니다.
캘린더
eventOpen
및eventUpdated
트리거(Apps Script만 해당) 캘린더 회의 솔루션 2개
두 개의 범용 작업
Drive
onItemsSelectedTrigger
Gmail 작성 작업 및 컨텍스트 트리거
Docs
linkPreviewTriggers
객체입니다. 이 트리거에 대한 자세한 내용은 스마트 칩을 사용한 미리보기 링크를 참고하세요.Docs
createActionTriggers
객체입니다. 이 트리거에 대해 자세히 알아보려면 @ 메뉴에서 서드 파티 리소스 만들기를 참고하세요.Docs, Sheets, Slides의 파일별 인터페이스
(HTTP만 해당) 승인 헤더를 전송하고 세부적인 동의를 지원하는 두 개의
HttpOptions
oauthScopes
필드는 프로젝트의 승인 범위를 설정합니다 (일반적으로 부가기능에 필요).(Apps Script만 해당)
urlFetchWhitelist
필드는 가져온 엔드포인트가 지정된 HTTPS URL 접두사 목록과 일치하도록 하는 필드입니다. 자세한 내용은 URL 허용 목록을 참고하세요.
매니페스트 샘플의 링크는 Apps Script 및 HTTP Google Workspace 부가기능의 해당 매니페스트 참조 문서에 있는 필드 설명으로 리디렉션됩니다.
Apps Script
{ "addOns": { "calendar": { "createSettingsUrlFunction": "getConferenceSettingsPageUrl", "conferenceSolution": [{ "id": "my-video-conf", "logoUrl": "https://lh3.googleusercontent.com/...", "name": "My Video Conference", "onCreateFunction": "onCreateMyVideoConference" }, { "id": "my-streamed-conf", "logoUrl": "https://lh3.googleusercontent.com/...", "name": "My Streamed Conference", "onCreateFunction": "onCreateMyStreamedConference" }], "currentEventAccess": "READ_WRITE", "eventOpenTrigger": { "runFunction": "onCalendarEventOpen" }, "eventUpdateTrigger": { "runFunction": "onCalendarEventUpdate" }, "eventAttachmentTrigger": { "label": "My Event Attachment", "runFunction": "onCalendarEventAddAttachment" }, "homepageTrigger": { "runFunction": "onCalendarHomePageOpen", "enabled": true } }, "common": { "homepageTrigger": { "runFunction": "onDefaultHomePageOpen", "enabled": true }, "layoutProperties": { "primaryColor": "#ff392b", "secondaryColor": "#d68617" }, "logoUrl": "https://ssl.gstatic.com/docs/script/images/logo/script-64.png", "name": "Demo Google Workspace add-on", "openLinkUrlPrefixes": [ "https://mail.google.com/", "https://script.google.com/a/google.com/d/", "https://drive.google.com/a/google.com/file/d/", "https://www.example.com/" ], "universalActions": [{ "label": "Open settings", "runFunction": "getSettingsCard" }, { "label": "Open Help URL", "openLink": "https://www.example.com/help" }], "useLocaleFromApp": true }, "drive": { "homepageTrigger": { "runFunction": "onDriveHomePageOpen", "enabled": true }, "onItemsSelectedTrigger": { "runFunction": "onDriveItemsSelected" } }, "gmail": { "composeTrigger": { "selectActions": [ { "text": "Add images to email", "runFunction": "getInsertImageComposeCards" } ], "draftAccess": "METADATA" }, "contextualTriggers": [ { "unconditional": {}, "onTriggerFunction": "onGmailMessageOpen" } ] }, "docs": { "homepageTrigger": { "runFunction": "onEditorsHomepage" }, "onFileScopeGrantedTrigger": { "runFunction": "onFileScopeGrantedEditors" }, "linkPreviewTriggers": [ { "runFunction": "onLinkPreview", "patterns": [ { "hostPattern": "example.com", "pathPrefix": "example-path" } ], "labelText": "Link preview", "localizedLabelText": { "es": "Link preview localized in Spanish" }, "logoUrl": "https://www.example.com/images/smart-chip-icon.png" } ], "createActionTriggers": [ { "id": "exampleId", "labelText": "Example label text", "localizedLabelText": { "es": "Label text localized in Spanish" }, "runFunction": "exampleFunction", "logoUrl": "https://www.example.com/images/case.png" } ] }, "sheets": { "homepageTrigger": { "runFunction": "onEditorsHomepage" }, "onFileScopeGrantedTrigger": { "runFunction": "onFileScopeGrantedEditors" } }, "slides": { "homepageTrigger": { "runFunction": "onEditorsHomepage" }, "onFileScopeGrantedTrigger": { "runFunction": "onFileScopeGrantedEditors" } } }, "oauthScopes": [ "https://www.googleapis.com/auth/calendar.addons.execute", "https://www.googleapis.com/auth/calendar.addons.current.event.read", "https://www.googleapis.com/auth/calendar.addons.current.event.write", "https://www.googleapis.com/auth/drive.addons.metadata.readonly", "https://www.googleapis.com/auth/gmail.addons.current.action.compose", "https://www.googleapis.com/auth/gmail.addons.current.message.metadata", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/script.external_request", "https://www.googleapis.com/auth/script.locale", "https://www.googleapis.com/auth/script.scriptapp", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/documents.currentonly", "https://www.googleapis.com/auth/spreadsheets.currentonly", "https://www.googleapis.com/auth/presentations.currentonly", "https://www.googleapis.com/auth/workspace.linkpreview" ], "urlFetchWhitelist": [ "https://www.example.com/myendpoint/" ] }
HTTP
{ "addOns": { "calendar": { "currentEventAccess": "READ_WRITE", "eventOpenTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarEventOpen" }, "eventUpdateTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarEventUpdate" }, "eventAttachmentTrigger": { "label": "My Event Attachment", "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarEventAddAttachment" }, "homepageTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarHomePageOpen", "enabled": true } }, "common": { "homepageTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onDefaultHomePageOpen", "enabled": true }, "layoutProperties": { "primaryColor": "#ff392b", "secondaryColor": "#d68617" }, "logoUrl": "https://ssl.gstatic.com/docs/script/images/logo/script-64.png", "name": "Demo Google Workspace add-on", "openLinkUrlPrefixes": [ "https://mail.google.com/", "https://script.google.com/a/google.com/d/", "https://drive.google.com/a/google.com/file/d/", "https://www.example.com/" ], "universalActions": [{ "label": "Open settings", "runFunction": "https://myownpersonaldomain.com/mypage?trigger=getSettingsCard" }, { "label": "Open Help URL", "openLink": "https://www.example.com/help" }], "useLocaleFromApp": true }, "drive": { "homepageTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onDriveHomePageOpen", "enabled": true }, "onItemsSelectedTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onDriveItemsSelected" } }, "gmail": { "composeTrigger": { "actions": [ { "label": "Add images to email", "runFunction": "https://myownpersonaldomain.com/mypage?trigger=getInsertImageComposeCards" } ], "draftAccess": "METADATA" }, "contextualTriggers": [ { "unconditional": {}, "onTriggerFunction": "https://myownpersonaldomain.com/mypage?trigger=onGmailMessageOpen" } ] }, "docs": { "homepageTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onEditorsHomepage" }, "onFileScopeGrantedTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onFileScopeGrantedEditors" }, "linkPreviewTriggers": [ { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onLinkPreview", "patterns": [ { "hostPattern": "example.com", "pathPrefix": "example-path" } ], "labelText": "Link preview", "localizedLabelText": { "es": "Link preview localized in Spanish" }, "logoUrl": "https://www.example.com/images/smart-chip-icon.png" } ], "createActionTriggers": [ { "id": "exampleId", "labelText": "Example label text", "localizedLabelText": { "es": "Label text localized in Spanish" }, "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCreateAction", "logoUrl": "https://www.example.com/images/case.png" } ] }, "sheets": { "homepageTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onEditorsHomepage" }, "onFileScopeGrantedTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onFileScopeGrantedEditors" } }, "slides": { "homepageTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onEditorsHomepage" }, "onFileScopeGrantedTrigger": { "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onFileScopeGrantedEditors" } } "httpOptions": { "authorizationHeader": "SYSTEM_ID_TOKEN", "granularOauthPermissionSupport": "OPT_IN" } }, "oauthScopes": [ "https://www.googleapis.com/auth/calendar.addons.execute", "https://www.googleapis.com/auth/calendar.addons.current.event.read", "https://www.googleapis.com/auth/calendar.addons.current.event.write", "https://www.googleapis.com/auth/drive.addons.metadata.readonly", "https://www.googleapis.com/auth/gmail.addons.current.action.compose", "https://www.googleapis.com/auth/gmail.addons.current.message.metadata", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/script.external_request", "https://www.googleapis.com/auth/script.locale", "https://www.googleapis.com/auth/script.scriptapp", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/documents.currentonly", "https://www.googleapis.com/auth/spreadsheets.currentonly", "https://www.googleapis.com/auth/presentations.currentonly", "https://www.googleapis.com/auth/workspace.linkpreview" ] }
URL 허용 목록
허용 목록을 사용하여 스크립트나 부가기능에서 액세스할 수 있도록 사전 승인된 특정 URL을 지정합니다. 허용 목록은 사용자 데이터를 보호하는 데 도움이 됩니다. 허용 목록을 정의하면 스크립트 프로젝트가 허용 목록에 추가되지 않은 URL에 액세스할 수 없습니다.
이 필드는 테스트 배포를 설치할 때는 선택사항이지만 버전이 지정된 배포를 만들 때는 필수입니다.
스크립트 또는 부가기능이 다음 작업을 실행하는 경우 허용 목록을 사용합니다.
- Apps Script
UrlFetch
서비스를 사용하여 외부 위치 (예: HTTPS 엔드포인트)에서 정보를 가져오거나 가져옵니다. URL을 가져오기 위해 허용 목록에 추가하려면 매니페스트 파일에urlFetchWhitelist
필드를 포함하세요. - 사용자 작업에 대한 응답으로 URL을 열거나 표시합니다 (Google 외부 URL을 열거나 표시하는 Google Workspace 부가기능에 필요). 열 URL을 허용 목록에 추가하려면 매니페스트 파일에
addOns.common.openLinkUrlPrefixes
필드를 포함합니다.
허용 목록에 접두사 추가
매니페스트 파일에서 허용 목록을 지정할 때는 (addOns.common.openLinkUrlPrefixes
또는 urlFetchWhitelist
필드를 포함하여) URL 접두사 목록을 포함해야 합니다. 매니페스트에 추가하는 접두사는 다음 요구사항을 충족해야 합니다.
- 각 접두사는 유효한 URL이어야 합니다.
- 각 접두사는
http://
가 아닌https://
를 사용해야 합니다. - 각 접두사에는 전체 도메인이 있어야 합니다.
- 각 접두사에는 비어 있지 않은 경로가 있어야 합니다. 예를 들어
https://www.google.com/
는 유효하지만https://www.google.com
는 유효하지 않습니다. - 와일드 카드를 사용하여 URL 하위 도메인 접두사를 일치시킬 수 있습니다.
addOns.common.openLinkUrlPrefixes
필드에서 단일*
와일드 카드를 사용하여 모든 링크를 일치시킬 수 있지만, 이는 사용자의 데이터를 위험에 노출시키고 부가기능 검토 프로세스를 지연시킬 수 있으므로 권장되지 않습니다. 애드온 기능에 필요한 경우에만 와일드 카드를 사용하세요.
URL이 허용 목록의 접두사와 일치하는지 확인할 때는 다음 규칙이 적용됩니다.
- 경로 일치는 대소문자를 구분합니다.
- 접두사가 URL과 동일하면 일치하는 것입니다.
- URL이 동일하거나 접두사의 하위 항목인 경우 일치합니다.
예를 들어 접두사 https://example.com/foo
는 다음 URL과 일치합니다.
https://example.com/foo
https://example.com/foo/
https://example.com/foo/bar
https://example.com/foo?bar
https://example.com/foo#bar
와일드 카드 사용
단일 와일드 카드 문자 (*
)를 사용하여 urlFetchWhitelist
및 addOns.common.openLinkUrlPrefixes
필드의 하위 도메인을 일치시킬 수 있습니다. 와일드 카드를 두 개 이상 사용하여 여러 하위 도메인을 일치시킬 수 없으며 와일드 카드는 URL의 선행 접두사를 나타내야 합니다.
예를 들어 https://*.example.com/foo
프리픽스는 다음 URL과 일치합니다.
https://subdomain.example.com/foo
https://any.number.of.subdomains.example.com/foo
https://*.example.com/foo
접두사가 다음 URL과 일치하지 않습니다.
https://subdomain.example.com/bar
(접미사 불일치)https://example.com/foo
(하나 이상의 하위 도메인이 있어야 함)
매니페스트를 저장하려고 하면 일부 접두사 규칙이 적용됩니다. 예를 들어 저장하려고 할 때 매니페스트에 다음 접두사가 있으면 오류가 발생합니다.
https://*.*.example.com/foo
(여러 와일드 카드는 금지됨)https://subdomain.*.example.com/foo
(와일드 카드는 선행 접두사로 사용해야 함)