Get the client object

This page describes how to get the client object that an add-on needs to communicate with Google Meet.

First, the add-on needs to establish a session:

  const session = await window.meet.addon.createAddonSession({
      cloudProjectNumber: "CLOUD_PROJECT_NUMBER",
    });

From the session, two client objects can be created:

It's important to retrieve the correct client object for either the main stage or side panel. If the wrong client is retrieved, the Google Meet Add-ons SDK throws an exception. To check which iframe (main stage or side panel) the add-on is running in, use the MeetAddon.getFrameType method.

The following code sample shows how to instantiate the main stage client object:

  const session = await window.meet.addon.createAddonSession({
      cloudProjectNumber: "CLOUD_PROJECT_NUMBER",
    });
  const mainStageClient = await session.createMainStageClient();

Shared functionality

Some functionality is available in both the MeetMainStageClient and the MeetSidePanelClient, whereas other functionality is specific to a certain client.

For example, some functionality available in both clients includes:

Client-specific functionality

Functionality available only in the MeetMainStageClient:

Functionality available only in the MeetSidePanelClient: