From dbdb7488fdc712946b0bf83a4f62fb225fb125e7 Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Thu, 19 Nov 2026 00:12:20 +0000 Subject: [PATCH 1/5] voice AI demos: set up Event Gateway with the Hookdeck REST API; the 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 --- README.md | 4 +- _shared/hookdeck/hookdeck-api.ts | 44 ++++++++++++++++ _shared/hookdeck/hookdeck-cli.ts | 2 +- _shared/manifest.json | 5 ++ deepgram/stt-tts/scripts/hookdeck-cli.ts | 2 +- elevenlabs/post-call-transcripts/.env.example | 5 +- elevenlabs/post-call-transcripts/README.md | 3 +- .../scripts/hookdeck-api.ts | 45 +++++++++++++++++ .../scripts/hookdeck-cli.ts | 2 +- .../post-call-transcripts/scripts/probe.ts | 10 ++-- .../post-call-transcripts/scripts/setup.ts | 31 ++++++------ livekit/voice-adventure/.env.example | 5 +- livekit/voice-adventure/README.md | 5 +- .../voice-adventure/scripts/hookdeck-api.ts | 45 +++++++++++++++++ .../voice-adventure/scripts/hookdeck-cli.ts | 2 +- .../voice-adventure/scripts/setup-hookdeck.ts | 50 ++++++++++--------- retell/outbound-lead-calling/.env.example | 5 +- retell/outbound-lead-calling/README.md | 3 +- .../scripts/hookdeck-api.ts | 45 +++++++++++++++++ .../scripts/hookdeck-cli.ts | 2 +- retell/outbound-lead-calling/scripts/probe.ts | 10 ++-- retell/outbound-lead-calling/scripts/setup.ts | 38 +++++++------- vapi/agency-routing/.env.example | 5 +- vapi/agency-routing/scripts/hookdeck-api.ts | 45 +++++++++++++++++ vapi/agency-routing/scripts/hookdeck-cli.ts | 2 +- vapi/agency-routing/scripts/probe.ts | 13 +++-- vapi/agency-routing/scripts/setup.ts | 49 +++++++++--------- 27 files changed, 359 insertions(+), 118 deletions(-) create mode 100644 _shared/hookdeck/hookdeck-api.ts create mode 100644 elevenlabs/post-call-transcripts/scripts/hookdeck-api.ts create mode 100644 livekit/voice-adventure/scripts/hookdeck-api.ts create mode 100644 retell/outbound-lead-calling/scripts/hookdeck-api.ts create mode 100644 vapi/agency-routing/scripts/hookdeck-api.ts diff --git a/README.md b/README.md index 5b9165f..16c7ac3 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ For example, `npx giget@latest gh:hookdeck/hookdeck-demos/deepgram/stt-tts my-de |---------|-------------| | [ds](_shared/ds/) | Hookdeck design system: tokens, styles and brand assets (copied into demos, see Shared code) | | [flow-drawer](_shared/flow-drawer/) | Bottom drawer that shows each message moving through Event Gateway to the app, live (client JS and CSS, plus a server module that reads the Hookdeck API) | -| [hookdeck](_shared/hookdeck/) | Hookdeck CLI helper and `hookdeck listen` wrapper (TypeScript) | +| [hookdeck](_shared/hookdeck/) | Hookdeck API helper for setup, and the Hookdeck CLI helper and `hookdeck listen` wrapper (TypeScript) | | [scenes](_shared/scenes/) | Scene kit: animated topology diagrams for a demo's live view, hookdeck.com guides and MP4 captures (TypeScript, SVG, GSAP) | | [theme](_shared/theme/) | Light/dark/system theme switch for the design system, with an optional demo theme and wording (`theme.js`) | | [tmux-presenter](_shared/tmux-presenter/) | Tmux-based live demo presenter for running scripted terminal demos | @@ -110,7 +110,7 @@ For example, `npx giget@latest gh:hookdeck/hookdeck-demos/deepgram/stt-tts my-de ## Shared code -Some code is the same in several demos: the Hookdeck design system (`ds/`), the Hookdeck CLI helpers (`scripts/hookdeck-cli.ts`, `scripts/hookdeck-listen.ts`), the data-flow drawer (`flow-drawer/`), the scene kit (`scenes/`), the topology pane (`topology-pane/`) and the theme switch (`theme.js`). So a demo still works when downloaded alone, each demo holds a real copy of what it uses. The source of truth is `_shared/`. +Some code is the same in several demos: the Hookdeck design system (`ds/`), the Hookdeck API and CLI helpers (`scripts/hookdeck-api.ts`, `scripts/hookdeck-cli.ts`, `scripts/hookdeck-listen.ts`), the data-flow drawer (`flow-drawer/`), the scene kit (`scenes/`), the topology pane (`topology-pane/`) and the theme switch (`theme.js`). So a demo still works when downloaded alone, each demo holds a real copy of what it uses. The source of truth is `_shared/`. - **Edit in `_shared/` only.** Copies carry a "Generated from" header (directories also have a `GENERATED.md`), so an edit in the wrong place is easy to spot in review. - **`_shared/manifest.json`** lists which demo takes which piece and where it goes inside the demo. A demo not listed for a piece may own its own copy. diff --git a/_shared/hookdeck/hookdeck-api.ts b/_shared/hookdeck/hookdeck-api.ts new file mode 100644 index 0000000..426eb08 --- /dev/null +++ b/_shared/hookdeck/hookdeck-api.ts @@ -0,0 +1,44 @@ +/** + * Hookdeck REST API helper for demo setup and probe scripts. + * + * Calls the API with the project API key in HOOKDECK_API_KEY (loaded from .env), so it + * works on the project that key belongs to. Setup creates the Event Gateway source, + * destination and connection with it; the Hookdeck CLI is only used by `npm run listen`. + * + * Needs Node 22+ (global fetch) and `dotenv` in the demo. + * + * const connection = await hookdeck('PUT', '/connections', { + * name: 'my-connection', + * source: { name: 'my-source', type: 'WEBHOOK' }, + * destination: { name: 'local-my-app', type: 'CLI', config: { path: '/webhooks' } }, + * }); + * console.log(connection.source.url); + * + * API reference: https://hookdeck.com/docs/api + */ +import 'dotenv/config'; + +export const HOOKDECK_API_BASE = 'https://api.hookdeck.com/2026-09-01'; + +/** The project API key from HOOKDECK_API_KEY. Exits with a hint when it isn't set. */ +export function requireHookdeckApiKey(): string { + const key = process.env.HOOKDECK_API_KEY; + if (!key || key.startsWith('your_')) { + console.error('❌ HOOKDECK_API_KEY is not set. Add a project API key to .env'); + console.error(' (Hookdeck dashboard: Project settings -> API keys).'); + process.exit(1); + } + return key; +} + +/** Calls the Hookdeck API and returns the parsed JSON response. Throws on a non-2xx status. */ +export async function hookdeck(method: string, route: string, body?: unknown): Promise { + const response = await fetch(`${HOOKDECK_API_BASE}${route}`, { + method, + headers: { authorization: `Bearer ${requireHookdeckApiKey()}`, 'content-type': 'application/json' }, + body: body === undefined ? undefined : JSON.stringify(body), + }); + const text = await response.text(); + if (!response.ok) throw new Error(`Hookdeck API ${method} ${route} -> ${response.status}: ${text.slice(0, 300)}`); + return text ? JSON.parse(text) : (undefined as T); +} diff --git a/_shared/hookdeck/hookdeck-cli.ts b/_shared/hookdeck/hookdeck-cli.ts index 888b209..0189b97 100644 --- a/_shared/hookdeck/hookdeck-cli.ts +++ b/_shared/hookdeck/hookdeck-cli.ts @@ -200,7 +200,7 @@ export function createHookdeckCli(options: HookdeckCliOptions = {}) { return withPrivateJson(`rules-${spec.name}.json`, spec.rules, (file) => json([...args, '--rules-file', file])); } - /** Reads from the Hookdeck API with the project API key. The demos' probe scripts use it to find a source and list its requests; setup goes through the CLI only. */ + /** Calls the Hookdeck API with the project API key. Demos that set up through the API use hookdeck-api.ts instead. */ async function api(method: string, route: string, body?: unknown): Promise { const response = await fetch(`${api_base}${route}`, { method, diff --git a/_shared/manifest.json b/_shared/manifest.json index 13b369b..4d5e9e5 100644 --- a/_shared/manifest.json +++ b/_shared/manifest.json @@ -2,6 +2,7 @@ "pieces": { "ds": "_shared/ds", "hookdeck-cli": "_shared/hookdeck/hookdeck-cli.ts", + "hookdeck-api": "_shared/hookdeck/hookdeck-api.ts", "hookdeck-listen": "_shared/hookdeck/hookdeck-listen.ts", "flow-drawer": "_shared/flow-drawer/client", "flow-drawer-server": "_shared/flow-drawer/server.ts", @@ -26,6 +27,7 @@ }, "vapi/agency-routing": { "ds": "public/ds", + "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", "flow-drawer-server": "src/flow-drawer-server.ts", @@ -35,6 +37,7 @@ }, "elevenlabs/post-call-transcripts": { "ds": "public/ds", + "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", "flow-drawer-server": "src/flow-drawer-server.ts", @@ -44,6 +47,7 @@ }, "retell/outbound-lead-calling": { "ds": "public/ds", + "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", "flow-drawer-server": "src/flow-drawer-server.ts", @@ -53,6 +57,7 @@ }, "livekit/voice-adventure": { "ds": "public/ds", + "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", "flow-drawer-server": "src/flow-drawer-server.ts", diff --git a/deepgram/stt-tts/scripts/hookdeck-cli.ts b/deepgram/stt-tts/scripts/hookdeck-cli.ts index 548dd35..fe900a2 100644 --- a/deepgram/stt-tts/scripts/hookdeck-cli.ts +++ b/deepgram/stt-tts/scripts/hookdeck-cli.ts @@ -201,7 +201,7 @@ export function createHookdeckCli(options: HookdeckCliOptions = {}) { return withPrivateJson(`rules-${spec.name}.json`, spec.rules, (file) => json([...args, '--rules-file', file])); } - /** Reads from the Hookdeck API with the project API key. The demos' probe scripts use it to find a source and list its requests; setup goes through the CLI only. */ + /** Calls the Hookdeck API with the project API key. Demos that set up through the API use hookdeck-api.ts instead. */ async function api(method: string, route: string, body?: unknown): Promise { const response = await fetch(`${api_base}${route}`, { method, diff --git a/elevenlabs/post-call-transcripts/.env.example b/elevenlabs/post-call-transcripts/.env.example index d183fd9..ab8ecee 100644 --- a/elevenlabs/post-call-transcripts/.env.example +++ b/elevenlabs/post-call-transcripts/.env.example @@ -9,8 +9,9 @@ ELEVENLABS_AGENT_ID= # Hookdeck project API key (REQUIRED) # Hookdeck dashboard: Project settings -> API keys. `npm run setup` creates the -# connection in this project and `npm run listen` forwards its source, using a CLI -# config file of its own, so your interactive `hookdeck login` is untouched. +# connection in this project with the Hookdeck API. `npm run listen` forwards its +# source with the Hookdeck CLI, using a config file of its own, so your interactive +# `hookdeck login` is untouched. HOOKDECK_API_KEY=your_hookdeck_api_key_here # Server port (optional) diff --git a/elevenlabs/post-call-transcripts/README.md b/elevenlabs/post-call-transcripts/README.md index fceae86..563157e 100644 --- a/elevenlabs/post-call-transcripts/README.md +++ b/elevenlabs/post-call-transcripts/README.md @@ -167,7 +167,8 @@ elevenlabs/post-call-transcripts/ │ ├── call.ts # text-only conversation with the agent │ ├── send-sample.ts # signed sample payloads, duplicates, large bodies │ ├── probe.ts # checks that a good signature is accepted and a bad one rejected -│ └── hookdeck-cli.ts # runs the Hookdeck CLI against HOOKDECK_API_KEY's project (synced from _shared) +│ ├── hookdeck-api.ts # calls the Hookdeck API with HOOKDECK_API_KEY (synced from _shared) +│ └── hookdeck-cli.ts # runs the Hookdeck CLI for npm run listen (synced from _shared) ├── scenes/ │ ├── post-call.ts # the topology scene: live, and four scripted scenarios (desktop + phone) │ ├── entry.ts # what the page's bundle exposes diff --git a/elevenlabs/post-call-transcripts/scripts/hookdeck-api.ts b/elevenlabs/post-call-transcripts/scripts/hookdeck-api.ts new file mode 100644 index 0000000..cc1d312 --- /dev/null +++ b/elevenlabs/post-call-transcripts/scripts/hookdeck-api.ts @@ -0,0 +1,45 @@ +// Generated from `_shared/hookdeck/hookdeck-api.ts`; edit there and run `npm run sync-shared`. +/** + * Hookdeck REST API helper for demo setup and probe scripts. + * + * Calls the API with the project API key in HOOKDECK_API_KEY (loaded from .env), so it + * works on the project that key belongs to. Setup creates the Event Gateway source, + * destination and connection with it; the Hookdeck CLI is only used by `npm run listen`. + * + * Needs Node 22+ (global fetch) and `dotenv` in the demo. + * + * const connection = await hookdeck('PUT', '/connections', { + * name: 'my-connection', + * source: { name: 'my-source', type: 'WEBHOOK' }, + * destination: { name: 'local-my-app', type: 'CLI', config: { path: '/webhooks' } }, + * }); + * console.log(connection.source.url); + * + * API reference: https://hookdeck.com/docs/api + */ +import 'dotenv/config'; + +export const HOOKDECK_API_BASE = 'https://api.hookdeck.com/2026-09-01'; + +/** The project API key from HOOKDECK_API_KEY. Exits with a hint when it isn't set. */ +export function requireHookdeckApiKey(): string { + const key = process.env.HOOKDECK_API_KEY; + if (!key || key.startsWith('your_')) { + console.error('❌ HOOKDECK_API_KEY is not set. Add a project API key to .env'); + console.error(' (Hookdeck dashboard: Project settings -> API keys).'); + process.exit(1); + } + return key; +} + +/** Calls the Hookdeck API and returns the parsed JSON response. Throws on a non-2xx status. */ +export async function hookdeck(method: string, route: string, body?: unknown): Promise { + const response = await fetch(`${HOOKDECK_API_BASE}${route}`, { + method, + headers: { authorization: `Bearer ${requireHookdeckApiKey()}`, 'content-type': 'application/json' }, + body: body === undefined ? undefined : JSON.stringify(body), + }); + const text = await response.text(); + if (!response.ok) throw new Error(`Hookdeck API ${method} ${route} -> ${response.status}: ${text.slice(0, 300)}`); + return text ? JSON.parse(text) : (undefined as T); +} diff --git a/elevenlabs/post-call-transcripts/scripts/hookdeck-cli.ts b/elevenlabs/post-call-transcripts/scripts/hookdeck-cli.ts index 548dd35..fe900a2 100644 --- a/elevenlabs/post-call-transcripts/scripts/hookdeck-cli.ts +++ b/elevenlabs/post-call-transcripts/scripts/hookdeck-cli.ts @@ -201,7 +201,7 @@ export function createHookdeckCli(options: HookdeckCliOptions = {}) { return withPrivateJson(`rules-${spec.name}.json`, spec.rules, (file) => json([...args, '--rules-file', file])); } - /** Reads from the Hookdeck API with the project API key. The demos' probe scripts use it to find a source and list its requests; setup goes through the CLI only. */ + /** Calls the Hookdeck API with the project API key. Demos that set up through the API use hookdeck-api.ts instead. */ async function api(method: string, route: string, body?: unknown): Promise { const response = await fetch(`${api_base}${route}`, { method, diff --git a/elevenlabs/post-call-transcripts/scripts/probe.ts b/elevenlabs/post-call-transcripts/scripts/probe.ts index e04842e..2ff19b6 100644 --- a/elevenlabs/post-call-transcripts/scripts/probe.ts +++ b/elevenlabs/post-call-transcripts/scripts/probe.ts @@ -12,7 +12,8 @@ */ import 'dotenv/config'; import * as crypto from 'crypto'; -import { SOURCE_NAME, cli } from './config'; +import { SOURCE_NAME } from './config'; +import { hookdeck } from './hookdeck-api'; const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); @@ -23,8 +24,7 @@ async function main(): Promise { console.error('ELEVENLABS_WEBHOOK_SECRET and ELEVENLABS_WEBHOOK_URL are not set. Run npm run setup first.'); process.exit(1); } - cli.login(); - const source = (await cli.api('GET', `/sources?name=${encodeURIComponent(SOURCE_NAME)}`)).models[0]; + const source = (await hookdeck('GET', `/sources?name=${encodeURIComponent(SOURCE_NAME)}`)).models[0]; let all_ok = true; for (const good of [true, false]) { const conversation_id = `probe_${good ? 'good' : 'bad'}_${crypto.randomBytes(4).toString('hex')}`; @@ -43,9 +43,9 @@ async function main(): Promise { let record: any; for (let i = 0; i < 8 && !record; i++) { await sleep(1500); - const list = await cli.api('GET', `/requests?source_id=${source.id}&limit=20`); + const list = await hookdeck('GET', `/requests?source_id=${source.id}&limit=20`); for (const summary of list.models) { - const detail = await cli.api('GET', `/requests/${summary.id}`); + const detail = await hookdeck('GET', `/requests/${summary.id}`); if (detail.data?.body?.data?.conversation_id === conversation_id) { record = detail; break; } } } diff --git a/elevenlabs/post-call-transcripts/scripts/setup.ts b/elevenlabs/post-call-transcripts/scripts/setup.ts index dc5265e..2bb9cac 100644 --- a/elevenlabs/post-call-transcripts/scripts/setup.ts +++ b/elevenlabs/post-call-transcripts/scripts/setup.ts @@ -1,7 +1,7 @@ /** * Sets up both sides of the demo. Idempotent: safe to run multiple times. * - * Hookdeck (project of HOOKDECK_API_KEY): + * Hookdeck (project of HOOKDECK_API_KEY, through the Hookdeck API): * source elevenlabs-post-call (type ELEVENLABS) -> CLI destination local-elevenlabs (/webhooks/elevenlabs) * connection rules: deduplicate on event type + conversation_id, retry up to 5 times * @@ -22,7 +22,8 @@ import 'dotenv/config'; import { ElevenLabsClient } from '@elevenlabs/elevenlabs-js'; import * as fs from 'fs'; import * as path from 'path'; -import { CLI_PATH, CONNECTION_NAME, DESTINATION_NAME, SOURCE_NAME, cli } from './config'; +import { CLI_PATH, CONNECTION_NAME, DESTINATION_NAME, SOURCE_NAME } from './config'; +import { hookdeck, requireHookdeckApiKey } from './hookdeck-api'; const PROJECT_DIR = path.join(__dirname, '..'); const ENV_FILE = path.join(PROJECT_DIR, '.env'); @@ -102,16 +103,15 @@ function writeEnv(values: { [key: string]: string }): void { fs.writeFileSync(ENV_FILE, env); } +/** + * Creates the connection with the Hookdeck API. One PUT /connections creates or updates the + * ELEVENLABS source, the CLI destination and the rules, matched by name. + */ async function setupHookdeck(): Promise<{ source_url: string; source_id: string }> { - cli.login(); - console.log(cli.whoami() || 'Not logged in: check HOOKDECK_API_KEY in .env'); - - const destination = cli.upsertCliDestination({ name: DESTINATION_NAME, path: CLI_PATH }); - const connection = cli.upsertConnection({ + const connection = await hookdeck('PUT', '/connections', { name: CONNECTION_NAME, - sourceName: SOURCE_NAME, - sourceType: 'ELEVENLABS', - destinationId: destination.id, + source: { name: SOURCE_NAME, type: 'ELEVENLABS' }, + destination: { name: DESTINATION_NAME, type: 'CLI', config: { path: CLI_PATH } }, rules: RULES, }); console.log(`Hookdeck: ${connection.source.url} -> ${DESTINATION_NAME} (${CLI_PATH})`); @@ -119,14 +119,14 @@ async function setupHookdeck(): Promise<{ source_url: string; source_id: string } /** - * Sets the signing secret on the source through the CLI (config.auth). The header name, - * algorithm and timestamp format are fixed by the ELEVENLABS source type, so only the secret is needed. + * Sets the signing secret on the source (config.auth). The header name, algorithm and + * timestamp format are fixed by the ELEVENLABS source type, so only the secret is needed. */ async function setSourceSecret(secret: string): Promise { - const source = cli.upsertSource({ + const source = await hookdeck('PUT', '/sources', { name: SOURCE_NAME, type: 'ELEVENLABS', - auth: { webhook_secret_key: secret }, + config: { auth: { webhook_secret_key: secret } }, }); console.log(`Hookdeck: signature verification enabled on the source (auth ${source.config?.auth ? 'set' : 'NOT set'})`); } @@ -183,6 +183,7 @@ async function setupElevenLabs(source_url: string): Promise<{ id: string; secret } async function main(): Promise { + requireHookdeckApiKey(); const { source_url } = await setupHookdeck(); const { id, secret, agent_id } = await setupElevenLabs(source_url); if (secret) await setSourceSecret(secret); @@ -198,6 +199,6 @@ async function main(): Promise { } main().catch((error) => { - console.error('Setup failed:', error.stderr?.toString().trim() || error.message || error); + console.error('Setup failed:', error.message || error); process.exit(1); }); diff --git a/livekit/voice-adventure/.env.example b/livekit/voice-adventure/.env.example index 4ed46e4..4302a4d 100644 --- a/livekit/voice-adventure/.env.example +++ b/livekit/voice-adventure/.env.example @@ -6,8 +6,9 @@ LIVEKIT_API_SECRET=your_livekit_api_secret # Hookdeck project API key (REQUIRED) # Hookdeck dashboard: Project settings -> API keys. `npm run setup` creates the -# connection in this project and `npm run listen` forwards its source, using a CLI -# config file of its own, so your interactive `hookdeck login` is untouched. +# connection in this project with the Hookdeck API. `npm run listen` forwards its +# source with the Hookdeck CLI, using a config file of its own, so your interactive +# `hookdeck login` is untouched. HOOKDECK_API_KEY=your_hookdeck_api_key_here # Server port (optional), and the address it listens on. The default 127.0.0.1 keeps it local; 0.0.0.0 opens it to your network. diff --git a/livekit/voice-adventure/README.md b/livekit/voice-adventure/README.md index d296959..3196c80 100644 --- a/livekit/voice-adventure/README.md +++ b/livekit/voice-adventure/README.md @@ -55,7 +55,7 @@ cp .env.example .env npm run setup ``` -This creates a `livekit-voice-adventure` source, a CLI destination that forwards to `/webhooks/livekit`, and the connection between them with a deduplicate rule and a retry rule. It writes the source URL to `LIVEKIT_WEBHOOK_URL` in `.env`. The script is idempotent. It logs the bundled Hookdeck CLI in to the project for `HOOKDECK_API_KEY` with a config file of its own, so your interactive `hookdeck login` is untouched. +This creates a `livekit-voice-adventure` source, a CLI destination that forwards to `/webhooks/livekit`, and the connection between them with a deduplicate rule and a retry rule. It writes the source URL to `LIVEKIT_WEBHOOK_URL` in `.env`. The script is idempotent. It calls the Hookdeck API with `HOOKDECK_API_KEY`, so your interactive `hookdeck login` is untouched. ### 4. Add the webhook in LiveKit Cloud @@ -228,7 +228,8 @@ livekit/voice-adventure/ │ ├── activity.sh # Creates a room and joins test participants with the lk CLI │ ├── simulate.ts # Sends signed events (or a bad signature, or a duplicate) to the source │ ├── livekit-cloud.ts # Creates the LiveKit Cloud webhook through the management API -│ ├── hookdeck-cli.ts # Synced from _shared: runs the Hookdeck CLI against the API key's project +│ ├── hookdeck-api.ts # Synced from _shared: calls the Hookdeck API with the API key +│ ├── hookdeck-cli.ts # Synced from _shared: runs the Hookdeck CLI for npm run listen │ ├── listen.ts # npm run listen │ └── setup-hookdeck.ts # npm run setup ├── src/ diff --git a/livekit/voice-adventure/scripts/hookdeck-api.ts b/livekit/voice-adventure/scripts/hookdeck-api.ts new file mode 100644 index 0000000..cc1d312 --- /dev/null +++ b/livekit/voice-adventure/scripts/hookdeck-api.ts @@ -0,0 +1,45 @@ +// Generated from `_shared/hookdeck/hookdeck-api.ts`; edit there and run `npm run sync-shared`. +/** + * Hookdeck REST API helper for demo setup and probe scripts. + * + * Calls the API with the project API key in HOOKDECK_API_KEY (loaded from .env), so it + * works on the project that key belongs to. Setup creates the Event Gateway source, + * destination and connection with it; the Hookdeck CLI is only used by `npm run listen`. + * + * Needs Node 22+ (global fetch) and `dotenv` in the demo. + * + * const connection = await hookdeck('PUT', '/connections', { + * name: 'my-connection', + * source: { name: 'my-source', type: 'WEBHOOK' }, + * destination: { name: 'local-my-app', type: 'CLI', config: { path: '/webhooks' } }, + * }); + * console.log(connection.source.url); + * + * API reference: https://hookdeck.com/docs/api + */ +import 'dotenv/config'; + +export const HOOKDECK_API_BASE = 'https://api.hookdeck.com/2026-09-01'; + +/** The project API key from HOOKDECK_API_KEY. Exits with a hint when it isn't set. */ +export function requireHookdeckApiKey(): string { + const key = process.env.HOOKDECK_API_KEY; + if (!key || key.startsWith('your_')) { + console.error('❌ HOOKDECK_API_KEY is not set. Add a project API key to .env'); + console.error(' (Hookdeck dashboard: Project settings -> API keys).'); + process.exit(1); + } + return key; +} + +/** Calls the Hookdeck API and returns the parsed JSON response. Throws on a non-2xx status. */ +export async function hookdeck(method: string, route: string, body?: unknown): Promise { + const response = await fetch(`${HOOKDECK_API_BASE}${route}`, { + method, + headers: { authorization: `Bearer ${requireHookdeckApiKey()}`, 'content-type': 'application/json' }, + body: body === undefined ? undefined : JSON.stringify(body), + }); + const text = await response.text(); + if (!response.ok) throw new Error(`Hookdeck API ${method} ${route} -> ${response.status}: ${text.slice(0, 300)}`); + return text ? JSON.parse(text) : (undefined as T); +} diff --git a/livekit/voice-adventure/scripts/hookdeck-cli.ts b/livekit/voice-adventure/scripts/hookdeck-cli.ts index 548dd35..fe900a2 100644 --- a/livekit/voice-adventure/scripts/hookdeck-cli.ts +++ b/livekit/voice-adventure/scripts/hookdeck-cli.ts @@ -201,7 +201,7 @@ export function createHookdeckCli(options: HookdeckCliOptions = {}) { return withPrivateJson(`rules-${spec.name}.json`, spec.rules, (file) => json([...args, '--rules-file', file])); } - /** Reads from the Hookdeck API with the project API key. The demos' probe scripts use it to find a source and list its requests; setup goes through the CLI only. */ + /** Calls the Hookdeck API with the project API key. Demos that set up through the API use hookdeck-api.ts instead. */ async function api(method: string, route: string, body?: unknown): Promise { const response = await fetch(`${api_base}${route}`, { method, diff --git a/livekit/voice-adventure/scripts/setup-hookdeck.ts b/livekit/voice-adventure/scripts/setup-hookdeck.ts index 8959222..755dd18 100644 --- a/livekit/voice-adventure/scripts/setup-hookdeck.ts +++ b/livekit/voice-adventure/scripts/setup-hookdeck.ts @@ -5,8 +5,8 @@ * source livekit-voice-adventure -> destination local-livekit-voice-adventure (CLI, /webhooks/livekit), * with a deduplicate rule (body.id) and an exponential retry rule * - * Uses the project whose HOOKDECK_API_KEY is in .env, through the hookdeck-cli - * npm dependency with a config file of its own (see hookdeck-cli.ts). + * Uses the project whose HOOKDECK_API_KEY is in .env, through the Hookdeck API + * (see hookdeck-api.ts). * * TODO(hookdeck/core#6254): the LIVEKIT branch below is for when the LiveKit source * type ships; see the commented section in the README. Until then the source type @@ -18,11 +18,12 @@ */ import * as fs from 'fs'; import * as path from 'path'; -import { SOURCE, cli } from './config'; +import { SOURCE } from './config'; +import { hookdeck, requireHookdeckApiKey } from './hookdeck-api'; import { RETRY_RULE } from '../src/config'; import { CLI_CONFIG_PATH, ensureWebhook, readCliConfig, resolveSession } from './livekit-cloud'; -const PROJECT_DIR = cli.projectDir; +const PROJECT_DIR = path.join(__dirname, '..'); const ENV_FILE = path.join(PROJECT_DIR, '.env'); const ENV_EXAMPLE_FILE = path.join(PROJECT_DIR, '.env.example'); @@ -48,27 +49,15 @@ function writeEnv(values: { [key: string]: string }): void { async function main(): Promise { require('dotenv').config({ path: ENV_FILE }); - cli.login(); - console.log(cli.whoami() || 'Not logged in: check HOOKDECK_API_KEY in .env'); + requireHookdeckApiKey(); const source_type = (process.env.LIVEKIT_SOURCE_TYPE || 'WEBHOOK').toUpperCase(); - let auth: Record | undefined; - if (source_type === 'LIVEKIT') { - // The LiveKit source type verifies deliveries with your project's API key and secret - const { LIVEKIT_API_KEY, LIVEKIT_API_SECRET } = process.env; - if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET) { - console.error('LIVEKIT_API_KEY and LIVEKIT_API_SECRET must be set in .env for the LIVEKIT source type.'); - process.exit(1); - } - // Both fields live under the source's config.auth; upsertSource sets them through the CLI. - auth = { api_key: LIVEKIT_API_KEY, api_secret: LIVEKIT_API_SECRET }; - } - const source = cli.upsertSource({ name: SOURCE, type: source_type, auth }); - const destination = cli.upsertCliDestination({ name: DESTINATION, path: CLI_PATH }); - const connection = cli.upsertConnection({ + + // PUT /connections creates or updates the source, the CLI destination and the rules, matched by name. + const connection = await hookdeck('PUT', '/connections', { name: CONNECTION, - sourceId: source.id, - destinationId: destination.id, + source: { name: SOURCE, type: source_type }, + destination: { name: DESTINATION, type: 'CLI', config: { path: CLI_PATH } }, rules: [ // The same LiveKit event id inside 10 minutes is a duplicate. The API takes the window in milliseconds. { type: 'deduplicate', window: 600000, include_fields: ['body.id'] }, @@ -77,6 +66,21 @@ async function main(): Promise { ], }); + if (source_type === 'LIVEKIT') { + // The LiveKit source type verifies deliveries with your project's API key and secret + const { LIVEKIT_API_KEY, LIVEKIT_API_SECRET } = process.env; + if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET) { + console.error('LIVEKIT_API_KEY and LIVEKIT_API_SECRET must be set in .env for the LIVEKIT source type.'); + process.exit(1); + } + // PUT /sources sets the source's verification settings (config.auth). + await hookdeck('PUT', '/sources', { + name: SOURCE, + type: source_type, + config: { auth: { api_key: LIVEKIT_API_KEY, api_secret: LIVEKIT_API_SECRET } }, + }); + } + console.log(`${CONNECTION}: ${connection.source.url} (${source_type}) -> ${DESTINATION} (${CLI_PATH})`); console.log(''); writeEnv({ LIVEKIT_WEBHOOK_URL: connection.source.url }); @@ -112,6 +116,6 @@ async function registerLiveKitWebhook(url: string): Promise { } main().catch((error: any) => { - console.error('Setup failed:', error.stderr?.toString().trim() || error.message); + console.error('Setup failed:', error.message); process.exit(1); }); diff --git a/retell/outbound-lead-calling/.env.example b/retell/outbound-lead-calling/.env.example index 3ab7bb1..2f4d6c2 100644 --- a/retell/outbound-lead-calling/.env.example +++ b/retell/outbound-lead-calling/.env.example @@ -1,7 +1,8 @@ # Hookdeck project API key (REQUIRED) # Hookdeck dashboard: Project settings -> API keys. `npm run setup` creates the -# connections in this project and `npm run listen` forwards its sources, using a -# CLI config file of its own, so your interactive `hookdeck login` is untouched. +# connections in this project with the Hookdeck API. `npm run listen` forwards its +# sources with the Hookdeck CLI, using a config file of its own, so your interactive +# `hookdeck login` is untouched. HOOKDECK_API_KEY=your_hookdeck_api_key_here # Retell API key (REQUIRED, server only: creates the agent, receives the webhook signature check) diff --git a/retell/outbound-lead-calling/README.md b/retell/outbound-lead-calling/README.md index fbe111a..7dfd3c9 100644 --- a/retell/outbound-lead-calling/README.md +++ b/retell/outbound-lead-calling/README.md @@ -114,7 +114,8 @@ retell/outbound-lead-calling/ │ ├── listen.ts # hookdeck listen for the demo's sources │ ├── simulate.ts # signed sample events, duplicates, bad signatures │ ├── probe.ts # signed + badly signed requests, checked against Hookdeck's request records -│ └── hookdeck-cli.ts # shared helper (_shared/hookdeck): runs the CLI against the API key's project +│ ├── hookdeck-api.ts # shared helper (_shared/hookdeck): calls the Hookdeck API with the API key +│ └── hookdeck-cli.ts # shared helper (_shared/hookdeck): runs the CLI for npm run listen ├── src/ │ ├── server.ts # form API, webhook endpoints, failure injection │ ├── retell.ts # create-phone-call and update-live-call (the web call runs in the browser) diff --git a/retell/outbound-lead-calling/scripts/hookdeck-api.ts b/retell/outbound-lead-calling/scripts/hookdeck-api.ts new file mode 100644 index 0000000..cc1d312 --- /dev/null +++ b/retell/outbound-lead-calling/scripts/hookdeck-api.ts @@ -0,0 +1,45 @@ +// Generated from `_shared/hookdeck/hookdeck-api.ts`; edit there and run `npm run sync-shared`. +/** + * Hookdeck REST API helper for demo setup and probe scripts. + * + * Calls the API with the project API key in HOOKDECK_API_KEY (loaded from .env), so it + * works on the project that key belongs to. Setup creates the Event Gateway source, + * destination and connection with it; the Hookdeck CLI is only used by `npm run listen`. + * + * Needs Node 22+ (global fetch) and `dotenv` in the demo. + * + * const connection = await hookdeck('PUT', '/connections', { + * name: 'my-connection', + * source: { name: 'my-source', type: 'WEBHOOK' }, + * destination: { name: 'local-my-app', type: 'CLI', config: { path: '/webhooks' } }, + * }); + * console.log(connection.source.url); + * + * API reference: https://hookdeck.com/docs/api + */ +import 'dotenv/config'; + +export const HOOKDECK_API_BASE = 'https://api.hookdeck.com/2026-09-01'; + +/** The project API key from HOOKDECK_API_KEY. Exits with a hint when it isn't set. */ +export function requireHookdeckApiKey(): string { + const key = process.env.HOOKDECK_API_KEY; + if (!key || key.startsWith('your_')) { + console.error('❌ HOOKDECK_API_KEY is not set. Add a project API key to .env'); + console.error(' (Hookdeck dashboard: Project settings -> API keys).'); + process.exit(1); + } + return key; +} + +/** Calls the Hookdeck API and returns the parsed JSON response. Throws on a non-2xx status. */ +export async function hookdeck(method: string, route: string, body?: unknown): Promise { + const response = await fetch(`${HOOKDECK_API_BASE}${route}`, { + method, + headers: { authorization: `Bearer ${requireHookdeckApiKey()}`, 'content-type': 'application/json' }, + body: body === undefined ? undefined : JSON.stringify(body), + }); + const text = await response.text(); + if (!response.ok) throw new Error(`Hookdeck API ${method} ${route} -> ${response.status}: ${text.slice(0, 300)}`); + return text ? JSON.parse(text) : (undefined as T); +} diff --git a/retell/outbound-lead-calling/scripts/hookdeck-cli.ts b/retell/outbound-lead-calling/scripts/hookdeck-cli.ts index 548dd35..fe900a2 100644 --- a/retell/outbound-lead-calling/scripts/hookdeck-cli.ts +++ b/retell/outbound-lead-calling/scripts/hookdeck-cli.ts @@ -201,7 +201,7 @@ export function createHookdeckCli(options: HookdeckCliOptions = {}) { return withPrivateJson(`rules-${spec.name}.json`, spec.rules, (file) => json([...args, '--rules-file', file])); } - /** Reads from the Hookdeck API with the project API key. The demos' probe scripts use it to find a source and list its requests; setup goes through the CLI only. */ + /** Calls the Hookdeck API with the project API key. Demos that set up through the API use hookdeck-api.ts instead. */ async function api(method: string, route: string, body?: unknown): Promise { const response = await fetch(`${api_base}${route}`, { method, diff --git a/retell/outbound-lead-calling/scripts/probe.ts b/retell/outbound-lead-calling/scripts/probe.ts index 478f252..40160d2 100644 --- a/retell/outbound-lead-calling/scripts/probe.ts +++ b/retell/outbound-lead-calling/scripts/probe.ts @@ -15,7 +15,8 @@ import 'dotenv/config'; import * as crypto from 'crypto'; import { signRetellBody } from '../src/retell-signature'; -import { EVENTS_SOURCE, FUNCTION_SOURCE, cli } from './config'; +import { EVENTS_SOURCE, FUNCTION_SOURCE } from './config'; +import { hookdeck } from './hookdeck-api'; const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); @@ -26,7 +27,7 @@ const payloads: { [source: string]: (id: string) => object } = { }; async function probeSource(name: string, secret: string): Promise { - const source = (await cli.api('GET', `/sources?name=${encodeURIComponent(name)}`)).models[0]; + const source = (await hookdeck('GET', `/sources?name=${encodeURIComponent(name)}`)).models[0]; if (!source) { console.log(`SKIP ${name}: source not found (run npm run setup)`); return true; @@ -45,9 +46,9 @@ async function probeSource(name: string, secret: string): Promise { let record: any; for (let i = 0; i < 8 && !record; i++) { await sleep(1500); - const list = await cli.api('GET', `/requests?source_id=${source.id}&limit=20`); + const list = await hookdeck('GET', `/requests?source_id=${source.id}&limit=20`); for (const summary of list.models) { - const detail = await cli.api('GET', `/requests/${summary.id}`); + const detail = await hookdeck('GET', `/requests/${summary.id}`); if (detail.data?.body?.call?.call_id === call_id) { record = detail; break; } } } @@ -67,7 +68,6 @@ async function main(): Promise { console.error('RETELL_SECRET_KEY (or RETELL_API_KEY) is not set in .env.'); process.exit(1); } - cli.login(); let all_ok = true; for (const name of [EVENTS_SOURCE, FUNCTION_SOURCE]) all_ok = (await probeSource(name, secret)) && all_ok; console.log(all_ok ? '\nVerification is ON.' : '\nVerification check FAILED.'); diff --git a/retell/outbound-lead-calling/scripts/setup.ts b/retell/outbound-lead-calling/scripts/setup.ts index 04d356c..b6b54ed 100644 --- a/retell/outbound-lead-calling/scripts/setup.ts +++ b/retell/outbound-lead-calling/scripts/setup.ts @@ -6,14 +6,14 @@ * 2. Retell: a Retell LLM (the prompt and tools) and a voice agent whose `webhook_url` * is the Hookdeck source URL, so the account's own webhook setting stays untouched. * - * Uses the project whose HOOKDECK_API_KEY is in .env, through the hookdeck-cli npm - * dependency with a config file of its own (see hookdeck-cli.ts). + * Uses the project whose HOOKDECK_API_KEY is in .env, through the Hookdeck API + * (see hookdeck-api.ts). */ import 'dotenv/config'; import * as fs from 'fs'; import * as path from 'path'; -import { cli } from './config'; -const PROJECT_DIR = cli.projectDir; +import { hookdeck, requireHookdeckApiKey } from './hookdeck-api'; +const PROJECT_DIR = path.join(__dirname, '..'); import { RETELL_API_BASE } from '../src/config'; const ENV_FILE = path.join(PROJECT_DIR, '.env'); @@ -59,20 +59,23 @@ if (WITH_FUNCTION) { }); } +/** + * Creates the flow's connection with the Hookdeck API, then turns on signature verification. + * PUT /connections creates or updates the RETELL source, the CLI destination and the rules, + * matched by name. PUT /sources sets the source's verification settings (config.auth). + */ async function setupFlow(flow: Flow): Promise { - // Retell signs every webhook with the API key that carries the webhook badge. Signature - // settings live under the source's config.auth; upsertSource sets them through the CLI. - const source = cli.upsertSource({ + const connection = await hookdeck('PUT', '/connections', { name: flow.name, - type: 'RETELL', - auth: { webhook_secret_key: RETELL_SECRET_KEY }, + source: { name: flow.name, type: 'RETELL' }, + destination: { name: `local-${flow.name}`, type: 'CLI', config: { path: flow.cliPath } }, + rules: flow.rules, }); - const destination = cli.upsertCliDestination({ name: `local-${flow.name}`, path: flow.cliPath }); - const connection = cli.upsertConnection({ + // Retell signs every webhook with the API key that carries the webhook badge. + await hookdeck('PUT', '/sources', { name: flow.name, - sourceId: source.id, - destinationId: destination.id, - rules: flow.rules as Array>, + type: 'RETELL', + config: { auth: { webhook_secret_key: RETELL_SECRET_KEY } }, }); console.log(`✅ ${flow.name}: ${connection.source.url} -> local-${flow.name} (${flow.cliPath}), signature verification on`); return connection.source.url; @@ -185,14 +188,11 @@ function writeEnv(values: { [key: string]: string }): void { } async function main(): Promise { - if (!process.env.HOOKDECK_API_KEY || process.env.HOOKDECK_API_KEY.startsWith('your_')) { - fail('HOOKDECK_API_KEY is not set. Add a project API key to .env (Hookdeck dashboard: Project settings -> API keys).'); - } + requireHookdeckApiKey(); if (!RETELL_API_KEY || RETELL_API_KEY.startsWith('your_')) { fail('RETELL_API_KEY is not set. Add a Retell API key to .env (Retell dashboard: Settings -> API Keys).'); } - cli.login(); const urls: { [name: string]: string } = {}; for (const flow of FLOWS) urls[flow.name] = await setupFlow(flow); @@ -209,4 +209,4 @@ async function main(): Promise { console.log('\nNext:\n npm run listen\n npm start'); } -main().catch((error: any) => fail(`Setup failed: ${error.stderr?.toString().trim() || error.message}`)); +main().catch((error: any) => fail(`Setup failed: ${error.message}`)); diff --git a/vapi/agency-routing/.env.example b/vapi/agency-routing/.env.example index 4497f9c..2fcae05 100644 --- a/vapi/agency-routing/.env.example +++ b/vapi/agency-routing/.env.example @@ -10,8 +10,9 @@ VAPI_PUBLIC_KEY=your_vapi_public_key_here # Hookdeck project API key (REQUIRED) # Hookdeck dashboard: Project settings -> API keys. `npm run setup` creates the -# sources and connections in this project and `npm run listen` forwards them, using -# a CLI config file of their own, so your interactive `hookdeck login` is untouched. +# sources and connections in this project with the Hookdeck API. `npm run listen` +# forwards them with the Hookdeck CLI, using a config file of its own, so your +# interactive `hookdeck login` is untouched. HOOKDECK_API_KEY=your_hookdeck_api_key_here # Server port (optional) diff --git a/vapi/agency-routing/scripts/hookdeck-api.ts b/vapi/agency-routing/scripts/hookdeck-api.ts new file mode 100644 index 0000000..cc1d312 --- /dev/null +++ b/vapi/agency-routing/scripts/hookdeck-api.ts @@ -0,0 +1,45 @@ +// Generated from `_shared/hookdeck/hookdeck-api.ts`; edit there and run `npm run sync-shared`. +/** + * Hookdeck REST API helper for demo setup and probe scripts. + * + * Calls the API with the project API key in HOOKDECK_API_KEY (loaded from .env), so it + * works on the project that key belongs to. Setup creates the Event Gateway source, + * destination and connection with it; the Hookdeck CLI is only used by `npm run listen`. + * + * Needs Node 22+ (global fetch) and `dotenv` in the demo. + * + * const connection = await hookdeck('PUT', '/connections', { + * name: 'my-connection', + * source: { name: 'my-source', type: 'WEBHOOK' }, + * destination: { name: 'local-my-app', type: 'CLI', config: { path: '/webhooks' } }, + * }); + * console.log(connection.source.url); + * + * API reference: https://hookdeck.com/docs/api + */ +import 'dotenv/config'; + +export const HOOKDECK_API_BASE = 'https://api.hookdeck.com/2026-09-01'; + +/** The project API key from HOOKDECK_API_KEY. Exits with a hint when it isn't set. */ +export function requireHookdeckApiKey(): string { + const key = process.env.HOOKDECK_API_KEY; + if (!key || key.startsWith('your_')) { + console.error('❌ HOOKDECK_API_KEY is not set. Add a project API key to .env'); + console.error(' (Hookdeck dashboard: Project settings -> API keys).'); + process.exit(1); + } + return key; +} + +/** Calls the Hookdeck API and returns the parsed JSON response. Throws on a non-2xx status. */ +export async function hookdeck(method: string, route: string, body?: unknown): Promise { + const response = await fetch(`${HOOKDECK_API_BASE}${route}`, { + method, + headers: { authorization: `Bearer ${requireHookdeckApiKey()}`, 'content-type': 'application/json' }, + body: body === undefined ? undefined : JSON.stringify(body), + }); + const text = await response.text(); + if (!response.ok) throw new Error(`Hookdeck API ${method} ${route} -> ${response.status}: ${text.slice(0, 300)}`); + return text ? JSON.parse(text) : (undefined as T); +} diff --git a/vapi/agency-routing/scripts/hookdeck-cli.ts b/vapi/agency-routing/scripts/hookdeck-cli.ts index 548dd35..fe900a2 100644 --- a/vapi/agency-routing/scripts/hookdeck-cli.ts +++ b/vapi/agency-routing/scripts/hookdeck-cli.ts @@ -201,7 +201,7 @@ export function createHookdeckCli(options: HookdeckCliOptions = {}) { return withPrivateJson(`rules-${spec.name}.json`, spec.rules, (file) => json([...args, '--rules-file', file])); } - /** Reads from the Hookdeck API with the project API key. The demos' probe scripts use it to find a source and list its requests; setup goes through the CLI only. */ + /** Calls the Hookdeck API with the project API key. Demos that set up through the API use hookdeck-api.ts instead. */ async function api(method: string, route: string, body?: unknown): Promise { const response = await fetch(`${api_base}${route}`, { method, diff --git a/vapi/agency-routing/scripts/probe.ts b/vapi/agency-routing/scripts/probe.ts index 64890a0..a01a493 100644 --- a/vapi/agency-routing/scripts/probe.ts +++ b/vapi/agency-routing/scripts/probe.ts @@ -11,7 +11,7 @@ */ import 'dotenv/config'; import * as crypto from 'crypto'; -import { createHookdeckCli } from './hookdeck-cli'; +import { hookdeck } from './hookdeck-api'; const secret = process.env.VAPI_WEBHOOK_SECRET!; const targets = [ @@ -29,20 +29,19 @@ async function send(label: string, url: string, body: string, headers: Record new Promise((resolve) => setTimeout(resolve, ms)); /** The request record whose body carries `call_id`, read back from the Hookdeck API. */ -async function findRequest(cli: ReturnType, source_id: string, call_id: string): Promise { - const list = await cli.api('GET', `/requests?source_id=${source_id}&limit=20`); +async function findRequest(source_id: string, call_id: string): Promise { + const list = await hookdeck('GET', `/requests?source_id=${source_id}&limit=20`); for (const summary of list.models) { - const detail = await cli.api('GET', `/requests/${summary.id}`); + const detail = await hookdeck('GET', `/requests/${summary.id}`); if (detail.data?.body?.message?.call?.id === call_id) return detail; } return undefined; } async function prove(): Promise { - const cli = createHookdeckCli(); let all_ok = true; for (const t of targets) { - const source = (await cli.api('GET', `/sources?name=${encodeURIComponent(t.name === 'Acme' ? 'vapi-acme-dental' : 'vapi-globex-plumbing')}`)).models[0]; + const source = (await hookdeck('GET', `/sources?name=${encodeURIComponent(t.name === 'Acme' ? 'vapi-acme-dental' : 'vapi-globex-plumbing')}`)).models[0]; const results: Array<[string, boolean, string]> = []; for (const [label, good] of [['correctly signed', true], ['badly signed', false]] as const) { const call_id = `probe-${label.split(' ')[0]}-${crypto.randomBytes(4).toString('hex')}`; @@ -51,7 +50,7 @@ async function prove(): Promise { let record: any; for (let i = 0; i < 8 && !record; i++) { await sleep(1500); - record = await findRequest(cli, source.id, call_id); + record = await findRequest(source.id, call_id); } const ok = good ? res.status === 200 && record?.verified === true diff --git a/vapi/agency-routing/scripts/setup.ts b/vapi/agency-routing/scripts/setup.ts index e55debc..dbcf1e0 100644 --- a/vapi/agency-routing/scripts/setup.ts +++ b/vapi/agency-routing/scripts/setup.ts @@ -2,7 +2,7 @@ * One command to wire the whole demo. Safe to run again: it updates what it created before (the IDs in .env) * and never changes a Vapi credential, tool or assistant that only shares a name with one of its own. * - * Hookdeck (project for HOOKDECK_API_KEY), per client: + * Hookdeck (project for HOOKDECK_API_KEY, through the Hookdeck API), per client: * source (type VAPI, HMAC verification on) -> connection -> CLI destination (the client's route) * Vapi (account for VAPI_API_KEY): * one HMAC custom credential, one async function tool, one assistant per client whose @@ -13,7 +13,7 @@ import 'dotenv/config'; import * as crypto from 'crypto'; import { CLIENTS, Client } from '../src/clients'; -import { createHookdeckCli } from './hookdeck-cli'; +import { hookdeck, requireHookdeckApiKey } from './hookdeck-api'; import { writeEnv } from './env-file'; import { vapi, requireVapiKey } from './vapi-api'; @@ -33,32 +33,34 @@ const CONNECTION_RULES = [ { type: 'retry', strategy: 'exponential', count: 4, interval: 10000 }, ]; -const cli = createHookdeckCli(); - +/** + * Creates the client's connection with the Hookdeck API, then turns on signature verification. + * PUT /connections creates or updates the VAPI source, the CLI destination and the rules, matched + * by name. PUT /sources sets the source's verification settings (config.auth). + */ async function setupHookdeck(client: Client, secret: string): Promise { - const destination = cli.upsertCliDestination({ name: client.destination, path: client.path }); - // Verification (`auth`) goes through the CLI's source config file (hookdeck-cli 3.2.0 or later), - // so the header, algorithm and encoding stay as set here. - const source = cli.upsertSource({ - name: client.source, - type: 'VAPI', - config: { trim_payload: TRIM_PAYLOAD }, - auth: { webhook_secret_key: secret, algorithm: 'sha256', encoding: 'hex', header_key: 'x-signature' }, - }); - const connection = cli.upsertConnection({ + // Event Gateway answers Vapi at once, then delivers to the app. Repeats are dropped; if the app answers + // 5xx or is down, retry with short demo intervals: attempt #2 after about 10s, #3 after 20s, #4 after 40s, #5 after 80s. + const connection = await hookdeck('PUT', '/connections', { name: client.source, - sourceId: source.id, - destinationId: destination.id, - // Event Gateway answers Vapi at once, then delivers to the app. Repeats are dropped; if the app answers - // 5xx or is down, retry with short demo intervals: attempt #2 after about 10s, #3 after 20s, #4 after 40s, #5 after 80s. + source: { name: client.source, type: 'VAPI' }, + destination: { name: client.destination, type: 'CLI', config: { path: client.path } }, rules: CONNECTION_RULES, }); - if (connection.destination.id !== destination.id) { + if (connection.destination.name !== client.destination) { console.error(`Connection ${client.source} points at destination ${connection.destination.name}, not ${client.destination}.`); - console.error(`A connection's destination can't be changed. Delete it and run this script again:`); - console.error(` hookdeck gateway connection delete ${connection.id} --force`); + console.error(`A connection's destination can't be changed. Delete the connection ${connection.id} in the Hookdeck dashboard and run this script again.`); process.exit(1); } + // The header, algorithm and encoding match the Vapi credential that setupVapi creates. + const source = await hookdeck('PUT', '/sources', { + name: client.source, + type: 'VAPI', + config: { + trim_payload: TRIM_PAYLOAD, + auth: { webhook_secret_key: secret, algorithm: 'sha256', encoding: 'hex', header_key: 'x-signature' }, + }, + }); console.log(`Hookdeck ${client.name}: ${source.url} -> ${client.path} (verification: ${source.config?.auth ? 'set' : 'NOT set'})`); return source.url; } @@ -143,8 +145,7 @@ async function setupVapi(secret: string, urls: { [slug: string]: string }) { async function main() { requireVapiKey(); - cli.login(); - console.log((cli.whoami() || '') + '\n'); + requireHookdeckApiKey(); const secret = process.env.VAPI_WEBHOOK_SECRET && !process.env.VAPI_WEBHOOK_SECRET.startsWith('your_') ? process.env.VAPI_WEBHOOK_SECRET @@ -166,6 +167,6 @@ async function main() { } main().catch((error: any) => { - console.error('Setup failed:', error.stderr?.toString().trim() || error.message); + console.error('Setup failed:', error.message); process.exit(1); }); From c33d052c21fecf012d3e5877bf2c8fb57a593944 Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Thu, 19 Nov 2026 11:50:44 +0000 Subject: [PATCH 2/5] voice AI demos: verify Hookdeck's signature on every delivery 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 --- _shared/hookdeck/hookdeck-signature.ts | 54 ++++++++++++++++++ _shared/manifest.json | 7 ++- elevenlabs/post-call-transcripts/.env.example | 10 +++- elevenlabs/post-call-transcripts/README.md | 14 +++-- .../post-call-transcripts/public/app.js | 11 ++-- .../post-call-transcripts/public/demo.css | 2 +- .../post-call-transcripts/public/index.html | 2 +- .../post-call-transcripts/src/events.ts | 4 +- .../src/hookdeck-signature.ts | 55 +++++++++++++++++++ .../post-call-transcripts/src/server.ts | 3 +- .../post-call-transcripts/src/webhook.ts | 35 +++--------- .../test/hookdeck-signature.test.ts | 48 ++++++++++++++++ .../test/webhook.test.ts | 46 ++++++++++------ livekit/voice-adventure/.env.example | 6 ++ livekit/voice-adventure/README.md | 31 ++++------- livekit/voice-adventure/public/demo.css | 2 - livekit/voice-adventure/public/index.html | 2 +- livekit/voice-adventure/public/topology.js | 8 +-- .../voice-adventure/scenes/livekit-calls.ts | 47 ++++++---------- .../voice-adventure/scripts/setup-hookdeck.ts | 41 ++++++-------- livekit/voice-adventure/scripts/simulate.ts | 2 +- livekit/voice-adventure/src/config.ts | 5 +- .../voice-adventure/src/hookdeck-signature.ts | 55 +++++++++++++++++++ livekit/voice-adventure/src/server.ts | 53 +++++++++--------- livekit/voice-adventure/src/verify.ts | 19 ------- livekit/voice-adventure/test/call-log.test.ts | 13 ----- .../test/hookdeck-signature.test.ts | 48 ++++++++++++++++ livekit/voice-adventure/test/verify.test.ts | 41 -------------- retell/outbound-lead-calling/.env.example | 6 ++ retell/outbound-lead-calling/README.md | 5 +- retell/outbound-lead-calling/src/config.ts | 2 +- .../outbound-lead-calling/src/deliveries.ts | 2 +- .../src/hookdeck-signature.ts | 55 +++++++++++++++++++ retell/outbound-lead-calling/src/server.ts | 31 ++++++++--- .../test/hookdeck-signature.test.ts | 48 ++++++++++++++++ vapi/agency-routing/.env.example | 6 ++ vapi/agency-routing/README.md | 2 +- vapi/agency-routing/package.json | 2 +- vapi/agency-routing/src/hookdeck-signature.ts | 55 +++++++++++++++++++ vapi/agency-routing/src/server.ts | 14 ++++- .../test/hookdeck-signature.test.ts | 48 ++++++++++++++++ vapi/agency-routing/test/run.ts | 23 +++++++- 42 files changed, 691 insertions(+), 272 deletions(-) create mode 100644 _shared/hookdeck/hookdeck-signature.ts create mode 100644 elevenlabs/post-call-transcripts/src/hookdeck-signature.ts create mode 100644 elevenlabs/post-call-transcripts/test/hookdeck-signature.test.ts create mode 100644 livekit/voice-adventure/src/hookdeck-signature.ts delete mode 100644 livekit/voice-adventure/src/verify.ts create mode 100644 livekit/voice-adventure/test/hookdeck-signature.test.ts delete mode 100644 livekit/voice-adventure/test/verify.test.ts create mode 100644 retell/outbound-lead-calling/src/hookdeck-signature.ts create mode 100644 retell/outbound-lead-calling/test/hookdeck-signature.test.ts create mode 100644 vapi/agency-routing/src/hookdeck-signature.ts create mode 100644 vapi/agency-routing/test/hookdeck-signature.test.ts diff --git a/_shared/hookdeck/hookdeck-signature.ts b/_shared/hookdeck/hookdeck-signature.ts new file mode 100644 index 0000000..c87331d --- /dev/null +++ b/_shared/hookdeck/hookdeck-signature.ts @@ -0,0 +1,54 @@ +/** + * Verifies the `x-hookdeck-signature` header Event Gateway adds to every delivery. + * + * The signature is the base64 HMAC-SHA256 of the raw request body, keyed with the project + * signing secret (HOOKDECK_SIGNING_SECRET, copied from the dashboard into .env). It has no + * timestamp on purpose: Event Gateway verified the sender's own signature when it accepted + * the request, so a retry or replay hours later is legitimate and must still pass. + * + * While a rolled secret is still active, Hookdeck also sends `x-hookdeck-signature-2`. + * + * Reference: https://hookdeck.com/docs/authentication#hookdeck-webhook-signature-verification + */ +import 'dotenv/config'; +import { createHmac, timingSafeEqual } from 'crypto'; + +export const HOOKDECK_SECRETS_URL = 'https://dashboard.hookdeck.com/settings/project/secrets'; + +/** The project signing secret from HOOKDECK_SIGNING_SECRET. Exits with a hint when it isn't set. */ +export function requireHookdeckSigningSecret(): string { + const secret = process.env.HOOKDECK_SIGNING_SECRET; + if (!secret || secret.startsWith('your_')) { + console.error('❌ HOOKDECK_SIGNING_SECRET is not set. Add the project signing secret to .env'); + console.error(` (Hookdeck dashboard: Project settings -> Secrets, ${HOOKDECK_SECRETS_URL}).`); + process.exit(1); + } + return secret; +} + +/** The signature Hookdeck sends for a body: base64 HMAC-SHA256 of the raw bytes. */ +export function signHookdeckBody(raw_body: Buffer | string, secret: string): string { + return createHmac('sha256', secret).update(raw_body).digest('base64'); +} + +function sameSignature(expected: string, received: string): boolean { + const expected_bytes = Buffer.from(expected, 'utf8'); + const received_bytes = Buffer.from(received, 'utf8'); + // timingSafeEqual throws on different lengths, so check the length first + return expected_bytes.length === received_bytes.length && timingSafeEqual(expected_bytes, received_bytes); +} + +/** + * True when `signature_header` (x-hookdeck-signature) matches the raw body signed with `secret`. + * Pass `signature_header_2` (x-hookdeck-signature-2) to also accept the previous secret's signature. + */ +export function verifyHookdeckSignature( + raw_body: Buffer | string, + signature_header: string | undefined, + secret: string | undefined, + signature_header_2?: string, +): boolean { + if (!secret) return false; + const expected = signHookdeckBody(raw_body, secret); + return [signature_header, signature_header_2].some((header) => Boolean(header) && sameSignature(expected, header as string)); +} diff --git a/_shared/manifest.json b/_shared/manifest.json index 4d5e9e5..4443f0b 100644 --- a/_shared/manifest.json +++ b/_shared/manifest.json @@ -8,7 +8,8 @@ "flow-drawer-server": "_shared/flow-drawer/server.ts", "scenes": "_shared/scenes", "topology-pane": "_shared/topology-pane", - "theme": "_shared/theme/theme.js" + "theme": "_shared/theme/theme.js", + "hookdeck-signature": "_shared/hookdeck/hookdeck-signature.ts" }, "demos": { "deepgram/stt-tts": { @@ -30,6 +31,7 @@ "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", + "hookdeck-signature": "src/hookdeck-signature.ts", "flow-drawer-server": "src/flow-drawer-server.ts", "scenes": "scenes/kit", "topology-pane": "public/topology-pane", @@ -40,6 +42,7 @@ "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", + "hookdeck-signature": "src/hookdeck-signature.ts", "flow-drawer-server": "src/flow-drawer-server.ts", "scenes": "scenes/kit", "topology-pane": "public/topology-pane", @@ -50,6 +53,7 @@ "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", + "hookdeck-signature": "src/hookdeck-signature.ts", "flow-drawer-server": "src/flow-drawer-server.ts", "scenes": "scenes/kit", "topology-pane": "public/topology-pane", @@ -60,6 +64,7 @@ "hookdeck-api": "scripts/hookdeck-api.ts", "hookdeck-cli": "scripts/hookdeck-cli.ts", "hookdeck-listen": "scripts/hookdeck-listen.ts", + "hookdeck-signature": "src/hookdeck-signature.ts", "flow-drawer-server": "src/flow-drawer-server.ts", "scenes": "scenes/kit", "topology-pane": "public/topology-pane", diff --git a/elevenlabs/post-call-transcripts/.env.example b/elevenlabs/post-call-transcripts/.env.example index ab8ecee..5ff50bb 100644 --- a/elevenlabs/post-call-transcripts/.env.example +++ b/elevenlabs/post-call-transcripts/.env.example @@ -14,6 +14,12 @@ ELEVENLABS_AGENT_ID= # `hookdeck login` is untouched. HOOKDECK_API_KEY=your_hookdeck_api_key_here +# Hookdeck project signing secret (REQUIRED) +# Hookdeck dashboard: Project settings -> Secrets, https://dashboard.hookdeck.com/settings/project/secrets. +# The app verifies the x-hookdeck-signature header on every delivery with it, and answers 401 when it +# is missing or wrong. The API key cannot read it, so copy it here by hand. +HOOKDECK_SIGNING_SECRET=your_hookdeck_signing_secret_here + # Server port (optional) PORT=4000 @@ -30,8 +36,8 @@ PORT=4000 # Hookdeck source URL that ElevenLabs sends post-call webhooks to ELEVENLABS_WEBHOOK_URL= # Signing secret of the ElevenLabs workspace webhook (also set on the Hookdeck source). -# Hookdeck verifies the ElevenLabs-Signature with it; the app only uses it to show the -# result of the SDK's constructEvent next to each delivery. +# Hookdeck verifies the ElevenLabs-Signature with it. The app does not check that header; this +# secret is also used by `npm run send` and `npm run probe` to sign sample requests. ELEVENLABS_WEBHOOK_SECRET= # ID of the ElevenLabs workspace webhook ELEVENLABS_WEBHOOK_ID= diff --git a/elevenlabs/post-call-transcripts/README.md b/elevenlabs/post-call-transcripts/README.md index 563157e..a165a93 100644 --- a/elevenlabs/post-call-transcripts/README.md +++ b/elevenlabs/post-call-transcripts/README.md @@ -32,12 +32,14 @@ The demo has three parts: this app, an ElevenLabs agent, and Hookdeck. It shows: npm install ``` -2. Create `.env` and fill in `ELEVENLABS_API_KEY` and `HOOKDECK_API_KEY`: +2. Create `.env` and fill in `ELEVENLABS_API_KEY`, `HOOKDECK_API_KEY` and `HOOKDECK_SIGNING_SECRET`: ```bash cp .env.example .env ``` + `HOOKDECK_SIGNING_SECRET` is the project signing secret from the dashboard (Project settings → [Secrets](https://dashboard.hookdeck.com/settings/project/secrets)). The API key can't read it, so copy it by hand. The app uses it to verify `x-hookdeck-signature` on every delivery. + You don't need an agent of your own: setup creates a dedicated one and writes its ID to `.env`. 3. Set up Hookdeck and ElevenLabs: @@ -91,7 +93,7 @@ The app listens on `127.0.0.1` only, which is enough because `hookdeck listen` r - **Who is who**: you are the customer ringing the Hookdeck Hair booking line; the booking assistant is the agent that `npm run setup` creates (its prompt is `AGENT_CONFIG` in `scripts/setup.ts`). - **Diary**: a week view above the conversations. A conversation whose `booking_made` evaluation is `success` fills a slot from `caller_name`, `requested_service` and `requested_time`. The page works this out from the stored conversations (`public/diary.js`); the webhook handler is unchanged. A `requested_time` it cannot read as a day and a time of day goes in an Unscheduled row as received. - **Themes**: Salon (the default, the Hookdeck Hair booking line), Light, Dark and System, from the switch at the top right. Salon is `public/theme-salon.css` and `public/theme-salon.copy.js`; the Data flow pane keeps the standard look. Explanations sit behind the ⓘ buttons and hover tips. -- **Deliveries received** (collapsed): the latest requests the app received, with body size and result, and the result of the ElevenLabs SDK's `constructEvent` on the forwarded requests. +- **Deliveries received** (collapsed): the latest requests the app received, with body size and result, and whether the Hookdeck signature check passed. Data collection results and evaluation criteria are configured per agent (agent -> **Analysis**). Setup gives the demo agent `caller_name`, `requested_service` and `requested_time` as data collection items and `booking_made` as an evaluation criterion; they show up in the conversation detail. @@ -130,9 +132,12 @@ A `post_call_transcription` payload grows with the transcript, the analysis and ## Verifying the signature -Hookdeck verifies `ElevenLabs-Signature` at the source URL, so the app does not have to. Hookdeck forwards the original headers and the original body, so the signature header still reaches the app. When `ELEVENLABS_WEBHOOK_SECRET` is set, the app runs `elevenlabs.webhooks.constructEvent` from [`@elevenlabs/elevenlabs-js`](https://www.npmjs.com/package/@elevenlabs/elevenlabs-js) on each forwarded request and shows the result in the **SDK check** column. It does not block anything. +Two signatures are in play, and each is checked once: + +- **`ElevenLabs-Signature`** is verified by Event Gateway at the source URL, so the app does not check it. Hookdeck forwards the original headers and body, so the header still reaches the app. +- **`x-hookdeck-signature`** is verified by the app on every delivery, before it does anything else. It is the base64 HMAC-SHA256 of the raw request body, keyed with `HOOKDECK_SIGNING_SECRET` (`src/hookdeck-signature.ts`, synced from `_shared`). A delivery with a missing or wrong signature gets a `401` and shows in **Deliveries received** as `signature_rejected`, with a red **Hookdeck signature rejected** badge. -The SDK rejects a timestamp older than 30 minutes, so a replay of an old event shows a tolerance error in that column while the event is still stored. +Hookdeck's signature has no timestamp. Event Gateway verified ElevenLabs' signature when it accepted the request, so a retry or a replay hours later is legitimate and still passes. ## Topology scenes, and MP4s of them @@ -177,6 +182,7 @@ elevenlabs/post-call-transcripts/ ├── src/ │ ├── server.ts # Express app and API │ ├── webhook.ts # POST /webhooks/elevenlabs +│ ├── hookdeck-signature.ts # verifies x-hookdeck-signature (synced from _shared) │ ├── store.ts # JSON-file storage, idempotency, audio files │ ├── events.ts # event and record types │ └── samples.ts # sample payloads and signer diff --git a/elevenlabs/post-call-transcripts/public/app.js b/elevenlabs/post-call-transcripts/public/app.js index 9ab5630..c78803e 100644 --- a/elevenlabs/post-call-transcripts/public/app.js +++ b/elevenlabs/post-call-transcripts/public/app.js @@ -90,7 +90,7 @@ function renderConversation(c, open) { } function resultBadge(result) { - const cls = result === 'stored' ? 'badge--success' : result === 'simulated_failure' ? 'badge--danger' : ''; + const cls = result === 'stored' ? 'badge--success' : result === 'simulated_failure' || result === 'signature_rejected' ? 'badge--danger' : ''; return `${esc(result)}`; } @@ -135,15 +135,14 @@ async function refresh() { : `${wording('empty', EMPTY_PLAIN)}`, ); - const checked = deliveries.filter((d) => d.sdk_check); - const sdk_ok = checked.filter((d) => d.sdk_check === 'ok').length; const failed = deliveries.filter((d) => d.status_code >= 400).length; $('deliverySummary').textContent = deliveries.length ? `${deliveries.length} received${failed ? `, ${failed} failed on purpose or by error` : ''}` : 'none yet'; - $('sdkBadge').innerHTML = checked.length - ? `SDK check ${sdk_ok === checked.length ? 'ok' : `${sdk_ok}/${checked.length}`}` - : state.sdk_check ? 'SDK check: no deliveries yet' : ''; + const rejected = deliveries.filter((d) => d.result === 'signature_rejected').length; + $('signatureBadge').innerHTML = rejected + ? `${rejected} Hookdeck signature rejected` + : deliveries.length ? 'Hookdeck signature ok' : ''; show('deliveries', deliveries.length ? deliveries .slice(0, 6) diff --git a/elevenlabs/post-call-transcripts/public/demo.css b/elevenlabs/post-call-transcripts/public/demo.css index 59734e5..370513b 100644 --- a/elevenlabs/post-call-transcripts/public/demo.css +++ b/elevenlabs/post-call-transcripts/public/demo.css @@ -98,7 +98,7 @@ footer { color: var(--neutral-fg-3); } .deliveries__toggle::before { content: '\25B8'; color: var(--neutral-fg-3); } .deliveries__toggle[aria-expanded="true"]::before { content: '\25BE'; } .deliveries__toggle:focus-visible { outline: 2px solid var(--focused-outline); outline-offset: 2px; border-radius: var(--radius-s); } -.deliveries__head #sdkBadge { margin-left: auto; } +.deliveries__head #signatureBadge { margin-left: auto; } .delivery-list { margin-top: var(--s3); } .delivery-list { display: grid; gap: var(--s1-5); } .delivery { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); padding: var(--s1-5) 0; border-top: 1px solid var(--neutral-outline-3); color: var(--neutral-fg-2); } diff --git a/elevenlabs/post-call-transcripts/public/index.html b/elevenlabs/post-call-transcripts/public/index.html index 9e246bd..531e086 100644 --- a/elevenlabs/post-call-transcripts/public/index.html +++ b/elevenlabs/post-call-transcripts/public/index.html @@ -115,7 +115,7 @@