Go Quickstart
Welcome to Go Quickstart guide for Novu. In this guide, you’ll learn how to use Novu in a Go application. Novu is a powerful notification service that enables you to send multi-channel (SMS, Email, Chat, Push) notifications. Let’s see how you can seamlessly integrate Novu into your Go project!Prerequisites
Before diving into the Quickstart, make sure you have the following:- The Go SDK installed on your development machine.
- A Novu account. If you don’t have one, sign up for free here
Install and Set Up Novu in your Go Project
First, you must install the Novu package in your Go project. From your terminal, you can install the Novu package in your project by running the following command:<NOVU_API_KEY> with your own API key that you got from the API Key section of your Novu Dashboard.
🔑 Note: Please do not hardcode your credentials in a file in production. Use environment variables instead.
Configure retry
| Options | Detail | Default Value |
|---|---|---|
| RetryMax | Specifies total number of retries to perform in case of failure | 0 |
| WaitMin | Specifies the minimum time to wait before retrying | 0 |
| WaitMax | Specifies the maximum time to wait before retrying | 0 |
| InitialDelay | Specifies the initial delay before the first retry attempt | 0 |
Above retry configuration is applied to all the sdk methods.
Set Up A Channel Provider
A channel provider is a service that lets you use one or more notification channels such as sending an email, SMS, push notification etc. Our integration store currently supports four channels: Email, SMS, Chat, and Push. Each of these channels have multiple providers associated with them.| Channel | Providers |
|---|---|
| MailGun, Mandrill, MailJet, Amazon SES, Sendgrid, Postmark, Netcore | |
| SMS | Twilio, Amazon SNS, Plivo, SMS, SMSCentral, Kannel, Infobip, Termii |
| Chat | Mattermost, Slack, Microsoft Teams, Discord |
| Push | FCM, APNS, Expo |
Create a Notification Workflow
A notification workflow is the blueprint for the notifications that will be sent. It holds the entire flow of messages sent to the subscriber. The workflow includes the following:- Notification 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 | ✅ |
Proper authorization needs to be setup for the Chat channel.
- Click Workflows on the left sidebar of your Novu dashboard.
- Click the Create Workflow button on the top right.
- Select blank workflow from the dropdown.
- The name of a new workflow is currently “Untitled.” Rename it to a suitable title.
-
Select any channel you want to use in your app. For the sake of this guide, we’ll be using the ‘Email’ channel.

Select any channel you want. We'll use the email channel
- Click on the recently added channel, fill the email subject and click “Update”.

Update email template
- Click on the “Test” tab and send a test email to verify your notification workflow.

Send a test email to test the workflow
Create A Subscriber
The recipients of a triggered notification are called subscribers. Click Subscribers on the left sidebar of the Novu dashboard to see all subscribers. By default, the dashboard will display only one subscriber, as you were added automatically during sign-up.
Navigate to `Subscribers` from the left sidebar
Update A Subscriber
To update the Subscriber details you can call the put method from SubcriberApi. Here is an example:Note: To send notifications to all your users, you’ll need to make them subscribers in Novu, which you can do by programmatically adding them to Novu.
Trigger A Notification
Copy and paste the following code into your app to trigger a notification:- The value of
eventIdshould be the notification workflow’s trigger ID/slug.

The value of `eventId` should be the notification workflow's trigger ID/slug
- The value of
payloadis an array of the data that you want to be dynamically injected into the notification template content. - The value of
subscriberIdis the id of the subscriber on Novu.
Topics
Novu provides a simple API that offers an easy interface for triggering notifications to multiple subscribers at once. This API is called Topics and allows users to manage their bulk notifications without having to implement complex loops. A topic is identified by a custom key and this key will be the identifier used when triggering notifications. You can assign a name to a topic for descriptive purposes. This name does not need to be unique and can be changed programmatically.The topic key should be unique and can’t be changed once chosen. Novu also safe guards for key uniqueness behind the scenes.
Create a Topic
Copy and paste the following code into your app to create a topic:- When creating a
key, ensure it is unique and accurately identifies the topic. Document naming conventions and communicate them to team members to avoid confusion and ensure a smooth workflow. - The value of
nameshould be a descriptive topic name.
Add subscribers to a Topic
Copy and paste the following code into your app to add subscribers a topic:Sending a notification to a Topic
Thanks to the topics feature, it is possible to trigger a notification to all subscribers assigned to a topic. This helps avoid listing all subscriber identifiers in theto field of the notification trigger.
To trigger a notification to all subscribers of a topic, copy and paste the code below:
Next Steps
Great job! If you’ve reached this point, you should now have successfully created a subscriber, notification workflow, configured a channel provider and triggered a notification in your application. To learn more about notifications and explore Novu’s features and capabilities, check out:- Novu Digest Engine - Learn how to aggregate multiple trigger events into a single message and deliver it to the subscriber.
- Novu Go SDK - Delve deeper into the SDK and explore a lot of features.
- Novu Notification Center - Learn how to integrate a rich, ready-to-use real-time UI notification center into your app.