@novu/api notification feed - query API
Context
I have multiple workflows, each receives unique payload as input.
In my
Then
to fetch user's notification in context of the specified
Problem
The problem is that @novu/api
What's currently possible is to filter by partial input payload. From Docs:
And this is where the problem resides. As I've mentioned in the beginning, my worklows have different payload shape. This means that I cannot easily fetch the same notifications that I fetch via the
Possible solutions
I have multiple workflows, each receives unique payload as input.
In my
step.email , step.inApp , step.push and etc. I can format data like so:Then
orgId can be then used in useNotificationsto fetch user's notification in context of the specified
orgIdProblem
The problem is that @novu/api
novu.subscribers.notifications.feed method does not allow to filter by data.orgId.What's currently possible is to filter by partial input payload. From Docs:
Base64 encoded string of the partial payload JSON objectSource: https://docs.novu.co/api-reference/subscribers/retrieve-subscriber-notifications
And this is where the problem resides. As I've mentioned in the beginning, my worklows have different payload shape. This means that I cannot easily fetch the same notifications that I fetch via the
useNotifications hookPossible solutions
- Add an endpoint that exposes exactly the same data structure as the
useNotificationshook. This will allow to filter bydata.orgId - Add
ORmethod current endpoint. This way I can specify multiple partial payload inputs and fetch the notifications
