Refer the common guide for configuring mautrix bridges: Setting up a Generic Mautrix Bridge
The playbook can install and configure mautrix-linkedin for you, for bridging to LinkedIn messaging.
See the project’s documentation to learn what it does and why it might be useful to you.
[!NOTE] LinkedIn keeps its messaging function behind a login wall and does not provide a usable public API, so using this bridge requires you to manually copy cookies on a web browser for logging in. Refer to this section below for details.
beeper-linkedinIf beeper-linkedin bridge is enabled on your host, you need to uninstall it first, since it claims the @linkedinbot username and @linkedin_* user range as exclusive appservice namespaces, which will cause conflicts with mautrix-linkedin.
To uninstall the bridge, set matrix_bridge_beeper_linkedin_enabled: false and re-run the playbook. The playbook refuses to install mautrix-linkedin until beeper-linkedin is uninstalled.
If you want to set up Double Puppeting (hint: you most likely do) for this bridge automatically, you need to have enabled Appservice Double Puppet for this playbook.
See this section on the common guide for configuring mautrix bridges for details about setting up Double Puppeting.
To enable the bridge, add the following configuration to your inventory/host_vars/matrix.example.com/vars.yml file:
matrix_bridge_mautrix_linkedin_enabled: true
There are some additional things you may wish to configure about the bridge.
See this section on the common guide for configuring mautrix bridges for details about variables that you can customize and the bridge’s default configuration, including bridge permissions, encryption support, bot’s username, etc.
After configuring the playbook, run it with playbook tags as below:
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start
The shortcut commands with the just program are also available: just install-all or just setup-all
just install-all is useful for maintaining your setup quickly (2x-5x faster than just setup-all) when its components remain unchanged. If you adjust your vars.yml to remove other components, you’d need to run just setup-all, or these components will still remain installed. Note these shortcuts run the ensure-matrix-users-created tag too.
Start a chat with @linkedinbot:example.com (where example.com is your base domain, the bare one without the matrix. prefix) and send login.
To log in, you need to sign in to LinkedIn with a web browser and hand one of the requests it makes to the bot. Because the bridge presents itself as Chrome on Linux, the request needs to come from Chrome or a Chrome-based browser.
[!WARNING] LinkedIn ties the session to the browser that made the request and rejects it when it is replayed under a different user-agent. A request copied from Firefox therefore results in a session that stops working immediately, without an error message.
You need to follow these steps to log in:
graphqlThe bridge’s official Authentication guide walks the same steps with screenshots.
Once you log in, the bridge builds portal rooms for your recent conversations and carries messages both ways.
💡 Notes:
This most likely means that you have obtained the request with a browser other than Chrome or a Chrome-based one. LinkedIn silently discards a session replayed under a different user-agent. Follow the login steps above again, this time using Chrome or a Chrome-based browser.
Your LinkedIn session has most likely expired. Send login to the bot and follow the login steps above again.
As with all other services, you can find the logs in systemd-journald by logging in to the server with SSH and running journalctl -fu matrix-mautrix-linkedin.
The default logging level for this component is warn. If you want to increase the verbosity, add the following configuration to your vars.yml file and re-run the playbook:
# Valid values: fatal, error, warn, info, debug, trace
matrix_bridge_mautrix_linkedin_logging_level: 'debug'