Webhooks
This guide explains how to configure and handle MiroTalk P2P webhook events such as join
and disconnect
.
1. Enable Webhooks
Update your app/src/config.js
file to activate webhooks and set your endpoint:
JavaScript
webhook: {
enabled: true, // Enable webhook functionality
url: 'http://localhost:8888/webhook-endpoint', // Webhook server URL
},
2. Webhook Event Structure
When an event occurs, MiroTalk P2P sends an HTTP POST
request to your webhook endpoint with a JSON payload.
Sample Payload:
- event: The event type (
join
ordisconnect
) - data: Additional event-specific information
For a server-side example of handling webhook events, see this example.