N
Novuβ€’2w ago
R4YL

Custom data/payload

Hi guys, I'm trying to send more data such as title or anything custom but it's seems like it's not included in the payload. (In-app notifixations)
payload: {
message: `You got a new follower ${myUsername}`,
redirect: `/users/${myUsername}`,
...custom_data
},

const data = {
to,
payload,
};


await client.trigger(notification.workflowId, data);
payload: {
message: `You got a new follower ${myUsername}`,
redirect: `/users/${myUsername}`,
...custom_data
},

const data = {
to,
payload,
};


await client.trigger(notification.workflowId, data);
When fetching the notifications with useNotifications I only get message and redirect. And if I add something in the Editor it's concatenated in message. Also when adding Avatar the notification returns avatar: undefined. How do I add more custom data? I'm using: "@novu/node": "2.0.5" "@novu/react": "2.6.2" Thanks in advance!
No description
9 Replies
Pawan Jain
Pawan Jainβ€’2w ago
@R4YL I see you are using older version of in-app step editor. @novu/react is compatible with @novu/framework based workflows Do you have nodejs based techstack?
R4YL
R4YLOPβ€’2w ago
Oh okay, Yes, we're using nodejs πŸ™‚
Pawan Jain
Pawan Jainβ€’2w ago
You can use build workflows from code using @novu/framework Checkout quick start guide for preferred framework https://docs.novu.co/quickstart/overview
lillheaton
lillheatonβ€’2w ago
Hey @Pawan Jain I'm working with @R4YL jumping into the discussion. Couple of questions 1. Are Novu planning to decommission the UI flow for creating and administrating workflows and only support "by code"?
2. If this continue to live, are there a plan to support defining/passing the "data" object into the payload even for these "none by code" workflows? What is our need? Mainly using for in-app notifications and are using it in a "headless" manner. We want to render our notifications based on what notification it was. So a "must" would be to identify what notification and up ahead potentially some more data then subject and body.
Why are we not using framework? We have done a evaluation and experimenting with this. We deemed it unnecessary complex for the output and for our project need. We love the idea of defining it by code and sync to x environments, but the requirements of having to run an instance of our server, having a "local studio" with tunneling etc is just too much hassle for the need, "take this definition and put it on X instance". Moving with the manual UI definitions then was a great alternative. BTW I can see the new dashboard 2.0, nice update πŸ‘
Pawan Jain
Pawan Jainβ€’2w ago
@lillheaton
Are Novu planning to decommission the UI flow for creating and administrating workflows and only support "by code"?
No, we are building a new dashboard in which workflows can be created from UI. These workflows will be powered internally by the @novu/framework. Currently, only in-app step can be added, we are working on adding more steps and features.
BTW I can see the new dashboard 2.0, nice update
Thanks, Are you able to access the new dashboard?
If this continue to live, are there a plan to support defining/passing the "data" object into the payload even for these "none by code" workflows?
I am checking this with my team, how it will be supported in new dashboard
lillheaton
lillheatonβ€’2w ago
Thank you for the update! let me know what you find out. Yes we're able to access the new dashboard, experimenting as we speak.
Pawan Jain
Pawan Jainβ€’2w ago
@lillheaton Our team has decided to include separate data field in dashboard where custom key-value pairs can be defined and values of those keys can be sent via payload. later, when notifications are fetched in headless mode, data field will return those values
lillheaton
lillheatonβ€’6d ago
@Pawan Jain amazing news! what would be your guess speaking timelines here? Are we talking days, weeks, months?
Pawan Jain
Pawan Jainβ€’4d ago
@lillheaton it may take few weeks.
Want results from more Discord servers?
Add your server