#Custom data/payload

1 messages · Page 1 of 1 (latest)

naive shuttle
#

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);

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!

carmine sable
#

@naive shuttle

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?

naive shuttle
carmine sable
#

You can use build workflows from code using @novu/framework

Checkout quick start guide for preferred framework

signal lark
#

Hey @carmine sable
I'm working with @naive shuttle 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 👍

carmine sable
#

@signal lark

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

signal lark
#

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.

carmine sable
#

@signal lark

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

signal lark
#

@carmine sable amazing news! what would be your guess speaking timelines here? Are we talking days, weeks, months?

carmine sable
#

@signal lark it may take few weeks.

naive shuttle
#

Hey @carmine sable ,
Do you have any updates on this?