Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs weekly update #553

Merged
merged 17 commits into from Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion api-reference/subscribers/get-subscriber.mdx
Expand Up @@ -33,7 +33,7 @@ response = requests.request("GET", url, headers=headers)
print(response.text)
```

```js JavaScript
```javascript JavaScript
const options = {method: 'GET', headers: {Authorization: '<authorization>'}};

fetch('https://api.novu.co/v1/subscribers/{subscriberId}', options)
Expand Down
1 change: 0 additions & 1 deletion channels-and-providers/chat/mattermost.mdx
Expand Up @@ -47,7 +47,6 @@ To integrate Mattermost with your application using the Mattermost Bot integrati
Once you have stored the API token in the subscriber entity, you can send notifications to Mattermost using the following code:

```jsx

import { Novu, ChatProviderIdEnum } from '@novu/node';

const novu = new Novu("<NOVU_API_KEY>");
Expand Down
6 changes: 3 additions & 3 deletions channels-and-providers/email/overview.mdx
Expand Up @@ -22,7 +22,7 @@ The overrides field supports an email property. The email overrides field have p

<Tabs>
<Tab title="Node.js">
```js
```javascript
import { Novu } from '@novu/node';

const novu = new Novu('<NOVU_API_KEY>');
Expand Down Expand Up @@ -56,7 +56,7 @@ You can easily send attachments with the Novu API by passing the attachments arr
<Tabs>
<Tab title="Node.js">

```js
```javascript
import { Novu } from '@novu/node';

const novu = new Novu('<NOVU_API_KEY>');
Expand Down Expand Up @@ -93,7 +93,7 @@ Here, if `sendgrid-abcdef` is primary integration and you want to use `brevo-abc

<Tabs>
<Tab title="Node.js">
```js
```javascript
import { Novu } from '@novu/node';

const novu = new Novu('<NOVU_API_KEY>');
Expand Down
27 changes: 16 additions & 11 deletions channels-and-providers/push/fcm.mdx
Expand Up @@ -8,7 +8,7 @@ description: "Learn how to use the Firebase Cloud Messaging (FCM) provider to se

To enable the FCM integration, you need to get your service account key from the [Firebase Console](https://console.firebase.google.com/).

# Generating a Service Account Key JSON
## Generating a Service Account Key JSON

To acquire the account key JSON file for your service account

Expand Down Expand Up @@ -37,7 +37,7 @@ Make sure your service account json content contains these fields
}
```

# FCM Overrides
## FCM Overrides

The overrides field supports apns, android, webpush and fcmOptions overrides

Expand All @@ -48,7 +48,7 @@ The overrides field supports apns, android, webpush and fcmOptions overrides
| webPush | WebpushConfig | https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.webpushconfig |
| fcmOptions | FcmOptions | https://firebase.google.com/docs/reference/admin/node/firebase-admin.messaging.fcmoptions |

# Setting Device Token
## Setting Device Token

Before triggering the notification to a subscriber(user) with push as a step in the workflow, make sure you have added the subscriber's device token as follows:

Expand All @@ -62,12 +62,15 @@ import {

const novu = new Novu("<NOVU_API_KEY>");

await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.FCM, {
deviceTokens: ['token1', 'token2'],
});

````
await novu.subscribers.setCredentials(
'subscriberId',
PushProviderIdEnum.FCM,
{ deviceTokens: ['token1', 'token2'] },
'fcm-MnGLxp8uy'
);
```
</Tab>

<Tab title="cURL">
```bash
curl -L -X PUT 'https://api.novu.co/v1/subscribers/<SUBSCRIBER_ID>/credentials' \
Expand All @@ -84,14 +87,13 @@ curl -L -X PUT 'https://api.novu.co/v1/subscribers/<SUBSCRIBER_ID>/credentials'
},
"integrationIdentifier": "fcm-MnGLxp8uy"
}'
````

```
</Tab>
</Tabs>

Checkout the [API reference](/api-reference/subscribers/update-subscriber-credentials) for more details.

# SDK Trigger Example
## SDK Trigger Example

```jsx
import { Novu } from "@novu/node";
Expand Down Expand Up @@ -190,6 +192,9 @@ novu.trigger("<WORKFLOW_TRIGGER_IDENTIFIER>", {
</Tab>
</Tabs>

## FCM Cost
As per Firebase [pricing](https://firebase.google.com/pricing), **Cloud Messaging** product is free of cost to use. If other Firebase products are used, the cost will be charged as per the product.

## FAQs

<AccordionGroup>
Expand Down
4 changes: 2 additions & 2 deletions channels-and-providers/sms/overview.mdx
Expand Up @@ -25,7 +25,7 @@ Additional credentials can be API key, username, password or other provider spec

The overrides field supports a `sms` property and `from`, `to`, `content` field overrides. This allows you to send a message to a different recipient, from a different sender, or with a different content.

```js
```javascript
import { Novu } from '@novu/node';

const novu = new Novu('<NOVU_API_KEY>');
Expand Down Expand Up @@ -59,7 +59,7 @@ Here, if `twilio-abcdef` is primary integration and you want to use `infobip-abc

<Tabs>
<Tab title="Node.js">
```js
```javascript
import { Novu } from '@novu/node';

const novu = new Novu('<NOVU_API_KEY>');
Expand Down
4 changes: 4 additions & 0 deletions help/account-management.mdx
Expand Up @@ -30,4 +30,8 @@ A new organization can be created by writing something in the dropdown in the le
### How to change organization name?
We are working on account management feature currently so this option is not available in UI as of now. If you want to change your current organization name, [rename organization api](/api-reference/organizations/rename-organization) can be used. if you face any issue in using api or need any help any changing the organization name, please reach out to us at support@novu.co.


### How to upload multiple image assets similar to logo?
Currently, Novu supports uploading only one logo image per organization. If you want to use other images in workflow step content then a valid absolute url of image can be used with `<img>` tag.

<Snippet file="contact-support.mdx" />
3 changes: 3 additions & 0 deletions help/channels/email.mdx
Expand Up @@ -25,4 +25,7 @@ Currently, we support external Provider template support for [sendgrid](/channel
### Can I retrieve only Email content?
Novu does not have a separate API to retrieve email content. However, email content can be retrieved from the email step of the workflow. The email step contains the email content in the `content` field of [get worklfow api](/api-reference/workflows/get-workflow) response.

### How to send inline images in email?
Inline images can be sent using `<img>` tag in the email content. PNG, JPEG, GIF are supported. SVGs are not supported as inline images by most of email clients like gmail, outlook.

<Snippet file="contact-support.mdx" />
12 changes: 2 additions & 10 deletions faqs/questions.mdx → help/faq.mdx
@@ -1,6 +1,6 @@
---
title: "Frequently Asked Questions"
icon: "question"
icon: "comment"
---

## Platform
Expand Down Expand Up @@ -78,20 +78,12 @@ We are now building an automatic tool to help with this migration process, for n

### Can I use Novu free of charge?

Yes, you can. If you send less than 10K events per month, then Novu Cloud is entirely free. Another option is to deploy the Open-Source version of Novu onto your own infrastructure, but that does not give you the unique SLA and global redundancy we have in the Cloud version of Novu.
Yes, you can. If you send less than 30K events per month, then Novu Cloud is entirely free. Another option is to deploy the Open-Source version of Novu onto your own infrastructure, but that does not give you the unique SLA and global redundancy we have in the Cloud version of Novu.

### What is the pricing?

Pricing page is available [here](https://novu.co/pricing/?utm_campaign=docs-faq).

### How long is the open-beta for? When do you plan to start charging?

We plan to convert to the paid version of Novu sometime between Q2 and Q4 of 2023. We will ensure that we contact all of our customers at least 1 month before the switch so that you have plenty of time to ensure your systems are not impacted.

### If I am sending millions of events, but thousands of notifications, will this affect the price?

That’s a great way to do it, sending many events and only handful of notifications means you are able to convey a lot of value while keeping your subscribers happy. We are not only supporting it, it’s also affecting price. On high-volume events to notification, where digest is heavily used each event is calculated as 1/10 of the normal usage.

### Can two subscribers with different `subscriberId`s have the same email address?

Yes, it is possible for two subscribers to have the same email address in our system. This is because the `subscriberId` is the unique identifier that distinguishes one subscriber from another. Even if two subscribers share the same email address, they will have different `subscriberId`s, which allows our system to identify and manage them separately.
5 changes: 4 additions & 1 deletion help/orchestration.mdx
@@ -1,7 +1,7 @@
---
icon: "screwdriver-wrench"
---

## Digest
### New event triggers are merging an active Digest with an old duration..
When a Digest is created with a set duration and an event is triggered, the Digest stays active ( and will batch the events) until the configured duration is over.

Expand All @@ -15,5 +15,8 @@ Yes, Digest supports conditions and can be applied to your Digest step. If the T
### Can a Subscriber control the Digest duration and time?
Not currently. The Digest duration can be changed at the Workflow level only and is applied to all subscribers that Workflow is triggered to. If you have an identified use case for this, please let us know at support@novu.co.

## Delay
### What happens if the delay scheduled date and time is in the past?
If the delay scheduled date and time is in the past, the delay step will fail. Based on the step configuration, workflow will either continue to the next step or workflow will be failed

<Snippet file="contact-support.mdx" />
9 changes: 9 additions & 0 deletions help/others.mdx
@@ -0,0 +1,9 @@
---
icon: "crystal-ball"
---

### Workkflows changes are not showing on the changes
If some changes are pending to promote for the same workflow, then Novu merges subsequent changes into the existing change item.

### Getting CORS error with the API
Novu APIs are developed to be used on the server side. If you are using the API from the browser, you will get a CORS error. You can use the API from the server side or checkout our [client-side libraries](/notification-center/introduction) to fetch in-app notifications.
11 changes: 11 additions & 0 deletions help/overview.mdx
Expand Up @@ -46,6 +46,17 @@ At our Help Center, we're dedicated to provide comprehensive support to ensure y
>
Observability, metrics, analytics, and more.
</Card>
<Card
title="Others"
color="#47BA87"
href="/help/Others"
icon="crystal-ball"
>
Others help topics.
</Card>
<Card title="FAQs" color="#00D7FE" href="/help/faq" icon="comment">
Read frequently asked questions
</Card>
</CardGroup>


Expand Down
15 changes: 14 additions & 1 deletion help/user-management.mdx
Expand Up @@ -4,12 +4,17 @@ sidebarTitle: "User Management"
icon: "users"
---

## Subscribers

### What is a Subscriber?
A subscriber is an entity to which notifications are sent. It is a Novu term similar to a user in your system. As in your system, a user is identified by a unique id, similarly in Novu, a subscriber is identified by a unique id called `subscriberId`. We recommend that the existing value you use in your system as a `userId` to be used as `subscriberId` in Novu. Read more about subscribers on [subscribers documentation page](/subscribers/subscribers).

### Is it necessary to use subscriberId as same as userId?
No, it is not necessary to use subscriberId as same as userId. You can use any unique id as subscriberId. We recommend using userId as subscriberId to avoid any confusion. Some of our customers use a pattern like `auth0|userId` as a value for `subscriberId`.

### Can notification be sent without adding a Subscriber?
No, a notification cannot be sent without adding a subscriber. A subscriber is an entity to which notifications are sent. You need to add a subscriber to Novu before triggering the workflow or inline of trigger. Read more about subscribers on [subscribers documentation page](/subscribers/subscribers).

### What is the right approach to add Subscribers?
Subscribers can be added either [ahead of trigger](/subscribers/subscribers#1-ahead-of-trigger) or [inline of trigger](/subscribers/subscribers#2-inline-of-trigger). One way to add a subscriber using inline of trigger is to create a new subscriber in Novu as soon as they sign up or register in your system.

Expand All @@ -21,4 +26,12 @@ Subscriber credentials for Push and Chat channel providers cannot be added while
SMS and Email channels are a bit different because all providers can work with the same value, so `email` and `phone` [attributes](/subscribers/subscribers#subscriber-attributes) can be added while creating a new Subscriber.

### Can Subscriber preferences be updated while adding a new Subscriber?
Subscriber preference cannot be updated while adding a new subscriber. Novu sets all channels as true by default for new subscribers. You can modify preferences at any time. Read more about [subscriber preferences](/subscribers/preferences).
Subscriber preference cannot be updated while adding a new subscriber. Novu sets all channels as true by default for new subscribers. You can modify preferences at any time. Read more about [subscriber preferences](/subscribers/preferences).

### Can two subscribers with different `subscriberId`s have the same email address?
Yes, it is possible for two subscribers to have the same email address in our system. This is because the `subscriberId` is the unique identifier that distinguishes one subscriber from another. Even if two subscribers share the same email address, they will have different `subscriberId`s, which allows our system to identify and manage them separately.

## Topics

### Can a Subscriber be added to multiple topics at once?
Currently, Novu supports adding a subscriber to only one topic at a time. You can add a subscriber to multiple topics by calling the [add subscriber to topic api](/api-reference/topics/subscribers-addition) multiple times with a particular topic key
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 7 additions & 10 deletions mint.json
Expand Up @@ -43,14 +43,14 @@
"url": "https://www.youtube.com/@novuhq"
},
{
"name": "Get instant help",
"name": "Get Instant Help",
"icon": "discord",
"url": "https://discord.gg/novu?ref=docs-instant-help"
},
{
"name": "FAQs",
"name": "Help Center",
"icon": "bullseye-pointer",
"url": "faqs"
"url": "help"
}
],
"tabs": [
Expand Down Expand Up @@ -431,12 +431,7 @@
"use-cases/centralized-multiple-legacy-implementations"
]
},
{
"group": "FAQs",
"pages": [
"faqs/questions"
]
},

{
"group": "Additional Resources",
"pages": [
Expand Down Expand Up @@ -660,7 +655,9 @@
},
"help/orchestration",
"help/content-management",
"help/observability"
"help/observability",
"help/others",
"help/faq"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions notification-center/client/react/customization.mdx
Expand Up @@ -232,7 +232,7 @@ i18n={{

`styles` prop can be used to cutomise styling of each component of notification center. Read more about [styles prop](/notification-center/client/react/api-reference#styles)

```js
```javascript
export const styles = {
bellButton: {
root: {
Expand Down Expand Up @@ -260,7 +260,7 @@ export const styles = {


<Accordion title="Customizing styles" >
```js
```javascript
const primaryColor = "white";
const secondaryColor = "#AFE1AF";
const primaryTextColor = "#0C0404";
Expand Down
2 changes: 1 addition & 1 deletion notification-center/client/react/get-started.mdx
Expand Up @@ -281,7 +281,7 @@ There are three sockets events available:

Novu does not have a native taost component. However, if your project is using any UI library like chakra, material-ui, mantine then toast component (snackbar in case of material-ui) of these libraries can be used with `useSocket` hook. Add the toast opening code in `socket.on` callback.

```js toast.tsx
```javascript toast.tsx
socket.on("notification_received", (data) => {
console.log(data);
// set received notification content as toast content
Expand Down
2 changes: 1 addition & 1 deletion quickstarts/iFrame.mdx
Expand Up @@ -89,7 +89,7 @@ If you click “Subscriber” on the left sidebar of the **[Novu dashboard](ht
src="/images/Quickstarts/iFrame-quickstart/5.png"
/>

<Note> One subscriber is automatically created when you sign up. </Note>
<Note> One subscriber is automatically created when you sign up. If you don't see the default subscriber, follow [how to create subscriber](/subscribers/subscribers#create-a-subscriber) documentation to learn on how to create one </Note>

Now, let’s create a subscriber on Novu. After creating a subscriber, we’ll trigger a notification to this subscriber. Subscribers are identified by a unique **`subscriberId`**.

Expand Down
2 changes: 1 addition & 1 deletion quickstarts/nodejs.mdx
Expand Up @@ -199,7 +199,7 @@ To trigger a notification to all subscribers of a topic, use Novu's API as follo

```jsx
const topicKey = '<TOPIC_KEY>';
const notificationTemplateId = '<NOTIFICATION_TEMPLATE_ID>';
const notificationTemplateId = '<WORKFLOW_TRIGGER_IDENTIFIER>';

await novu.trigger(notificationTemplateId, {
to: [{ type: 'Topic', topicKey: topicKey }],
Expand Down
2 changes: 2 additions & 0 deletions quickstarts/react.mdx
Expand Up @@ -89,6 +89,8 @@ If you click “Subscriber” on the left sidebar of the [Novu dashboard](https
<img src="/images/auto-sub-react.png" />{" "}
</Frame>

<Note>If you don't see the default subscriber, follow [how to create subscriber](/subscribers/subscribers#create-a-subscriber) documentation to learn on how to create one </Note>

Now, let’s create a subscriber on Novu. After creating a subscriber, we’ll trigger a notification to this subscriber. Subscribers are identified by a unique `subscriberId`.

With Novu, you can create a subscriber using any of its SDKs (Node.js, PHP, .NET, Go, Ruby, Python and Kotlin). The NodeJS code to create a subscriber in Novu is:
Expand Down