Repository navigation
voice AI demos: set up with the Hookdeck REST API, verify Hookdeck's signature, and use the LIVEKIT source type - #55
Merged
Conversation
…CLI is only for listen npm run setup in the Vapi, ElevenLabs, Retell and LiveKit demos now calls the Hookdeck API with fetch instead of running the Hookdeck CLI. Each setup is TypeScript from start to finish, so the tutorials can show the code it runs: - PUT /connections creates or updates the source, the CLI destination and the rules in one call, matched by name - PUT /sources sets the source's verification settings (config.auth) The new shared helper _shared/hookdeck/hookdeck-api.ts (API version 2026-09-01) is synced into the four demos. The probe scripts use it too. The Hookdeck CLI is still used by npm run listen, through the unchanged hookdeck-cli.ts and hookdeck-listen.ts. deepgram/stt-tts keeps its CLI-based setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each demo app now verifies x-hookdeck-signature (base64 HMAC-SHA256 of the raw body, keyed with HOOKDECK_SIGNING_SECRET from .env) before it does anything else, and answers 401 when it is missing or wrong. A rejected delivery is recorded in the app's deliveries list. The signature has no timestamp, so retries and replays hours later still pass. - Shared helper _shared/hookdeck/hookdeck-signature.ts, synced to src/ in the four demos, with unit tests - Vapi: both client routes; Retell: /webhooks/retell and /webhooks/retell-function; ElevenLabs and LiveKit: their one webhook route - ElevenLabs: the display-only SDK constructEvent check is gone; the page shows the Hookdeck signature result instead - LiveKit: the source is now the LIVEKIT type, so Event Gateway verifies LiveKit's token and rejects forgeries; the app's WebhookReceiver check and its retry clock tolerance are removed, and the bad-signature scene shows Event Gateway rejecting it - .env.example and READMEs: set HOOKDECK_SIGNING_SECRET next to HOOKDECK_API_KEY (the API key cannot read it) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ls in the connection call The API won't create a LIVEKIT source without config.auth, so setup failed in a new project. The source's API key and secret now go inline in PUT /connections, which sets them on create and updates them on a rerun, and the separate PUT /sources call is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e signing secret The Hookdeck dashboard shows the project API key and the signing secret on the same page, Project settings -> Secrets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r demos Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three changes to the four voice AI demos (Vapi, ElevenLabs, Retell, LiveKit), so the tutorials can show the code the demos run:
npm run setupcalls the Hookdeck REST API withfetchinstead of running the Hookdeck CLI. The CLI is only used bynpm run listen.x-hookdeck-signaturewithHOOKDECK_SIGNING_SECRETbefore doing anything, and answers401when it's missing or wrong.LIVEKITsource type. Event Gateway verifies LiveKit's token, so the app no longer checks it.Setup through the Hookdeck API
_shared/hookdeck/hookdeck-api.ts(API version2026-09-01), synced into the four demos through_shared/manifest.json.PUT /connectionscreates or updates the source, the CLI destination and the rules in one call, matched by name.PUT /sourcessets the signing secret on the ElevenLabs, Vapi and Retell sources (config.auth).config.authinline inPUT /connections, because the API won't create aLIVEKITsource without it.hookdeck-cli.tsandhookdeck-listen.ts(used bynpm run listen), anddeepgram/stt-tts, which keeps its CLI-based setup.Hookdeck signature check
_shared/hookdeck/hookdeck-signature.tscomputes the base64 HMAC-SHA256 of the raw body and compares it in constant time. It also acceptsx-hookdeck-signature-2, which Hookdeck sends while a rolled secret is still active..envnext toHOOKDECK_API_KEY. The API key can't read it, so setup can't fetch it. Each app exits with a hint at startup when it's missing.401.constructEventcheck is removed. It rejects timestamps older than 30 minutes, so it failed on late retries and replays.LiveKit on the
LIVEKITsource typeLIVEKITsource withLIVEKIT_API_KEYandLIVEKIT_API_SECRET. TheWEBHOOKoption is removed.WebhookReceivertoken check,src/verify.tsand the clock tolerance for retries are removed. The app checks Hookdeck's signature only.VERIFICATION_FAILED, no event,200to the sender).Dashboard location for the API key
deepgram/stt-tts,hookdeck/cli-fleet-fanout,hookdeck/mcp-events-forward-proxy,hookdeck/transformationsandhookdeck/binary-payloadspoint to Project settings -> Secrets for the project API key, the page that shows it with the signing secret.Tested
.envunchanged. LiveKit setup ran in a new Hookdeck project, created theLIVEKITsource and the LiveKit Cloud webhook, and needed the inlineconfig.authfix in1cb35f1.200.401on all five webhook routes.500, the same event was retried and passed the signature check.room_finishedclosed the call.VERIFICATION_FAILED.npm testpasses in all four demos, browser tests included (23, 46, 31 and 65 tests).npm run sync-shared -- --checkpasses.🤖 Generated with Claude Code