Skip to content

fix(push): serve the VAPID key at runtime via @profullstack/notifications - #121

Merged
ralyodio merged 1 commit into
masterfrom
fix/push-support
Sep 24, 2026
Merged

ralyodio merged 1 commit into
masterfrom
fix/push-support

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Why

Every browser showed "Push notifications are not supported in this browser." The client decided support from NEXT_PUBLIC_VAPID_PUBLIC_KEY, which Next inlines at build time. The Docker build never received it, so it compiled to ''. The same inlining silently disabled server-side sending in initWebPush.

What

  • GET /api/push/vapid-public-key serves the key from the runtime env (503 when unset).
  • usePushNotifications now uses @profullstack/notifications/client. Support detection gives a specific reason: iOS needs Home Screen install, insecure context, denied, and so on. The settings page shows that reason instead of a generic "not supported".
  • lib/push.ts sends via @profullstack/notifications/server (sendPush + vapidKeysFromEnv). Stale 404/410 subscriptions are still pruned. web-push has been removed.

Tests: 994/994 web tests pass; typecheck and prettier are clean.

🤖 Generated with Claude Code

…ions

"Push notifications are not supported in this browser" showed everywhere
because NEXT_PUBLIC_VAPID_PUBLIC_KEY is not a Docker build ARG, so it was
inlined as '' in the client and the server's initWebPush was silently
disabled too.

- GET /api/push/vapid-public-key serves the key from the runtime env
- usePushNotifications uses the package client (pushSupport, subscribe,
  unsubscribe) and surfaces the real reason push is unavailable
- lib/push.ts sends with the package server (sendPush, vapidKeysFromEnv);
  drops web-push

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

47 finding(s)

HIGH/CRITICAL: 4 | MEDIUM: 27 | LOW: 16

Severity Rule Location
HIGH sh-eval-expansion .githooks/pre-commit:33
HIGH js-electron-node-integration apps/desktop/src/main/window.ts:49
HIGH sh-unquoted-expansion-destructive apps/installer/scripts/install.sh:715
HIGH sh-unquoted-expansion-destructive apps/installer/scripts/install.sh:917
MEDIUM sh-remote-script-execution apps/installer/scripts/install.sh:691
MEDIUM sh-remote-script-execution apps/installer/scripts/install.sh:820
MEDIUM sh-remote-script-execution apps/installer/scripts/install.sh:822
MEDIUM sh-remote-script-execution apps/installer/scripts/install.sh:1078
MEDIUM sh-remote-script-execution apps/installer/scripts/install.sh:1080
MEDIUM sh-remote-script-execution apps/livekit/setup-livekit-server.sh:93
MEDIUM sh-remote-script-execution apps/turn/deploy-droplet.sh:62
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:48
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:73
MEDIUM js-unescaped-html-sink apps/web/src/app/c/[handle]/page.tsx:196
MEDIUM js-open-redirect apps/web/src/app/cli/authorize/consent.tsx:66
MEDIUM js-unescaped-html-sink apps/web/src/app/l/[joinCode]/page.tsx:129
MEDIUM js-unescaped-html-sink apps/web/src/app/l/[joinCode]/page.tsx:213
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:142
MEDIUM js-unescaped-html-sink apps/web/src/app/live/page.tsx:145
MEDIUM js-unescaped-html-sink apps/web/src/app/page.tsx:123
MEDIUM js-unescaped-html-sink apps/web/src/app/pricing/page.tsx:286
MEDIUM js-open-redirect apps/web/src/app/pricing/UpgradeButton.tsx:50
MEDIUM js-unescaped-html-sink apps/web/src/app/u/[username]/page.tsx:282
MEDIUM js-open-redirect apps/web/src/hooks/useDesktopHandoff.ts:24
MEDIUM redos-nested-quantifier apps/web/src/lib/deliverable.ts:11
MEDIUM js-unescaped-html-sink apps/web/src/lib/player/player.ts:124
MEDIUM js-unescaped-html-sink apps/web/src/lib/player/player.ts:393
MEDIUM js-unescaped-html-sink apps/web/src/lib/player/player.ts:396
MEDIUM js-unescaped-html-sink apps/web/src/lib/player/player.ts:405
MEDIUM js-unescaped-html-sink apps/web/src/lib/player/player.ts:608
MEDIUM sql-template-interpolation packages/ai-core/src/prompts.ts:36
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:138
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:139
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:340
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:341
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:371
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:372
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:383
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:397
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:398
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:405
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:415
LOW secret-generic-credential apps/desktop/src/main/agent-cli/commands.test.ts:416
LOW secret-generic-credential apps/livekit/fly.toml:12
LOW secret-generic-credential apps/turn/fly.toml:11
LOW secret-generic-credential docs/API.md:747
LOW secret-generic-credential docs/API.md:753

Snippets are redacted; ThreatCrush never prints matched credential material.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​profullstack/​notifications@​0.1.0751009388100

View full report

@ralyodio
ralyodio merged commit f7c2b2d into master Sep 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant