A standalone toy platform to send push notifications via APNS (iOS) and FCM (Android). Accepts a common payload structure and routes to the appropriate service based on platform.
Kept in this repo for testing purposes. Can be moved to its own project for standalone use.
pnpm install
cp .env.example .env
# Edit .env with your credentials
pnpm devOpen http://localhost:3998 to use the web UI.
- Node.js 18+
- FCM (Android): Firebase service account JSON
- APNS (iOS): Apple .p8 auth key + key ID, team ID, bundle ID
You can run with only one provider configured; the other will be disabled.
Returns health status and which providers are configured.
{
"ok": true,
"apns": true,
"fcm": true
}Send a push notification.
Request body:
{
"token": "<APNS or FCM device token>",
"platform": "ios" | "android" | null,
"payload": {
"title": "Hello",
"body": "Notification body",
"subtitle": "Optional subtitle",
"data": { "key": "value" },
"sound": "default",
"badge": 1,
"clickAction": "category-id"
}
}- token: APNS device token (iOS) or FCM registration token (Android)
- platform: Optional. If omitted, auto-detected from token format (64 hex chars → iOS/APNS, else → Android/FCM)
- payload: Common structure;
titleandbodyare required.datavalues must be strings for FCM compatibility.
Example (curl):
curl -X POST http://localhost:3998/api/send \
-H "Content-Type: application/json" \
-d '{
"token": "YOUR_DEVICE_TOKEN",
"payload": {
"title": "Test",
"body": "Hello from notification trigger"
}
}'Copy .env.example to .env and fill in your credentials. See .env.example for all required variables.
pnpm build
pnpm startWhen used from the prototype monorepo:
- Control panel uses
NOTIFICATION_TRIGGER_URL(e.g.http://localhost:3998) to send notifications - The provisioner (evault-core) stores device tokens; the control panel fetches them and sends via this service
