@videosdk.live/server-sdk
    Preparing search index...

    Class WebhooksResource

    Webhooks API — vsdk.webhooks.

    Verify inbound webhooks: pass the raw, unparsed request body plus the videosdk-signature header. Signatures are RSA-SHA256 (base64) over the raw body; the signing public key is fetched automatically and cached.

    app.post("/webhooks/videosdk", express.raw({ type: "*/*" }), async (req, res) => {
    const event = await vsdk.webhooks.verify(req.body, req.headers["videosdk-signature"]);
    if (event.type === "recording-stopped") { ... }
    res.sendStatus(200);
    });
    Index
    • Fetch (and cache) the RSA public key used to sign webhooks.

      Returns Promise<string>

    • Verify a webhook and return the typed event. rawBody MUST be the raw, unparsed body (Buffer/string); signature is the videosdk-signature header. Throws WebhookVerificationError if the signature is missing/invalid.

      Parameters

      • rawBody: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>
      • signature: string | string[] | undefined
      • options: VerifyWebhookOptions = {}

      Returns Promise<WebhookEvent<Record<string, unknown>>>

    • Verify a webhook synchronously, using an RSA public key (PEM) you already have (e.g. pinned in config). Same checks as WebhooksResource.verify.

      Parameters

      • rawBody: string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike>
      • signature: string | string[] | undefined
      • publicKey: string

      Returns WebhookEvent