Skip to main content

Renewal reminders with Bark

SteadyRenew sends server-driven renewal and free-trial ending reminders to iPhone and iPad devices through Bark. The hosted reminder pipeline uses a Netlify Scheduled Function and Supabase-backed notification settings, so reminders arrive even when the browser is closed.

What users configure

Signed-in users configure Bark in Settings → Notifications (see the end-user Reminders guide):
  • Bark push URL (server URL + device key).
  • Global reminder switch (enabled) and lead time (1, 3, 7, or 14 days ahead).
  • Per-subscription reminder toggle (notificationEnabled).

Eligibility & free-trial rules

  • Only active subscriptions with notificationEnabled: true trigger scheduled pushes; paused and cancelled subscriptions are always skipped.
  • Standard recurring subscriptions automatically roll overdue nextPaymentDate values forward to the current billing cycle before checking the reminder window.
  • Free trials (isTrial: true) use their one-shot trialEndsOn / first-charge date and send trial-ending copy so users can cancel or keep the plan in time. Once trialEndsOn passes, it is never auto-advanced.

Required hosted services & variables

  • Supabase (VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY, SUPABASE_SECRET_KEY).
  • Netlify Scheduled Functions.
  • Official Bark server (https://api.day.app) or a publicly reachable self-hosted Bark instance.

SQL setup

Notification tables, delivery locks, and trial columns are managed via supabase/migrations/ (notably 20260615000100_baseline.sql, 20260615000200_harden_existing_schema.sql, and 20260916000100_subscription_trials.sql).

Scheduled function & local testing

The scheduled worker lives at netlify/functions/send-scheduled-notifications.ts. It evaluates eligible renewals in each user’s configured timeZone, sends localized Bark notifications, records delivery history, and acquires delivery locks to prevent duplicate sends. Test locally with: