Authentication
- Open a private chat with the bridge bot. Usually
@gmessagesbot:your.server- If the bot doesn't accept the invite, see the troubleshooting page
Google account login
You may want to use mautrix-manager instead of bot commands if you want to do Google login. It will automate extracting cookies so you don't need to mess with browser devtools.
Note that Google Fi's "sync to your Google Account" option is not supported by the bridge even with Google account login. You must choose the normal mode where RCS chats are available (option 1 in https://support.google.com/fi/answer/6188337).
- Send
login googleto start the login. - Log into https://accounts.google.com/AccountChooser?continue=https://messages.google.com/web/config
with your Google account in a private window.
- Using a private window is required to ensure the cookies don't get rotated by the browser, and because the bridge doesn't support cookies linked to multiple accounts. If you don't use a private window, you'll likely get randomly logged out within an hour.
- The
continueURL in the link is chosen so that it would only log into your Google account and not try to pair the browser. Make sure you don't navigate anywhere else inside the private window.
- Copy the
/web/configrequest as cURL from the browser devtools network tab. You can just reload the page to make the request show up if you didn't have devtools open before. If using windows, choose the (bash) option for copying instead of (cmd).- Alternatively, you can make a key-value JSON object containing at least
the
SID,HSID,SSID,OSID,APISIDandSAPISIDcookies. Sometimes Google also requires__Secure-1PSIDTSto be included.
- Alternatively, you can make a key-value JSON object containing at least
the
- Send the curl command (or JSON object) to the bot.
- Open Google Messages on your phone and tap on the emoji the bridge bot sent.
- Finally, the bot should inform you of a successful login.
QR login
This method was much easier to set up, but it appears Google has killed it :(
Old instructions
- Send
login qrto start the login. - Log in by scanning the QR code. If the code expires before you scan it, the
bridge will send an error to notify you.
- On your phone, open
Messages by Google.
- Tap Menu
from your conversation list and select Device pairing.
- Tap QR code scanner and point your phone at the image sent by the bot.
- On your phone, open
- Finally, the bot should inform you of a successful login.
- The bridge will create portal rooms for recent chats. The number is configurable and defaults to 25 chats with 50 messages backfilled in each chat.
As all messages are proxied through the app, your phone must be connected to the internet for the bridge to work.
Logging out
Simply run the logout management command.