# beehiiv premium upgrade notifications on your phone > Get a push notification when a beehiiv subscriber upgrades to one of your paid tiers. - Company: beehiiv (https://www.justpush.io/recipes/beehiiv) - Event: `subscription.upgraded` (subscription.upgraded) - Tags: Email marketing, Newsletters, Payments, Subscriptions - Install: https://studio.justpush.io/recipes/beehiiv/premium-upgrade - Web page: https://www.justpush.io/recipes/beehiiv/premium-upgrade ## Setup 1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL. 2. In beehiiv, go to Settings > Webhooks and add a new webhook (Scale plan or higher). 3. Paste your webhook URL (shown in Studio after install) as the endpoint URL. 4. Select the subscription.upgraded event only and save. 5. Select only `subscription.upgraded`. beehiiv sends `subscription.downgraded` when someone drops back to free; this recipe ignores it. 6. beehiiv delivers webhooks through Svix and signs them (`svix-signature`), but JustPush doesn't check that signature yet, so keep your endpoint URL private. Webhooks need the **Scale** plan or higher. ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // beehiiv → subscription.upgraded (premium upgrade) // Fires when a subscriber upgrades to a paid (premium) tier of your publication. // Docs: https://developers.beehiiv.com/webhooks/subscription/upgraded // beehiiv sends plain strings; treat blanks as missing. function text(value) { return typeof value === "string" && value.trim() ? value.trim() : null } function handleRequest(request) { const body = request.body && typeof request.body === "object" ? request.body : {} const sub = body.data && typeof body.data === "object" ? body.data : null // Guard: only upgrades, so other beehiiv events on this integration stay quiet. if (body.event_type !== "subscription.upgraded" || !sub) { console.log(`Ignoring beehiiv "${body.event_type ?? "unknown"}" event`) return null } const email = text(sub.email) ?? "A subscriber" const tiers = Array.isArray(sub.subscription_premium_tier_names) ? sub.subscription_premium_tier_names.map(text).filter(Boolean) : [] return { title: "💎 New premium subscriber", message: `${email} upgraded to ${tiers.length ? tiers.join(" + ") : "premium"}`, topic: "beehiiv", priority: 0, // Normal — recurring revenue, worth a smile sound: "cashregister", } } ``` ## beehiiv subscription.upgraded webhook payload (sample) ```json { "uid": "evt_00000000-0000-0000-0000-000000000002", "data": { "id": "sub_00000000-0000-0000-0000-000000000000", "tags": [], "email": "ada@example.com", "status": "active", "created": 1788000000, "utm_source": "newsletter", "custom_fields": [], "subscription_tier": "premium", "stripe_customer_id": "cus_00000000000000", "subscription_premium_tier_names": [ "Supporter" ] }, "event_type": "subscription.upgraded", "event_timestamp": 1790667600 } ``` ## FAQ ### Does this work on iPhone and Android? Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification. ### Do I need to write code? No. Install the recipe in Studio, paste your webhook URL into beehiiv and you are done. The code is there if you want to change the text, the sound or the buttons. ### Can I change what the notification says? Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save. ### What does it cost? JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.