# beehiiv new subscriber notifications on your phone > Get a low-priority push notification when someone subscribes to your beehiiv newsletter, with where they came from. - Company: beehiiv (https://www.justpush.io/recipes/beehiiv) - Event: `subscription.created` (subscription.created) - Tags: Email marketing, Newsletters, Sign-ups & users - Install: https://studio.justpush.io/recipes/beehiiv/new-subscriber - Web page: https://www.justpush.io/recipes/beehiiv/new-subscriber ## 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.created event only and save. 5. Pick **one** of these events, not both, or you'll get two pushes per subscriber: 6. `subscription.created` (default): fires as soon as someone signs up. 7. `subscription.confirmed`: fires when they confirm, if your publication uses double opt-in. The push then says "(confirmed)". 8. 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.created (new subscriber) // Fires when someone subscribes to your beehiiv publication. Also accepts // subscription.confirmed, for publications that use double opt-in. // Docs: https://developers.beehiiv.com/webhooks/subscription/created // Events this recipe turns into a push. const TYPES = new Set(["subscription.created", "subscription.confirmed"]) // 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 new subscriptions, so other beehiiv events on this integration stay quiet. if (!TYPES.has(body.event_type) || !sub) { console.log(`Ignoring beehiiv "${body.event_type ?? "unknown"}" event`) return null } const email = text(sub.email) ?? "Someone" // Where they came from: a UTM source beats the referring site. const source = text(sub.utm_source) ?? text(sub.referring_site) const premium = sub.subscription_tier === "premium" return { title: premium ? "💎 New premium subscriber" : "📬 New subscriber", message: email + (source ? ` via ${source}` : "") + (body.event_type === "subscription.confirmed" ? " (confirmed)" : ""), topic: "beehiiv", priority: premium ? 0 : -1, // Normal when it's paid, Low for a free signup ...(premium ? { sound: "cashregister" } : {}), } } ``` ## beehiiv subscription.created webhook payload (sample) ```json { "uid": "evt_00000000-0000-0000-0000-000000000001", "data": { "id": "sub_00000000-0000-0000-0000-000000000000", "tags": [], "email": "ada@example.com", "status": "active", "created": 1790664000, "utm_medium": "social", "utm_source": "twitter", "utm_channel": "website", "utm_campaign": "launch", "custom_fields": [], "referral_code": "AbC123", "referring_site": "https://example.com/blog", "subscription_tier": "free", "subscription_premium_tier_names": [] }, "event_type": "subscription.created", "event_timestamp": 1790664000 } ``` ## 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.