Skip to main content

Typing Indicators

urelay supports bidirectional typing indicators -- your contacts see the three-dot typing bubble when you type, and you see when they are typing.

Inbound typing (contact is typing)

When a contact starts typing a message to your phone line, urelay detects it and pushes the event to connected SSE clients in real-time.

SSE event format

{
"type": "typing",
"chatIdentifier": "+12025551234",
"active": true
}

When the contact stops typing (or sends the message), a second event fires with active: false.

Handling in your UI

eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'typing') {
if (data.active) {
showTypingIndicator(data.chatIdentifier);
// Auto-clear after 6 seconds if no follow-up
setTimeout(() => hideTypingIndicator(data.chatIdentifier), 6000);
} else {
hideTypingIndicator(data.chatIdentifier);
}
}
};

Outbound typing (you are typing)

When a user types in the urelay portal, a typing indicator is automatically sent to the recipient so they see the three-dot bubble in their Messages app.

The portal handles this with debounced typing events -- a start signal when typing begins, and a stop signal after 3 seconds of inactivity or when a message is sent.

Limitations

  • Typing indicators are transient and not persisted to the database
  • They depend on the SSE connection being active
  • If the phone line goes offline, typing indicators are unavailable
  • There may be a 1-2 second delay depending on network conditions