Top Related Projects
A terminal based Matrix client written in Go.
A private messenger for Android.
Matrix Client-Server SDK for JavaScript
A glossy Matrix collaboration client for the web.
Synapse: Matrix homeserver written in Python/Twisted.
bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Quick Overview
Mautrix-WhatsApp is a Matrix-WhatsApp puppeting bridge, allowing users to connect their WhatsApp account to Matrix. It enables seamless communication between Matrix and WhatsApp, bridging messages, media, and group chats.
Pros
- Enables cross-platform messaging between Matrix and WhatsApp
- Supports end-to-end encryption for secure communication
- Allows multiple WhatsApp accounts to be bridged simultaneously
- Provides seamless media sharing and group chat functionality
Cons
- Requires technical knowledge to set up and configure
- May occasionally face issues due to changes in WhatsApp's API
- Limited support for some WhatsApp features (e.g., voice calls)
- Potential for account suspension if WhatsApp detects unusual activity
Getting Started
- Install the bridge:
git clone https://github.com/mautrix/whatsapp.git
cd whatsapp
./mautrix-whatsapp
- Configure the bridge by editing
config.yaml
:
homeserver:
address: https://matrix.example.com
domain: example.com
appservice:
address: http://localhost:29318
hostname: 0.0.0.0
port: 29318
bridge:
username_template: whatsapp_{userid}
displayname_template: '{displayname} (WA)'
- Generate the registration file:
./mautrix-whatsapp -g
-
Add the registration file to your Matrix homeserver configuration and restart the homeserver.
-
Start the bridge:
./mautrix-whatsapp
- Invite the bridge bot to a Matrix room and follow the instructions to log in to WhatsApp.
Competitor Comparisons
A terminal based Matrix client written in Go.
Pros of gomuks
- Standalone Matrix client with a terminal user interface
- Supports end-to-end encryption
- Lightweight and resource-efficient
Cons of gomuks
- Limited to terminal/CLI usage, no graphical interface
- Fewer features compared to full-fledged Matrix clients
- May require more technical knowledge to set up and use
Code Comparison
gomuks (main.go):
func main() {
config := config.Load(os.Args[1:])
client := mautrix.NewClient(config.HS, "", "")
ui := ui.NewGomuksUI(client, config)
ui.Init()
ui.Start()
}
whatsapp (main.go):
func main() {
bridge := whatsapp.NewBridge()
bridge.Init()
bridge.Start()
bridge.WaitForCompletion()
}
The code snippets show that gomuks is focused on creating a Matrix client, while whatsapp is designed as a bridge between WhatsApp and Matrix. gomuks initializes a user interface, whereas whatsapp sets up a bridge connection.
A private messenger for Android.
Pros of Signal-Android
- Native Android app with full feature set and optimized performance
- End-to-end encryption built-in for all communications
- Open-source codebase allowing for community audits and contributions
Cons of Signal-Android
- Limited to Signal protocol and network
- Requires phone number for registration and use
- More resource-intensive as a full mobile application
Code Comparison
Signal-Android (Java):
public class SignalServiceMessageSender {
public void sendMessage(SignalServiceAddress address,
SignalServiceDataMessage message) {
// Encryption and sending logic
}
}
WhatsApp (Python):
class WhatsAppBridge:
async def handle_message(self, message: Message):
# Bridge logic to handle and forward messages
await self.matrix.send_message(message.text)
Key Differences
- Signal-Android is a full-featured mobile app, while WhatsApp is a bridge for Matrix
- Signal-Android focuses on secure messaging within its ecosystem, WhatsApp enables cross-platform communication
- Signal-Android uses Java for Android development, WhatsApp uses Python for server-side bridging
Matrix Client-Server SDK for JavaScript
Pros of matrix-js-sdk
- Designed for JavaScript/TypeScript environments, making it ideal for web and Node.js applications
- Provides a comprehensive SDK for interacting with the Matrix protocol, offering a wide range of features
- Well-documented and maintained by the official Matrix.org team
Cons of matrix-js-sdk
- Limited to Matrix protocol, not specifically designed for WhatsApp integration
- May require additional bridging solutions for connecting to WhatsApp
- Potentially steeper learning curve for developers not familiar with Matrix
Code Comparison
matrix-js-sdk:
const client = sdk.createClient({
baseUrl: "https://matrix.org",
accessToken: "YOUR_ACCESS_TOKEN",
userId: "@alice:matrix.org"
});
client.sendMessage("!roomId:matrix.org", {
body: "Hello, World!",
msgtype: "m.text"
});
mautrix-whatsapp:
client := whatsapp.NewClient(whatsapp.ClientConfig{
Store: store,
Log: log,
Proxy: proxy,
Handler: handler,
})
client.Connect()
client.SendMessage("1234567890@s.whatsapp.net", &waProto.Message{
Conversation: proto.String("Hello, World!"),
})
The code snippets demonstrate basic message sending functionality in both libraries, highlighting their different approaches and language ecosystems.
A glossy Matrix collaboration client for the web.
Pros of Element Web
- Offers a full-featured web client for Matrix, providing a complete user interface
- Supports end-to-end encryption and a wide range of Matrix features
- Actively developed with frequent updates and a large community
Cons of Element Web
- Limited to Matrix protocol, not directly compatible with WhatsApp
- Requires more resources to run and maintain compared to a bridge
- May have a steeper learning curve for users familiar with traditional messaging apps
Code Comparison
Element Web (React component):
export default class MessageComposer extends React.Component {
render() {
return (
<div className="mx_MessageComposer">
<ComposerInput />
<SendButton />
</div>
);
}
}
Mautrix-WhatsApp (Go code):
func (bridge *Bridge) HandleMessage(source *User, message *waProto.Message) {
content := &event.MessageEventContent{
MsgType: event.MsgText,
Body: message.GetConversation(),
}
bridge.SendMessage(source.MXID, content)
}
The code snippets illustrate the different focus of each project: Element Web deals with UI components, while Mautrix-WhatsApp handles message bridging between protocols.
Synapse: Matrix homeserver written in Python/Twisted.
Pros of Synapse
- Full-featured Matrix homeserver implementation
- Supports a wide range of Matrix clients and integrations
- Highly scalable and suitable for large deployments
Cons of Synapse
- Higher resource requirements and complexity
- Steeper learning curve for setup and maintenance
- Not specifically designed for WhatsApp bridging
Code Comparison
Synapse (Python):
class SynapseHomeServer(HomeServer):
def _listen_http(self, config):
port = config.get("port", 8008)
site = server.Site(self.get_site_resource())
return reactor.listenTCP(port, site, interface=config.get("bind_address", ""))
mautrix-whatsapp (Go):
func (bridge *Bridge) Start() {
bridge.Log.Debugln("Starting WhatsApp bridge")
bridge.AS.Start()
bridge.Log.Infoln("WhatsApp bridge started!")
}
The code snippets highlight the different focus of each project. Synapse deals with core Matrix server functionality, while mautrix-whatsapp is specifically designed for bridging WhatsApp to Matrix.
bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Pros of Matterbridge
- Supports a wider range of platforms and protocols (30+) compared to WhatsApp-only focus
- More flexible configuration options for routing messages between different platforms
- Actively maintained with frequent updates and bug fixes
Cons of Matterbridge
- May have higher resource usage due to supporting multiple platforms
- Configuration can be more complex for simple use cases
- Lacks some WhatsApp-specific features that Mautrix-WhatsApp provides
Code Comparison
Matterbridge (config.toml):
[[gateway]]
name = "mygateway"
enable = true
[[gateway.inout]]
account = "slack.myslack"
channel = "general"
[[gateway.inout]]
account = "mattermost.mymattermost"
channel = "town-square"
Mautrix-WhatsApp (config.yaml):
bridge:
permissions:
example.com: "full"
'@admin:example.com': "admin"
whatsapp:
os_name: "Mautrix-WhatsApp Bridge"
browser_name: "Chrome"
Both projects serve as bridges for messaging platforms, but Matterbridge offers broader platform support, while Mautrix-WhatsApp focuses specifically on bridging WhatsApp with Matrix. Matterbridge's configuration allows for more complex routing between multiple platforms, while Mautrix-WhatsApp's configuration is more streamlined for its specific use case.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
mautrix-whatsapp
A Matrix-WhatsApp puppeting bridge based on whatsmeow.
Documentation
All setup and usage instructions are located on docs.mau.fi. Some quick links:
- Bridge setup (or with Docker)
- Basic usage: Authentication
Features & Roadmap
ROADMAP.md contains a general overview of what is supported by the bridge.
Discussion
Matrix room: #whatsapp:maunium.net
Top Related Projects
A terminal based Matrix client written in Go.
A private messenger for Android.
Matrix Client-Server SDK for JavaScript
A glossy Matrix collaboration client for the web.
Synapse: Matrix homeserver written in Python/Twisted.
bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot