opencode/packages/apn-relay
Ryan Vogel d3ec6f75f4 feat: route push notifications by server and session
Include serverID in relay event payloads and prefer server+session matching in mobile notification handling so taps reliably open the correct context and stale state is refreshed.
2026-03-29 17:52:07 -04:00
..
src feat: route push notifications by server and session 2026-03-29 17:52:07 -04:00
.env.example feat: add APN relay MVP and experimental push bridge 2026-03-28 13:28:24 -04:00
AGENTS.md update 2026-03-28 19:03:13 -04:00
Dockerfile feat: add APN relay MVP and experimental push bridge 2026-03-28 13:28:24 -04:00
README.md feat: add APN relay MVP and experimental push bridge 2026-03-28 13:28:24 -04:00
drizzle.config.ts feat: add APN relay MVP and experimental push bridge 2026-03-28 13:28:24 -04:00
package.json update for the db.ts 2026-03-28 14:28:44 -04:00
tsconfig.json feat: add APN relay MVP and experimental push bridge 2026-03-28 13:28:24 -04:00

README.md

APN Relay

Minimal APNs relay for OpenCode mobile background notifications.

What it does

  • Registers iOS device tokens for a shared secret.
  • Receives OpenCode event posts (complete, permission, error).
  • Sends APNs notifications to mapped devices.
  • Stores delivery rows in PlanetScale.

Routes

  • GET /health
  • GET / (simple dashboard)
  • POST /v1/device/register
  • POST /v1/device/unregister
  • POST /v1/event

Environment

Use .env.example as a starting point.

  • DATABASE_HOST
  • DATABASE_USERNAME
  • DATABASE_PASSWORD
  • APNS_TEAM_ID
  • APNS_KEY_ID
  • APNS_PRIVATE_KEY
  • APNS_DEFAULT_BUNDLE_ID

Run locally

bun install
bun run src/index.ts

Docker

Build from this directory:

docker build -t apn-relay .
docker run --rm -p 8787:8787 --env-file .env apn-relay