When a user is tracking a flight (f) and it passes within 5 km of home, they currently get a browser notification. A Discord or Slack webhook would let the notification travel with the user to wherever they actually work.
Scope:
- Add a
webhookUrl field to Preferences in src/state/store.ts (persisted)
- Settings drawer input for the webhook URL (with a test button)
- Detect Discord (
discord.com/api/webhooks/...) vs Slack (hooks.slack.com/services/...) from URL shape
- Format the payload correctly for each (embeds for Discord, blocks for Slack)
- Wire into
App.tsx next to the existing fireNotification call in the tracked-flight callback
- Rate-limit exactly the same as browser notifications (once per key per 5 min)
Test with: a real Discord webhook — create one in a test server, paste into settings, track a flight near your home.
Relevant files: src/lib/notify.ts, src/App.tsx, src/components/SettingsDrawer.tsx, src/state/store.ts.
When a user is tracking a flight (
f) and it passes within 5 km of home, they currently get a browser notification. A Discord or Slack webhook would let the notification travel with the user to wherever they actually work.Scope:
webhookUrlfield toPreferencesinsrc/state/store.ts(persisted)discord.com/api/webhooks/...) vs Slack (hooks.slack.com/services/...) from URL shapeApp.tsxnext to the existingfireNotificationcall in the tracked-flight callbackTest with: a real Discord webhook — create one in a test server, paste into settings, track a flight near your home.
Relevant files:
src/lib/notify.ts,src/App.tsx,src/components/SettingsDrawer.tsx,src/state/store.ts.