* RevenueCat Webhook Handler * * Processes RevenueCat webhook events for subscription lifecycle management * Follows security best practices with signature validation
| 15 | */ |
| 16 | |
| 17 | interface RevenueCatWebhookEvent { |
| 18 | event: { |
| 19 | type: string; |
| 20 | event_timestamp_ms: number; |
| 21 | app_user_id: string; |
| 22 | original_app_user_id?: string; |
| 23 | aliases?: string[]; |
| 24 | product_id?: string; |
| 25 | period_type?: "NORMAL" | "TRIAL" | "INTRO"; |
| 26 | purchased_at?: number; |
| 27 | expiration_at_ms?: number; |
| 28 | environment: "SANDBOX" | "PRODUCTION"; |
| 29 | entitlement_id?: string; |
| 30 | purchased_at_ms?: number; |
| 31 | entitlement_ids?: string[]; |
| 32 | price?: number; |
| 33 | currency?: string; |
| 34 | is_family_share?: boolean; |
| 35 | country_code?: string; |
| 36 | app_id: string; |
| 37 | offer_code?: string; |
| 38 | takehome_percentage?: number; |
| 39 | transaction_id?: string; |
| 40 | original_transaction_id?: string; |
| 41 | is_renewal?: boolean; |
| 42 | cancel_reason?: string; |
| 43 | grace_period_expiration_at?: number; |
| 44 | auto_resume_at?: number; |
| 45 | store?: "APP_STORE" | "MAC_APP_STORE" | "PLAY_STORE" | "STRIPE" | "PROMOTIONAL"; |
| 46 | }; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Verify RevenueCat webhook authorization header |
nothing calls this directly
no outgoing calls
no test coverage detected