N
Novu4mo ago
Kamal

How do you set the primaryAction or other metadata for inApp notifications.

The step.inApp under a workflow only seems to have a body field. It has no other documented fields. How do you trigger an inApp notification with actions and other metadata?
9 Replies
Ask Inkeep
Ask Inkeep4mo ago
Hi @Kamal, 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: * Building notification workflows with the Novu Framework * How to send web push notifications with FCM and Novu * In-App Channel Step * Glossary -----------------------------
Ask Inkeep
Ask Inkeep4mo ago
Answer Based on the information available in the documentation, the step.inApp method in Novu workflows appears to only have a body field documented. (1) The documentation doesn't explicitly mention fields for primaryAction or other metadata for in-app notifications. Here's an example of how the step.inApp is typically used in a workflow:
await step.inApp('inbox', async () => {
return {
body: 'A new notification has been created',
};
});
await step.inApp('inbox', async () => {
return {
body: 'A new notification has been created',
};
});
The documentation doesn't provide information about setting additional metadata or actions for in-app notifications directly within the workflow step. Given the limited information available in the provided sources, I don't have a direct answer to how to set primaryAction or other metadata for in-app notifications within the workflow step. I suggest you click on the "Ask for help" button to tag a team member to review your question about adding actions and metadata to in-app notifications. They may have more detailed information or updates that aren't reflected in the current documentation.
Ask Inkeep
Ask Inkeep4mo ago
Feel free to tag @Ask Inkeep with additional questions. Got it. Tagging @Support for additional help.
Pawan Jain
Pawan Jain4mo ago
@Kamal Thanks for reaching out. Currently in-app step supports only body field. We are continuously working on adding actions, redirect, avatar support as well in novu framework
Dima Grossman
Dima Grossman4mo ago
as @Pawan Jain have mentioned, a few improvements are along the way including a brand new Inbox component in the next 2 weeks. In the meanwhile, you can pass the redirect url as part of your payload in the trigger, and when rendering the notification, you will have access to the original payload sent which you can use for the data for rediraction cc. @sokratis
Kamal
Kamal2mo ago
Awesome, can we also add a payload/custom metadata to inApp notifications? Will the NotificationCenter allow me to define a renderer to customize the notification that gets displayed? Hi Dima, I was wondering if ther was any updates up the new inbox component you guys are working on.
Kamal
Kamal2mo ago
@Pawan Jain thanks, im migrating over to it now. Do you have any idea how you deal with socket subscriptions on the client with the new inbox? For example, i want to show a toast when the user gets a new notification on the client. Before i was using useSocket for that which does not seem to exist any more
Pawan Jain
Pawan Jain2mo ago
@Kamal We are working on hooks. It is WIP
Want results from more Discord servers?
Add your server