843 B
843 B
Webhooks Example
This example shows how to set up a server to listen for MiroTalk SFU webhook events (join, exitRoom, disconnect).
Step 1: Enable Webhooks
Edit app/src/config.js to enable webhooks:
webhook: {
enabled: true, // Enable webhook functionality
url: 'http://localhost:8888/webhook-endpoint', // Webhook server URL
},
Step 2: Run the Webhook Server
-
Install dependencies:
npm install -
Start the server:
npm start
Step 3: Webhook Events
MiroTalk SFU sends HTTP POST requests to the specified URL with event data:
Example Payload:
{
"event": "join",
"data": {}
}
- Events:
join,exit,disconnect. - Data: Includes
eventand customdata.
