@bates-solutions/stripe API Reference - v2.2.1
    Preparing search index...

    Function parseWebhookEvent

    • Parse a webhook request body into a typed event.

      Parameters

      • rawBody: string

        The raw request body string

      Returns Event

      The parsed webhook event

      Error if the payload is not valid JSON

      const event = parseWebhookEvent(rawBody);
      console.log(event.type); // 'payment_intent.succeeded'