@jambonz/sdk
    Preparing search index...

    Class WebhookResponse

    Verb builder for HTTP webhook applications. Construct one per request, chain verb methods, and pass to res.json().

    app.post('/incoming', (req, res) => {
    const jambonz = new WebhookResponse();
    jambonz.say({ text: 'Hello!' }).hangup();
    res.json(jambonz);
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    verbs: Verb[] = []
    validator: JambonzValidator | null

    Accessors

    • get length(): number

      Get the current verb count.

      Returns number

    Methods

    • Express-compatible middleware for verifying jambonz webhook signatures. Uses HMAC-SHA256 with timing-safe comparison.

      Parameters

      • secret: string
      • Optionalopts: { tolerance?: number }

      Returns (
          req: IncomingMessage & {
              body?: unknown;
              rawBody?: Buffer<ArrayBufferLike>;
          },
          _res: ServerResponse,
          next: (err?: Error) => void,
      ) => void