Push Notifications
For Web Chat, you can implement custom push notifications by using webhooks within the Conversation APIs.
This functionality enables you to notify end-users when a live agent joins their conversation. These notifications alert users that an agent has joined and begun responding in the chat.
If users close or exit the chat window, they will not receive notifications. The Web Chat interface must remain open for notifications to appear. At this time, mobile push notification support is not available.
Overview
When Ada emits conversation events (e.g., v1.conversation.message), your webhook receives them. Your backend looks up the recipient device tokens for the event’s end_user_id, then calls your push provider (APNs, FCM) to deliver a notification.
High level flow
- Subscribe to webhooks in the Ada dashboard.
- Map
conversation_id→ device token in your system. - Process webhook events and extract message and
conversation_id. - Send a push via APNs/FCM to the mapped device(s).
Step 1: Configure Ada Webhooks
- In Ada Dashboard → Settings → Webhooks, create a POST endpoint, e.g.
https://your-api.example.com/ada/webhooks. - Subscribe to conversation events, at minimum:
v1.conversation.message.
Step 2: End User Device
From the end user device, you need to obtain the conversation_id and the device token.
In order to obtain the conversation_id, subscribe to one of the events offered in the SDK API Reference that return the conversation_id. We suggest using:
ada:agent:joinedada:minimize_chat
We suggest maintaining a persistent mapping so you can reach the user’s devices when you have Ada’s conversation_id.
Keys: conversation_id (Ada’s Conversation Identifier) and device_token
Recommended table (example)
Collecting device token
- Mobile apps: request notification permission at a sensible moment, then register token on login or app launch.
- Web: use browser push (VAPID) if applicable.
- On logout/uninstall: mark tokens revoked; periodically clean stale tokens.
Step 3: Handling Webhook Events
Event of interest: v1.conversation.message
Example payload (illustrative):
Processing steps
- Verify webhook authenticity.
- Parse
conversation_id,message.text, and any metadata you want in the push. For messages sent by an agent, clients can filter out by therole: "human_agent". - Fetch device tokens for
conversation_id. - Fan-out a notification per active device token.