livqenoDocs

ChatTyping Indicators

Typing Indicators

Show "Alice is typing…". Typing signals are never saved.

A typing indicator shows "Alice is typing…" while someone writes a message. It makes a chat feel live, and tells a support customer that the agent is working on a reply.

Where this fits: your app is connected to a conversation (see the Chat quickstart). The sender's app sends "started" and "stopped" signals; everyone else's app gets a typing event.

Use it

In your app:

await chat.startTyping();
await chat.stopTyping();
 
chat.on('typing', (event) => {
  console.log(`${event.userId} ${event.isTyping ? 'started' : 'stopped'} typing`);
});

A typical pattern (without React):

  1. Call startTyping() from the input's change handler. It's safe to call on every keystroke.
  2. Call stopTyping() when the user sends the message or clears the input.
  3. On the receiving side, keep a list of who's typing from typing events, and show "Alice is typing…" or "2 people are typing…".

Never saved

Typing signals are never saved to the database. They expire after 7 seconds. Nobody needs to know who was typing yesterday.

No stuck "is typing…"

A common bug is "Alice is typing…" that never goes away, because her app crashed before sending "stop". Livqeno has three protections:

  1. Server: the typing signal expires after 7 seconds, no matter what.
  2. Sender's SDK: @livqeno/chat stops typing on its own after a pause.
  3. Receiver's SDK: @livqeno/react hides a typing user after 8 seconds, even if "stop" was lost.

You never get your own typing event back, so you don't need to filter yourself out.

Common mistakes

MistakeWhat you'll seeFix
Not calling stopTyping() after sending"Alice is typing…" lingers for a few seconds after her message arrives.Call stopTyping() right after sendMessage().
Building your own timer on the receiving side (outside React)Indicators that never clear if "stop" is lost.Hide a typing user after about 8 seconds without a new signal.

Next steps