Guides / SaaS

Real-Time Revenue Notifications for Your SaaS

4 min read·SaaS

Know When Your SaaS Makes Money

Most founders check their Stripe dashboard reactively. LogIt flips this — you get notified proactively, the moment revenue moves.

New subscription

ts
case "customer.subscription.created": {
  const sub = event.data.object;
  const price = sub.items.data[0]?.price;
  const amount = ((price?.unit_amount ?? 0) / 100).toFixed(2);
  const interval = price?.recurring?.interval ?? "month";

  await logit.now("revenue", {
    event: "New subscription 🎉",
    description: `${customerEmail} — $${amount}/${interval}`,
    icon: "🎉",
    notify: true,
    tags: {
      plan: price?.nickname ?? "unknown",
      interval,
      mrr: amount,
    },
    metadata: {
      subscriptionId: sub.id,
      customerId: String(sub.customer),
      email: customerEmail,
      amount: price?.unit_amount,
    },
  });
  break;
}

Upgrade

ts
case "customer.subscription.updated": {
  const prev = event.data.previous_attributes as { items?: unknown };
  if (!prev.items) break; // not a plan change

  await logit.now("revenue", {
    event: "Plan upgraded ⬆️",
    description: `${customerEmail}: ${oldPlan}${newPlan}`,
    icon: "⬆️",
    notify: true,
    tags: { from: oldPlan, to: newPlan },
    metadata: { subscriptionId: sub.id, email: customerEmail },
  });
  break;
}

MRR milestone (custom)

Track this from your billing sync job:

ts
if (currentMrr >= milestone && previousMrr < milestone) {
  await logit.now("milestones", {
    event: `MRR milestone: $${milestone.toLocaleString()}`,
    description: `Current MRR: $${currentMrr.toLocaleString()}`,
    icon: "🏆",
    notify: true,
    tags: { milestone: String(milestone) },
    metadata: { currentMrr, previousMrr },
  });
}

Try LogIt free

7-day trial. No credit card required.

Start free