Consuming digest in headless lib
Hi, I was trying to find an example on how to consume in-app messages that have gone through a digest using the headless lib but couldn't find any, the website only shows the notification center examples here https://docs.novu.co/guides/add-digest-to-inapp-notifications , are there any other examples I can look at for the headless lib or pointers on how to consume them?
Novu
How to Add Digest to In-App Notifications - Novu
Leverage the digest functionality to send in-app notifications
8 Replies
Hi @sandsower, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* How to use Headless Notification Center
* Demo apps
* Headless API Reference
* How to Add Digest to In-App Notifications
-----------------------------
Answer
Currently, the official Novu documentation does not provide a direct example specifically for consuming digested in-app messages through the headless library. The guide available focuses on how to add digest notifications to in-app notifications using the Novu Notification Center, which involves configuring workflows in the Novu dashboard and integrating the Notification Center on the frontend (1) .
For utilizing the headless library, Novu's documentation offers a comprehensive guide on setting up and using the Headless Notification Center. This guide includes steps for setting up your front end with the headless package and interacting with notifications through it (2) . While it doesn't specifically address consuming digested messages, the principles of using the headless library for notification management could be adapted for your digest scenario.
To integrate and manage notifications, including potentially digested ones, through a headless approach, you may need to leverage the Headless API methods detailed in the API reference. This involves initializing sessions, fetching notifications, and handling notification states (3) .
If digest functionality within the headless context is essential for your project, considering the headless library's aim to offer more control and flexibility, you might need to tailor the library's general notification handling methods for your specific use case involving digested messages.
For further insights, exploring the Novu community contributions or reaching out for collaborative solutions within the community channels could be beneficial,
as the community might have developed custom solutions or workarounds that are not yet documented officially.
Got it. Tagging @Support for additional help.
@sandsower
We will soon revamp headless guides as these are bit outdated.
Checkout this method to fetch messages in APi
https://docs.novu.co/notification-center/client/headless/api-reference#fetchnotifications
Yeah I saw that reference but I couldn't find a way to consume the digest size, I need it in our app
@sandsower Novu sends only one digested message. Are you looking for all digested event payloads along with digested message
I'm looking for a way to get the size of the digest in the payload, if there is any. Getting all digested event payloads could also work as I could just get the length