many-helmet-9770
06/20/2025, 11:32 AMconst receiver = new WebhookReceiver(process.env.LIVEKIT_API_KEY!, process.env.LIVEKIT_API_SECRET!);
// Middleware to handle 'application/webhook+json' content type
const webhookJsonParser = express.json({
type: ['application/json', 'application/webhook+json']
});
<http://router.post|router.post>('/lk-webhook', webhookJsonParser, async (req, res) => {
try {
console.log('Received webhook with content type:', req.get('content-type'));
console.log('Authorization:', req.get('Authorization'));
const event = await receiver.receive(req.body, req.get('Authorization'));
console.log('Webhook event:', event);
res.status(200).json({ message: 'ok' });
} catch (ex) {
console.error('Error processing webhook:', ex);
res.status(500).json({
message: 'Failed to handle webhook',
error: ex instanceof Error ? ex.message : 'Unknown error'
});
}
});
I triple checked my API key, both in my env key and the one I used while creating webhook are the samemany-helmet-9770
06/20/2025, 12:40 PM