Prerequisites
To follow the steps in this quickstart, you’ll need:- A Novu account. If you don’t have one, sign up for free.
- Node.js installed on your development machine.
Create a RedwoodJS app
Clone the popular RedwoodJS blog tutorial app by running the following command in your terminal:Install Novu
To install Novu’s In-App notification center, simply issue the following command:Register The Notification Center Component
Head over toweb/src/layouts/BlogLayout/BlogLayout.js
file of the recently cloned project and add the Novu In-App Notification center.
The file should look like this:
Add
REDWOOD_ENV_APPLICATION_IDENTIFIER
and REDWOOD_ENV_SUBSCRIBER_ID
to
the .env
file.Subscriber ID
ideally should be the id
of the logged in user. When a user logs into your app, they’ll be able to see all their notifications in the notification center. For this to work successfully, the user should have been created as a subscriber on Novu.
The Application Identifier
is a public key used to identify your application.
Head over to your Novu dashboard settings, copy the application identifier and add it as the value of REDWOOD_ENV_APPLICATION_IDENTIFIER
.
Head over to the Subscribers page, grab a subscriber identifier and add it as the value of REDWOOD_ENV_SUBSCRIBER_ID
in the .env
file.
Now, check your app, you will see a notification bell button. Click on the button to reveal the notification center UI. Voila!
There are no notifications because none has been triggered yet. When
notifications are sent to a subscriber, it will show up in the UI. Next, we’ll
learn how to trigger notifications.
Create A Workflow
The first step to trigger notifications is to create a workflow. A workflow is like a map that holds the entire flow of messages sent to the subscriber.The recipients of a triggered notification are called subscribers.
- Workflow name and Identifier
- Channel tailored content:
Channel | Content Style | Custom Variables{{handlebars}} format |
---|---|---|
HTML | ✅ | |
Visual Editor | ✅ | |
SMS | Text | ✅ |
Chat | Text | ✅ |
In-App | Text | ✅ |
Push | Text | ✅ |
- Click Workflows on the left sidebar of your Novu dashboard.
- Click the Add a workflow button on the top left.
- The name of the new workflow is currently “Untitled.” Rename it to a more suitable title.
- Select In-App as the channel you want to add.
- Click on the recently added In-App channel and configure it.

Configure it as per your requirements and then save it
- 1-Preview: Shows you a glimpse of how each notification item will look like in the Notification Center UI.
- 2-Avatar: If turned on, each notification item will show the avatar of the subscriber.
- 3-Action: With this, you can add a primary and secondary call to action button to each notification item.
- 4-Notification Feeds: This displays a stream of specific notifications. You can have multiple feeds to show specific notifications in multiple tabs.
- 5-Redirect URL - This is the URL to which a subscriber can be directed when they click on a notification item.
- 6-Filter - This feature allows you to configure the criteria for delivering notifications. For instance, you can apply a filter based on a subscriber’s online status to send them an email if they were online within the last hour. Read more about filters.
Editor
, add the following content and rename the step to Onboarding In App
:
{{ name }}
and {{ message }}
are payload values that will be passed on from
our code to the workflow template so it can appear in the notification sent to
subscribers.Update
button to save the configuration successfully!
- In the workflow page, drag and drop the Email channel to the workflow canvas to be just below the
In-App
channel. - Click on the recently added Email channel and configure it:
Sender name
and Subject
. Ensure the Default Layout
is selected for the Email Layout.
Switch to the Custom Code
section and add the following:
Trigger A Notification
Open upapi/src/services/contacts/contacts.js
, and add the following code into your app to trigger a notification:
- The value of
<workflow-trigger-id>
should be the workflow’s trigger ID/slug. - The value of
payload
is an array of the data that you want to be dynamically injected into the workflow content. - The value of
subscriberId
is the id of the subscriber on Novu. - Ensure
NOVU_API_KEY
is in the.env
file and with the appropriate value gotten from the dashboard.
One more thing
Head over to the integrations store on your Novu dashboard. Select the Novu Email Test Provider, and mark as the primary provider for Emails. This ensures that all emails are sent via the Novu Email provider.Test the app
Ensure your app is still running and head over the/contact
page in the app. Fill the form and click Save
.
The app will trigger two notifications:
- An In-App notification
- An Email notification