Send push notifications to iOS and Android devices from your nself backend. Supports Firebase Cloud Messaging (FCM) for Android and Apple Push Notification service (APNs) for iOS, plus Web Push for browsers.
nself-notify is part of the ɳClaw bundle. Set your key with nself license set nself_pro_... before installing.
nself license set nself_pro_...
nself plugin install notify
nself build
nself start| Variable | Required | Description |
|---|---|---|
PLUGIN_NOTIFY_FCM_SERVER_KEY | Yes (Android) | Firebase Cloud Messaging server key from Firebase Console |
PLUGIN_NOTIFY_APNS_KEY_ID | Yes (iOS) | APNs auth key ID from Apple Developer account |
PLUGIN_NOTIFY_APNS_TEAM_ID | Yes (iOS) | Apple Developer Team ID |
PLUGIN_NOTIFY_APNS_KEY_PATH | Yes (iOS) | Path to the APNs .p8 auth key file |
Add these to your .env file after installing the plugin:
PLUGIN_NOTIFY_FCM_SERVER_KEY=AAAAxxxxxxxx...
PLUGIN_NOTIFY_APNS_KEY_ID=ABCD1234EF
PLUGIN_NOTIFY_APNS_TEAM_ID=TEAM123456
PLUGIN_NOTIFY_APNS_KEY_PATH=/etc/nself/keys/AuthKey_ABCD1234EF.p8# Send a push notification to a user
curl -X POST http://127.0.0.1:3712/notify/send \
-H "Content-Type: application/json" \
-d '{
"channel": "fcm",
"user_id": "user-uuid",
"title": "New message",
"body": "You have a new message from Alice",
"data": {
"conversation_id": "conv-123",
"type": "chat"
}
}'# Register a device token for a user
curl -X POST http://127.0.0.1:3712/notify/subscribe \
-H "Content-Type: application/json" \
-d '{
"user_id": "user-uuid",
"platform": "android",
"device_token": "fcm-device-token-here"
}'| Channel | Platform | Required credentials |
|---|---|---|
fcm | Android | PLUGIN_NOTIFY_FCM_SERVER_KEY |
apns | iOS | PLUGIN_NOTIFY_APNS_KEY_ID, PLUGIN_NOTIFY_APNS_TEAM_ID, PLUGIN_NOTIFY_APNS_KEY_PATH |
webpush | Web browsers | VAPID key pair (auto-generated on first run) |
| Endpoint | Method | Description |
|---|---|---|
/notify/send | POST | Send a push notification to a user or device token |
/notify/subscribe | POST | Register a device token for a user |
/notify/unsubscribe | POST | Remove a device token (call on logout or token refresh) |
/notify/health | GET | Check plugin health and credential status |
{
"channel": "fcm", // fcm | apns | webpush
"user_id": "uuid", // send to all devices for this user
"device_token": "token", // OR send to a specific device token
"title": "string", // notification title
"body": "string", // notification body text
"data": {}, // optional key-value payload for the app
"badge": 1, // iOS badge count (optional)
"sound": "default" // notification sound (optional)
}{
"user_id": "uuid",
"platform": "android", // android | ios | web
"device_token": "string" // FCM token, APNs token, or Web Push subscription
}nself plugin remove notifyPort: 3712 | Bundle: ɳClaw ($0.99/mo) or ɳSelf+ ($3.99/mo) | Last Updated: April 2026 | Plugin Version 1.0.12