Learn how to use Novu to quickly send multi-channel (SMS, Email, Chat, Push) notifications with VanillaJS.
application-identifier
and subscriber-id
.
An application identifier is a public key used to identify your application. You can get your own application identifier from the Novu dashboard settings.
And subscribers are users to which notifications will be sent. They are identified by a subscriberID
which you can also find in the Novu subscribers dashboard. Let’s learn more about subscribers.
Subscribers from the left sidebar shows all the subscriber
subscriberId
.
With Novu, you can create a subscriber using any of its SDKs (Node.js, PHP, .NET, Go, Ruby, Python and Kotlin). The code to create a subscriber in Novu is:
<NOVU_API_KEY>
with it. Now, if you’ll go to the Novu dashboard, you shall see the subscriber we created above with subscriberId
of 123
.
You can also update information about an already existing subscriber using the subscriber.update
method as shown below:
The recipients of a triggered notification are called subscribers.The workflow includes the following:
Channel | Content Style | Custom Variables{{handlebars}} format |
---|---|---|
HTML | ✅ | |
Visual Editor | ✅ | |
SMS | Text | ✅ |
Chat | Text | ✅ |
In-App | Text | ✅ |
Push | Text | ✅ |
Select the in-app channel
Configure it as per your requirements and then save it
We'll use the custom variables functionality
subscriberID
, we’re ready to send notifications using Novu!
notification-center-component
in your html file as shown below.
script
element at the bottom or move it all into a separate JavaScript file (don’t forger to link to the JavaScript file in this case).
Here’s an example of such an HTML file:
Make sure you’re executing this code with the correct credentials.