Developer Quick Start

Support System Integration Instructions

Follow these 3 steps to connect your support dashboard and receive live customer escalations.

1

Include the SDK Script

💡 What this does: Loads our real-time communications SDK into your dashboard. It equips your web page with WebSocket capabilities to communicate with our backend without requiring complex custom networking code.

Add this script tag to your dashboard HTML header:

<script src="https://connect.petstore.co.ke/petstore-socket-sdk.js"></script>
2

Connect & Listen for Escalations

💡 What this does: Establishes a live connection to our server and listens for human escalation events. Whenever a WhatsApp or Website customer asks to speak with a human agent, the ticket.created event fires instantly in real-time. You can use this to play an audio chime, pop up an alert, or highlight a queue item on your human agent dashboard.

Initialize the SDK in JavaScript to receive live escalation popups:

// Connect to server
const petstoreChat = new PetstoreSocketSDK({
  serverUrl: 'https://connect.petstore.co.ke',
  apiKey: 'petstore_live_key_2026'
});

// 🚨 Listen for real-time customer escalations / new tickets
petstoreChat.on('ticket.created', (data) => {
  console.log('New Ticket / Escalation Received:', data);
  // Show pop-up alert or play sound on human agent dashboard UI!
});
3

Agent Takeover API

💡 What this does: Pauses the AI bot for a specific customer conversation. Call this endpoint when a support agent clicks "Take Over Chat" on your dashboard. Once invoked, the AI stops responding automatically so your human agent can chat directly with the customer without AI interference.

Call this endpoint when an agent takes over a chat:

POST https://connect.petstore.co.ke/api/tickets/:ticketId/takeover
Request Body:
{
  "agentName": "Sarah",
  "agentId": "agent_123"
}
Petstore Kenya Support Backend — Questions? Contact Backend Dev Team.