You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 9a.md
+9-12Lines changed: 9 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,26 +19,23 @@ All other tags MUST be encrypted and placed in the event's `content` field:
19
19
20
20
-`relay` - the normalized url of the relay the event was sent to
21
21
-`filter` - a nostr filter for matching events (may appear multiple times)
22
-
-`server` - a URL indicating a push server to forward events to
23
-
-`vapid_endpoint` - a VAPID push notification endpoint (web push only)
24
-
-`vapid_p256dh` - a VAPID p256dh key (web push only)
25
-
-`vapid_auth` - a VAPID auth key (web push only)
26
-
-`fcm_token` - a Firebase Cloud Messaging token (android only)
27
-
-`apns_token` - an APNs token (ios only)
28
-
-`ios_bundle_identifier` - a iOS app bundle identifier (ios only)
29
-
-`silent` - whether silent push notifications should be used
22
+
-`callback` - a URL indicating a callback url to forward events to
30
23
31
24
If a relay does not intend to fulfill the subscription, it SHOULD respond with an `OK` message with `false` as the result and a human-readable message.
32
25
33
-
When a relay receives a new event, it SHOULD match it against all current registrations and forward the event to authorized users by sending an HTTP `POST` request to the `server` URL with `Content-Type: application/json`. The payload should be as follows:
26
+
Because client developers are expected to be running their own push server, any other features such as registration of device tokens, notification cancellation, or client status should be implemented directly between the client and the push server.
27
+
28
+
When a relay receives a new event, it SHOULD match it against all current registrations and forward the event to authorized users by sending a `POST` request to the `callback` URL with `Content-Type: application/json`. The payload should be as follows:
34
29
35
30
```typescript
36
31
{
32
+
relay: string// The normalized url of the relay sending the notification
37
33
event: Event// The signed nostr event
38
-
config: string[][] // The private tags provided by the user to the relay
39
34
}
40
35
```
41
36
42
-
If a relay receives a `kind 30390` event not p-tagged to itself, it SHOULD NOT store it. If a relay receives a `kind 30390` event whose `relay` tag does not match the relay's own URL, the relay SHOULD discard it. However, special purpose relays MAY choose to implement this behavior on behalf of other relays that do not support this NIP.
37
+
If the `callback` URL responds with a `404` status code, the relay SHOULD delete the subscription. Relays MAY delete subscriptions at their discretion (e.g. due to expiration, inactivity, callback `500` errors, etc).
43
38
44
-
Relays SHOULD delete subscription events after 30 days. Clients MAY re-publish subscription events periodically if they wish to continue receiving push notifications. Clients MAY delete subscription events as specified in [NIP 09](09.md).
39
+
If a relay receives a request for `kind 30390`, it should respond only with the current user's subscription events (based on [NIP 42](42.md) AUTH). Clients MAY wish to sync subscription events periodically if they wish to ensure they continue receiving push notifications. Clients MAY delete subscription events as specified in [NIP 09](09.md), or they may delete subscriptions with the push server directly, relying on `callback` error responses to clean up relay subscriptions.
40
+
41
+
If a relay receives a `kind 30390` event not p-tagged to itself, it SHOULD NOT store it. If a relay receives a `kind 30390` event whose `relay` tag does not match the relay's own URL, the relay SHOULD discard it. However, special purpose relays MAY choose to implement this behavior on behalf of other relays that do not support this NIP.
0 commit comments