클라이언트 객체 관리
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 부가기능이 Google Meet과 통신하는 데 필요한 클라이언트 객체를 관리하는 방법을 설명합니다.
먼저 부가기능이 세션을 설정해야 합니다.
const session = await window.meet.addon.createAddonSession({
cloudProjectNumber: "CLOUD_PROJECT_NUMBER",
});
CLOUD_PROJECT_NUMBER를 Google Cloud 프로젝트의 프로젝트 번호로 바꿉니다.
세션에서 다음 두 클라이언트 객체를 만들 수 있습니다.
기본 스테이지 또는 측면 패널에 대해 올바른 클라이언트 객체를 가져오는 것이 중요합니다. 잘못된 클라이언트가 검색되면 Google Meet 부가기능 SDK에서 예외를 발생시킵니다. 부가기능이 실행 중인 iframe (기본 스테이지 또는 측면 패널)을 확인하려면 getFrameType()
메서드를 사용합니다.
다음 코드 샘플은 기본 스테이지 클라이언트 객체를 인스턴스화하는 방법을 보여줍니다.
const session = await window.meet.addon.createAddonSession({
cloudProjectNumber: "CLOUD_PROJECT_NUMBER"
});
const mainStageClient = await session.createMainStageClient();
CLOUD_PROJECT_NUMBER를 Cloud 프로젝트의 프로젝트 번호로 바꿉니다.
공유 기능
일부 기능은 MeetMainStageClient
및 MeetSidePanelClient
객체 모두에서 사용할 수 있지만 다른 기능은 특정 클라이언트에만 해당합니다.
예를 들어 두 클라이언트에서 모두 사용할 수 있는 기능은 다음과 같습니다.
클라이언트별 기능
MeetMainStageClient
객체에서만 사용할 수 있는 기능:
MeetSidePanelClient
객체에서만 사용할 수 있는 기능:
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[],[],null,["# Manage client objects\n\nThis page describes how to manage client objects that an\nadd-on needs to communicate with Google Meet.\n\nFirst, the add-on needs to establish a session: \n\n const session = await window.meet.addon.createAddonSession({\n cloudProjectNumber: \"\u003cvar translate=\"no\"\u003eCLOUD_PROJECT_NUMBER\u003c/var\u003e\",\n });\n\nReplace \u003cvar translate=\"no\"\u003eCLOUD_PROJECT_NUMBER\u003c/var\u003e with the project number of your\nGoogle Cloud project.\n\nFrom the session, two client objects can be created:\n\n- The [`MeetMainStageClient`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetmainstageclient)\n for an add-on running in the [main\n stage](/workspace/meet/add-ons/guides/overview#main-stage), retrievable using `await\n session.createMainStageClient()`.\n\n- The [`MeetSidePanelClient`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetsidepanelclient)\n for an add-on running in the [side\n panel](/workspace/meet/add-ons/guides/overview#side-panel), retrievable using `await\n session.createSidePanelClient()`.\n\nIt's important to retrieve the correct client object for either the main stage\nor side panel. If the wrong client is retrieved, the Google Meet add-ons SDK throws\nan exception. To check which iframe (main stage or side panel) the\nadd-on is running in, use the\n[`getFrameType()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetaddon.getframetype)\nmethod.\n\nThe following code sample shows how to instantiate the main stage client object: \n\n const session = await window.meet.addon.createAddonSession({\n cloudProjectNumber: \"\u003cvar translate=\"no\"\u003eCLOUD_PROJECT_NUMBER\u003c/var\u003e\"\n });\n const mainStageClient = await session.createMainStageClient();\n\nReplace \u003cvar translate=\"no\"\u003eCLOUD_PROJECT_NUMBER\u003c/var\u003e with the project number of your\nCloud project.\n\nShared features\n---------------\n\nSome features are available in both the `MeetMainStageClient` and the\n`MeetSidePanelClient` object, whereas other features are specific to a certain\nclient.\n\nFor example, some features that are available in both clients include:\n\n- The [`getActivityStartingState()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetaddonclient.getactivitystartingstate) method that gets information about the initial state of the add-on when the participant accepts the invitation to join the activity.\n- The [`getMeetingInfo()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetaddonclient.getmeetinginfo) method that gets details about the meeting in which the add-on is running.\n- The [`setActivityStartingState()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetaddonclient.setactivitystartingstate) method that sets the initial state of the add-on when the participant accepts the invitation to join the activity.\n- For a comprehensive list of features in both clients, see the [`MeetAddonClient`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetaddonclient) object.\n\nClient-specific features\n------------------------\n\nFeatures available only in the\n[`MeetMainStageClient`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetmainstageclient)\nobject:\n\n- The [`notifySidePanel()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetmainstageclient.notifysidepanel)\n method sends a message to the side panel. The message can be received by\n subscribing to the [`frameToFrameMessage`\n callback](/workspace/meet/add-ons/guides/frame-to-frame-messaging) in the side panel.\n\n- The [`loadSidePanel()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetmainstageclient.loadsidepanel)\n method opens the side-panel iframe. The iframe source is set to the\n side-panel URL from the manifest file.\n\n- The [`unloadSidePanel()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetmainstageclient.unloadsidepanel)\n method closes the side-panel iframe. The add-on\n state isn't retained within Meet when the method is called.\n It's up to the add-on to persist any\n add-on state before this method is called.\n\nFeatures available only in the\n[`MeetSidePanelClient`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetsidepanelclient)\nobject:\n\n- The [`notifyMainStage()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetsidepanelclient.notifymainstage) method sends a message to the mainStage. The message can be received by subscribing to the [`frameToFrameMessage` callback\n property](/workspace/meet/add-ons/guides/frame-to-frame-messaging) in the mainstage."]]