Skip to content

An nom package containing types for the webhooks used in revenue cat

License

Notifications You must be signed in to change notification settings

puzzmo-com/revenue-cat-webhook-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Types for RevenueCat's webhooks

Hand-crafted from their docs, with JSDoc when appropriate and nullability manually added.

import { Webhook } from "@puzzmo/revenue-cat-webhook-types"

const handler = (req: Webhook) => {
  switch (req.event.type) {
    case "INITIAL_PURCHASE":
      // req as WebhookInitialPurchase
      break

    case "RENEWAL":
      // req as WebhookRenewal
      break
  }
}

Generally speaking, the types are nearly always the same across the webhooks, but it's good to have a centrally maintained source of truth for nullability until there are official types. See here for more discussion.

About

An nom package containing types for the webhooks used in revenue cat

Resources

License

Stars

Watchers

Forks

Packages

No packages published