icy-jelly-75178
06/25/2025, 9:46 PMtall-airline-16756
06/25/2025, 9:47 PMtall-airline-16756
06/25/2025, 9:47 PMwebhook
section in your config file:
webhook:
# The API key to use to sign the message
# This must match one of the keys LiveKit is configured with
api_key: 'api-key-to-sign-with'
urls:
- '<https://yourhost>'
Receiving Webhooks:
• Set up an HTTP endpoint to receive POST requests.
• Ensure your server can handle the Content-Type: application/webhook+json
header.
• Use the WebhookReceiver from the LiveKit server SDK to validate and decode payloads:
import { WebhookReceiver } from 'livekit-server-sdk';
const receiver = new WebhookReceiver('apikey', 'apisecret');
// If using Express, ensure raw body parsing for webhook endpoint
// app.use(express.raw({type: 'application/webhook+json'}));
<http://app.post|app.post>('/webhook-endpoint', async (req, res) => {
// Event is a WebhookEvent object
const event = await receiver.receive(req.body, req.get('Authorization'));
});
Webhooks allow your server to be notified when room events take place, such as when a room has finished or when a participant leaves.
Sources: Webhooks | LiveKit Docs | LiveKit JS Server SDK - v2.9.7icy-jelly-75178
06/25/2025, 9:47 PMtall-airline-16756
06/25/2025, 9:48 PM--config
flag when starting the server - super easy!
• Or if you prefer, you can set the YAML content directly with the LIVEKIT_CONFIG
environment variable.
Here's a sample config file that works great for production deployments:
port: 7880
log_level: info
rtc:
tcp_port: 7881
port_range_start: 50000
port_range_end: 60000
use_external_ip: true
redis:
address: my-redis-server.name:6379
keys:
# key-value pairs
# your_api_key: <your_api_secret>
turn:
enabled: true
domain: <turn.myhost.com>
tls_port: 3478
For the Egress service:
• Just add the config file to a mounted volume and point to its location using the EGRESS_CONFIG_FILE
environment variable.
• Alternatively, you can set the config content directly with the EGRESS_CONFIG_BODY
environment variable.
For the Ingress service:
• Pass the config file location using the INGRESS_CONFIG_FILE
environment variable.
• Or set the config content directly with the INGRESS_CONFIG_BODY
environment variable. Sources: Deploying LiveKit | LiveKit Docs | Self-hosting the Egress Service | LiveKit Docs | Self-hosting the Ingress Service | LiveKit Docsicy-jelly-75178
06/25/2025, 10:24 PMtall-airline-16756
06/25/2025, 10:24 PMwebhook
section in your config file with your API keys and URLs.
For Egress-specific webhooks:
• Here's a cool feature: you can dynamically add extra webhooks right inside your Egress requests using the WebhookConfig
object. It's super flexible and includes:
◦ `url`: Where you want your webhook to send data
◦ `signing_key`: The API key that'll sign your request (just make sure it's defined for your project)
• These specific webhooks will trigger for Egress lifecycle events, giving you additional tracking on top of your project-wide webhooks. Sources: Webhooks | LiveKit Docs | Egress API | LiveKit Docsicy-jelly-75178
06/25/2025, 10:25 PMtall-airline-16756
06/25/2025, 10:26 PMwebhook
section.
• Think of these as your project's notification system - they'll keep you in the loop about room events like when a room wraps up or a participant drops out.
Egress-Specific Webhooks:
• These are like personalized notifications for a specific Egress request.
• They'll catch all the Egress lifecycle events, working right alongside your general webhooks.
• You'll set these up using the WebhookConfig
field when you're making an Egress request.
• Just make sure you have a URL and signing key defined for your project, and you're good to go!
Bottom line: General webhooks cover your whole project, while egress-specific webhooks give you those extra, tailored notifications for individual Egress requests. Pretty neat, right?
Sources: Webhooks | LiveKit Docs | Egress API | LiveKit Docsicy-jelly-75178
06/25/2025, 10:35 PMtall-airline-16756
06/25/2025, 10:35 PM