const ws = new WebSocket(websocketUrl);
ws.onopen = () => {
const interactObject = {
agentId: "your-agent-id",
convoId: "your-convo-id",
bucket: "voiceglow-eu" | "(default)", // For eu region or na region
prompt: "Hello, how can you help me?",
agentData: {
ownerID: "user-id", // your own UID
userID: "user-id", // your own UID
},
// Optional
lightConvoData: {
userName: "John Doe",
userEmail: "john@example.com",
userPhone: "+1234567890",
origin: "web-chat" // Web chat interface
| "discord" // Discord integration
| "messenger" // Facebook Messenger
| "instagram" // Instagram integration
| "gb-chat" // GB chat
},
};
ws.send(JSON.stringify(interactObject));
};