Messages (ClearText)
Send plaintext messages over the same WebSocket without E2EE key exchange, ideal for notifications, bots, support widgets, and public chats.
When to use cleartext
Cleartext messaging skips the X25519 key exchange and AES-256-GCM encryption that E2EE messages go through. This means:
- No key exchange latency, messages are delivered instantly on the first call.
- No per-device encryption overhead, a single payload is relayed to all recipient devices.
- The server can read message contents, use E2EE when privacy is a hard requirement.
Common use cases: system notifications, chatbot messages, public group chats, customer support widgets.
Sending a cleartext message
const { messageId } = await client.sendCleartextMessage(
'user-456',
'Welcome to the platform!'
);
console.log('Sent:', messageId);Receiving cleartext messages
Cleartext messages arrive through the same onMessage callback. The SDK automatically detects the encryption type and skips crypto when not needed.
client.onMessage(msg => {
console.log(msg.fromUserId, msg.plaintext);
// Works for both E2EE and cleartext messages
});Quotas
Cleartext messages count toward your plan's cleartext message quota (separate from E2EE message limits). Check the pricing page for per-plan limits.