Use the collaboration starting state

This page describes the purpose of the CollaborationStartingState and how to set and retrieve it from the Google Meet Add-ons SDK.

Overview of the collaboration starting state

When an add-on is first opened, the side-panel iframe loads the URL specified in the add-on manifest. This initial state might be different from the starting state that the add-on wants to use when users are joining using the collaboration invite. The CollaborationStartingState can be used to specify the iframe URLs that should be loaded when users join using the collaboration invite. Also, the additional_data field can be utilized by the add-on to store any data it might need for its initialization.

Set, get, and clear the collaboration starting state

You can manage CollaborationStartingState with the following methods.

Set the CollaborationStartingState by using the MeetAddonClient.setCollaborationStartingState method. The add-on can set the CollaborationStartingState at any time before or during the collaboration.

The URLs specified in the MeetAddonClient.setCollaborationStartingState method must belong to the same origin as the origins specified in the add-on manifest. For more information, see Add-on security.

The CollaborationStartingState.sidePanelUrl, CollaborationStartingState.mainStageUrl, and CollaborationStartingState.additionalData character lengths must conform to their respective size limits as published in the SDK reference docs.

        sidePanelUrl: "",
        mainStageUrl: "",
        additionalData: JSON.stringify({
        // State to send to participants.

Get the CollaborationStartingState, with the MeetAddonClient.getCollaborationStartingState method.

    const startingState = mainStageClient.getCollaborationStartingState();
    const additionalData = JSON.parse(startingState.additionalData);

Clear the CollaborationStartingState, with MeetAddonClient.clearCollaborationStartingState method.