[GH-ISSUE #883] Nested topics possible? ie: my-topic/group1 or my-topic/group2 #625

Closed
opened 2026-05-07 00:26:01 +02:00 by BreizhHardware · 5 comments

Originally created by @ktiedt on GitHub (Sep 15, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/883

Question
I have done some testing with this and it appears to not be supported, however, I wanted to make sure so I am asking here. I was testing to see if topics could be nested, like so 'mytopic/group1' 'mytopic/group2' so that one main topic name works for the entire application, and all the specific topics would live under it, and could be subscribed to specifically, or retrieved as a sub to 'mytopic' and hear everything. Currently the IOS app wont even allow 'mytopic/extra' to be added, but also, no topics were found online or in the issues that seemed to match.

And just to be thorough, in this example, listening to 'mytopic/group1' would only see pubs for 'mytopic-group1', same for group2, but something listening to 'mytopic' would recieve notifications of both 'mytopic/group1' and 'mytopic/group2'

Thanks in advance and thanks for the awesome project.

Originally created by @ktiedt on GitHub (Sep 15, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/883 <!-- Before you submit, consider asking on Discord/Matrix instead. You'll usually get an answer sooner, and there are more people there to help! - Discord: https://discord.gg/cT7ECsZj9w - Matrix: https://matrix.to/#/#ntfy:matrix.org / https://matrix.to/#/#ntfy-space:matrix.org --> :question: **Question** I have done some testing with this and it appears to not be supported, however, I wanted to make sure so I am asking here. I was testing to see if topics could be nested, like so 'mytopic/group1' 'mytopic/group2' so that one main topic name works for the entire application, and all the specific topics would live under it, and could be subscribed to specifically, or retrieved as a sub to 'mytopic' and hear everything. Currently the IOS app wont even allow 'mytopic/extra' to be added, but also, no topics were found online or in the issues that seemed to match. And just to be thorough, in this example, listening to 'mytopic/group1' would only see pubs for 'mytopic-group1', same for group2, but something listening to 'mytopic' would recieve notifications of both 'mytopic/group1' and 'mytopic/group2' Thanks in advance and thanks for the awesome project.
BreizhHardware 2026-05-07 00:26:01 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@wunter8 commented on GitHub (Sep 15, 2023):

This is not supported right now, and there aren't any plans to add it

You could achieve something similar (at least through the API) using tags: https://docs.ntfy.sh/subscribe/api/#filter-messages

As far as I know, neither Android or iOS supports filtering by tags yet, though

<!-- gh-comment-id:1721884373 --> @wunter8 commented on GitHub (Sep 15, 2023): This is not supported right now, and there aren't any plans to add it You could achieve something similar (at least through the API) using tags: https://docs.ntfy.sh/subscribe/api/#filter-messages As far as I know, neither Android or iOS supports filtering by tags yet, though
Author
Owner

@ktiedt commented on GitHub (Sep 15, 2023):

Thanks @wunter8 i suppose tags would not be useful for access restrictions based on that response as well so sounds like a non-starter for this design. Back to the drawing board for me.

<!-- gh-comment-id:1721898192 --> @ktiedt commented on GitHub (Sep 15, 2023): Thanks @wunter8 i suppose tags would not be useful for access restrictions based on that response as well so sounds like a non-starter for this design. Back to the drawing board for me.
Author
Owner

@wunter8 commented on GitHub (Sep 16, 2023):

ntfy has other features for access restrictions (See access control in the docs)

What are you trying to set up? It might not be quite as convenient, but devices could just subscribe to one or more of the topics mytopic, mytopic-group1, and mytopic-group2, and the publishing device can choose which topic is appropriate to publish to, right?

<!-- gh-comment-id:1722066790 --> @wunter8 commented on GitHub (Sep 16, 2023): ntfy has other features for access restrictions (See access control in the docs) What are you trying to set up? It might not be quite as convenient, but devices could just subscribe to one or more of the topics `mytopic`, `mytopic-group1`, and `mytopic-group2`, and the publishing device can choose which topic is appropriate to publish to, right?
Author
Owner

@ktiedt commented on GitHub (Sep 16, 2023):

@wunter8 something akin to user based subscriptions without having to create a new topic for every event type and maintain access control so only said user or admins could view them. Examples:

Mytopic/user1/on-message

Vs

Mytopic/user2/on-message

Cheesy example but easiest I could think of without going into the weeds

<!-- gh-comment-id:1722073424 --> @ktiedt commented on GitHub (Sep 16, 2023): @wunter8 something akin to user based subscriptions without having to create a new topic for every event type and maintain access control so only said user or admins could view them. Examples: Mytopic/user1/on-message Vs Mytopic/user2/on-message Cheesy example but easiest I could think of without going into the weeds
Author
Owner

@binwiederhier commented on GitHub (Sep 24, 2023):

As @wunter8 said, there are no plans for subtopic support. You can achieve user access for "subtopics only accessible for ..." using ACLs and patterns, e.g. `ntfy access user1 'mytopic-group1-*', but that's all. I think it's still limited and won't wor for your entire use case, though.

I'm closing this ticket since it's about nested topics, but feel free to continue talking here or on Discord/Matrix.

<!-- gh-comment-id:1732612475 --> @binwiederhier commented on GitHub (Sep 24, 2023): As @wunter8 said, there are no plans for subtopic support. You can achieve user access for "subtopics only accessible for ..." using ACLs and patterns, e.g. `ntfy access user1 'mytopic-group1-*', but that's all. I think it's still limited and won't wor for your entire use case, though. I'm closing this ticket since it's about nested topics, but feel free to continue talking here or on Discord/Matrix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#625
No description provided.