Skip to content

WebAPI: Support push notification with WebPush#23095

Open
tehcneko wants to merge 1 commit intoqbittorrent:masterfrom
tehcneko:webpush
Open

WebAPI: Support push notification with WebPush#23095
tehcneko wants to merge 1 commit intoqbittorrent:masterfrom
tehcneko:webpush

Conversation

@tehcneko
Copy link
Contributor

@tehcneko tehcneko commented Aug 12, 2025

Implemented RFC 8291 and RFC 8292.
You can read more info about Web Push API at MDN:
https://developer.mozilla.org/en-US/docs/Web/API/Push_API
Web Push functionalities in WebUI are implemented in pull request #23096.


API Changes:

  • Add push/subscribe endpoint with parameter subscription for registering WebPush notifications
    subscription can be obtained from PushManager.subscribe() in browser, eg:
{
    "endpoint": "https://fcm.googleapis.com/fcm/send/[REDACTED]", 
    "keys": {
        "p256dh": "[REDACTED]", 
        "auth": "[REDACTED]"
    }
}
  • Add push/subscriptions endpoint for listing all subscribed WebPush subscriptions
  • Add push/test endpoint for testing WebPush notifications
  • Add push/unsubscribe endpoint with parameter endpoint for unregistering WebPush notifications
  • Add push/vapidPublicKey endpoint for retrieving the VAPID public key for WebPush notifications subscribing

Push payloads are in following format:

{
    "event": "torrent_finished",
    "payload": {
        "torrent_name": "Test",
     }
}

Currently supported events: test, torrent_added, torrent_finished, full_disk_error, add_torrent_failed.


image

Closes #16414

@glassez
Copy link
Member

glassez commented Aug 12, 2025

@tehcneko
Could you describe for those who are out of topic, how it is supposed to be used? Preferably in enough detail that someone can test it.

@tehcneko
Copy link
Contributor Author

@glassez You can test it with WebUI from #23096.

@tehcneko tehcneko force-pushed the webpush branch 2 times, most recently from d5276be to 28ad30a Compare August 12, 2025 13:52
@tehcneko tehcneko force-pushed the webpush branch 3 times, most recently from c6efde8 to 7744461 Compare August 16, 2025 03:21
@xavier2k6 xavier2k6 added the WebAPI WebAPI-related issues/changes label Sep 13, 2025
@github-actions
Copy link

This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity.

@tehcneko
Copy link
Contributor Author

Yeah, it has been a while...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebAPI WebAPI-related issues/changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebUI: Push Notifications

3 participants