bothy-sdk
    Preparing search index...

    Function parseWebhookSecret

    • Reads a v1 secret: whsec_ plus the standard base64 of the HMAC key, as the server shows it once.

      Parameters

      • value: string

        The secret.

      Returns Uint8Array

      The HMAC-SHA256 key bytes.

      WebhookConfigError when the value is empty, has another prefix, is no standard base64 or decodes to no bytes; the message never repeats the value.

      const key = parseWebhookSecret(process.env.WEBHOOK_SECRET ?? "");