# Google Chat## Features

What the Google Chat bridge can do

| Direction                | Feature                                              |
|--------------------------|------------------------------------------------------|
| Matrix -&gt; Google Chat | Text messages and media                              |
| Google Chat -&gt; Matrix | Text messages and media                              |
| Google Chat -&gt; Matrix | Message history, real-time messages                  |
| Google Chat -&gt; Matrix | User display name and avatar sync                    |
| Misc                     | Login via browser cookies extracted from Google Chat |
| Misc                     | Automatic portal creation for recent and new chats   |

## Usage

This page shows you how to set up the Google Chat bridge using Cinny client app (available as an add-on component), so that you can receive and send messages between Google Chat and Matrix rooms.

### Invite the bot to a management room

First, please start a chat with `@googlechatbot:your-server.com` to create a management room. You can do so by inviting the bot to a room like below.

**Make sure to replace `your-server.com` with your actual “base domain”.** Setting `your-server.com` or `example.com` does not work on your server!

![Invitation dialog to create a management room](https://etke.cc/help/bridges/mautrix-googlechat/images/1.webp)

When the bot joins to the created room, it sends confirmation messages to the room as below. If they are visible, bot successfully joined the management room. It works as expected.

![Confirmation message on the room](https://etke.cc/help/bridges/mautrix-googlechat/images/2.webp)

### Authentication

To conduct authentication, please follow the steps below.

1. Log into the [Google Chat](https://chat.google.com) in private/incognito browser window
2. Press `F12` to open developer tools
3. Select the `Application` (Chrome, Safari, Edge) or `Storage` (Firefox) tab
4. In the sidebar, expand `Cookies` and select `https://chat.google.com`
5. In the cookie list, find the `COMPASS`, `SSID`, `SID`, `OSID` and `HSID` rows
6. Form a JSON object with the extracted cookies as below:
   
   ```json
   {
     "compass": "dynamite-ui=...",
     "ssid": "...",
     "sid": "...",
     "osid": "...",
     "hsid": "..."
   }
   ```
7. Close the browser window to prevent the cookies from being invalidated
8. Send `login-cookie` to the bridge bot on the client
9. Send the JSON object ![Instruction for logging in](https://etke.cc/help/bridges/mautrix-googlechat/images/3.webp)

After logging in, the bridge will create portal rooms for recent chats. Portal rooms for other chats will be created as you receive messages.

### Useful commands

If you send a message `help` to the room, available commands are output as a message like below:

![The output returned after sending help](https://etke.cc/help/bridges/mautrix-googlechat/images/4.webp)


---
* [llms.txt](https://etke.cc/llms.txt): full site index in markdown
