diff --git a/.cspell.json b/.cspell.json index 2ecf56e0d99..5d1757422e2 100644 --- a/.cspell.json +++ b/.cspell.json @@ -587,8 +587,6 @@ ".eslintrc.js", ".vscode/settings.json", "*/**/.vscode/settings.json", - "docs/src/usage-examples.md", - "docs/static/csv/mock_data.csv", "apps/worker/README.md", ".gitignore", "angular.json", diff --git a/.github/labeler.yml b/.github/labeler.yml index 1b8a7cdbae9..557afd5eb7d 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -8,8 +8,6 @@ - apps/ws/**/* '@novu/inbound-mail': - apps/inbound-mail/**/* -'documentation': - - docs/**/* '@novu/webhook': - apps/webhook/**/* '@novu/dal': diff --git a/.vscode/launch.json b/.vscode/launch.json index 126ae51cd97..62c8e896691 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -86,20 +86,6 @@ ], "type": "pwa-node" }, - { - "name": "DOCS", - "request": "launch", - "runtimeArgs": [ - "run-script", - "start" - ], - "runtimeExecutable": "npm", - "cwd": "${workspaceFolder}/docs", - "skipFiles": [ - "/**" - ], - "type": "pwa-node" - }, { "name": "WS", "request": "launch", diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js deleted file mode 100644 index ec5643008f4..00000000000 --- a/docs/.eslintrc.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = { - env: { - browser: true, - es6: true, - }, - extends: ['prettier'], - globals: { - Atomics: 'readonly', - SharedArrayBuffer: 'readonly', - }, - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - ecmaVersion: 2020, - sourceType: 'module', - }, - plugins: ['react'], - rules: { - camelcase: 'off', - '@typescript-eslint/camelcase': ['warn'], - }, - settings: { - 'import/resolver': { - node: { - paths: ['src'], - }, - }, - }, -}; diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 848fe2e098b..00000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Dependencies -/node_modules - -# Production -/build - -# Generated files -.docusaurus -.cache-loader - -# Misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -.vercel diff --git a/docs/.husky/pre-commit b/docs/.husky/pre-commit deleted file mode 100755 index 36af219892f..00000000000 --- a/docs/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npx lint-staged diff --git a/docs/.lintstagedrc b/docs/.lintstagedrc deleted file mode 100644 index 51527247d01..00000000000 --- a/docs/.lintstagedrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "*.{js,jsx,tsx,html,css,scss,md}": "prettier --write", - "*.{js,jsx,tsx}": "eslint --cache --fix", - "*.{css,sass,scss,md,html}": "stylelint --cache --fix --ignore-path .gitignore", - "*.{md}": "markdownlint --fix --ignore-path .gitignore" -} \ No newline at end of file diff --git a/docs/.markdownlint.jsonc b/docs/.markdownlint.jsonc deleted file mode 100644 index d800b5fb119..00000000000 --- a/docs/.markdownlint.jsonc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../.markdownlint.jsonc" -} diff --git a/docs/.prettierignore b/docs/.prettierignore deleted file mode 100644 index c7689eb6932..00000000000 --- a/docs/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -# Ignore artifacts: -build -package.json -yarn.lock -*.md -.docusaurus \ No newline at end of file diff --git a/docs/.prettierrc b/docs/.prettierrc deleted file mode 100644 index 62a604f6585..00000000000 --- a/docs/.prettierrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "printWidth": 100, - "tabWidth": 2, - "useTabs": false, - "semi": true, - "singleQuote": true, - "quoteProps": "as-needed", - "jsxSingleQuote": false, - "trailingComma": "es5", - "bracketSpacing": true, - "bracketSameLine": false, - "arrowParens": "always", - "endOfLine": "lf" -} diff --git a/docs/.stylelintrc b/docs/.stylelintrc deleted file mode 100644 index 9c3d5861aa7..00000000000 --- a/docs/.stylelintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": [ - "stylelint-config-standard", - "stylelint-config-recommended-scss", - "stylelint-config-css-modules", - "stylelint-config-recess-order" - ], - "rules": { - "no-descending-specificity": null, - "at-rule-no-unknown": null, - "scss/at-rule-no-unknown": [ - true, - { - "ignoreAtRules": ["value"] - } - ] - } -} diff --git a/docs/LICENSE b/docs/LICENSE deleted file mode 100644 index eaa29bae7ca..00000000000 --- a/docs/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Novu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 5e52057b5a9..00000000000 --- a/docs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Website - -This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. - -## Installation - -```bash -$ yarn -``` - -### Local Development - -```bash -$ yarn start -``` - -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. - -### Build - -```bash -yarn build -``` - -This command generates static content into the `build` directory and can be served using any static contents hosting service. - -### Deployment - -```bash -GIT_USER= USE_SSH=true yarn deploy -``` - -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. diff --git a/docs/babel.config.js b/docs/babel.config.js deleted file mode 100644 index e00595dae7d..00000000000 --- a/docs/babel.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], -}; diff --git a/docs/docs/channels/_category_.json b/docs/docs/channels/_category_.json deleted file mode 100644 index 6e08bb9d0c4..00000000000 --- a/docs/docs/channels/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "Channels", - "position": 4, - "collapsible": false -} diff --git a/docs/docs/channels/chat/_category_.json b/docs/docs/channels/chat/_category_.json deleted file mode 100644 index 49add87ddcf..00000000000 --- a/docs/docs/channels/chat/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Chat", - "position": 1 -} diff --git a/docs/docs/channels/chat/discord.md b/docs/docs/channels/chat/discord.md deleted file mode 100644 index 8e86c78172b..00000000000 --- a/docs/docs/channels/chat/discord.md +++ /dev/null @@ -1,37 +0,0 @@ -# Discord - -When using Discord, you will have to save the integration credentials on the subscriber entity. Discord supports two ways to do this: - -1. Using the **Discord Webhook** integration. -2. Using the **Discord Bot** integration. - -Right now, Novu only supports the **Discord Webhook** integration, since the easiest way to set up is when you know in advance where the notifications should be sent. This is a common approach when you need to notify a particular channel about updates. - -## Quickstart - -Let's follow a simple guide on how you can generate a webhook token for testing purposes: - -1. Go to the channel you want to add the webhook to(you have to be the admin of the discord server). -2. Right-click the channel and select "Edit Channel". -3. Integrations -> Webhooks -> New Webhook -4. Copy the webhook URL . -5. Persist the webhook URL on the subscriber entity. - -```typescript -import { Novu, ChatProviderIdEnum } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -await novu.subscribers.setCredentials('subscriberId', ChatProviderIdEnum.Discord, { - webhookUrl: 'https://discord.com/api/webhooks/...', -}); -``` - -- `subscriberId` is a custom identifier used when identifying your users within the Novu platform. -- `providerId` is a unique provider identifier. We recommend using our ChatProviderIdEnum to specify the provider. -- The third parameter is the credentials object. In this case, we use the `webhookUrl` property to specify the webhook URL generated in the previous step. - - - -6. You are all set up and ready to send your first chat message via our `@novu/node` package or directly using the REST API. - diff --git a/docs/docs/channels/chat/index.md b/docs/docs/channels/chat/index.md deleted file mode 100644 index 2e736d22fdd..00000000000 --- a/docs/docs/channels/chat/index.md +++ /dev/null @@ -1,10 +0,0 @@ -# Chat Channel - -You can send chat messages on popular chat integrations like Discord and Slack. -For Novu to send those messages you will have to store the integration credentials on the subscriber entity. Read more about it [here](/platform/subscribers#updating-subscriber-credentials). - -To read a provider specific documentation: - -- [Discord](/channels/chat/discord) -- [Slack](/channels/chat/slack) -- [MS Teams](/channels/chat/msteams) diff --git a/docs/docs/channels/chat/msteams.md b/docs/docs/channels/chat/msteams.md deleted file mode 100644 index 3c89fb98f7e..00000000000 --- a/docs/docs/channels/chat/msteams.md +++ /dev/null @@ -1,48 +0,0 @@ -# MS Teams - -MS Teams does not need any API Key or client ID to push messages in it. All it needs is the webhook url -to the channel you want to send messages to. That will be taken as the credentials. - -Similarly to Discord, the credentials for this provider need to be stored on the subscriber entity. - -## How to get a MS Teams webhook url - -In order to get a webhook url linked to a specific channel, you should: - -1. Click on the three dots button next to the channel name and select 'Connectors' option. -2. Search for the 'Incoming Webhook' connector and click on 'Configure'. -3. Set a name for the connector and click on the 'Create' button at the bottom. -4. A new url will be generated only for this channel. This is the credentials url you will need. - -## Now, how do we connect our subscribers to MS Teams - -Above url will be the target channel of some subscriber that you want to integrate with. To make this connection, -you have to: - -1. Copy the url that you set up before -2. Update the subscriber credentials with this url using the MS Teams provider id: - -You can do this step by using the `@novu/node` library - -```typescript -import { Novu, ChatProviderIdEnum } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -await novu.subscribers.setCredentials('SUBSCRIBER_ID', ChatProviderIdEnum.MsTeams, { - webhookUrl: 'https://yourcompany.webhook.office.com/webhook...', -}); -``` - -where: - -- `subscriberId` is a custom identifier used when identifying your users within the Novu platform. -- `providerId` is a unique provider identifier, we recommend using our ChatProviderIdEnum to specify the provider. -- The third parameter is the credentials object, in this case we use the `webhookUrl` property to specify the MS Teams channel webhook URL. - -or by calling the `Update Subscriber Credentials` endpoint on Novu API. Check endpoint details [here](https://docs.novu.co/api-reference/subscribers/update-subscriber-credentials). - - - -3. You are all set up and ready to send your first chat message via our `@novu/node` package or directly using the REST API. - diff --git a/docs/docs/channels/chat/slack.md b/docs/docs/channels/chat/slack.md deleted file mode 100644 index ae858847a0f..00000000000 --- a/docs/docs/channels/chat/slack.md +++ /dev/null @@ -1,121 +0,0 @@ -import FAQ from '@site/src/components/FAQ'; -import FAQItem from '@site/src/components/FAQItem'; - -# Slack - -When using Slack you will have to save the integration credentials on the subscriber entity. - -This guide will walk you through the steps needed to obtain the `webhookUrl` that Novu requires to send chat messages to your customers. - -We will provide the basic flow that the user needs to perform, to successfully send notifications via the Slack integration. - -## Application Creation - -This step is optional, if you already have a Slack application you can reuse it. - -1. Go to Slack's developer dashboard [https://api.slack.com/apps](https://api.slack.com/apps). -2. Create a new application. - -## Generation of Webhook Urls for your subscribers - -### Novu Managed (Recommended) - -Novu will manage the OAuth flow and store the credentials - -1. Configure your Slack application as mentioned [below](/channels/chat/slack#slack-application-configuration). -2. Add the `Add to Slack` button or the `Shareable URL` to your application in order to request permission of access (scope: incoming-webhook). - - Make sure you use the generated `Shareable URL` that you can find under Slack integration form in the Integration Store. - The `Shareable URL` should have the following format: - - ```bash - https://api.novu.co/v1/subscribers/SUBSCRIBER_ID/credentials/slack/oauth?environmentId=ENVIRONMENT_ID&integrationIdentifier=INTEGRATION_IDENTIFIER. - ``` - - - SUBSCRIBER_ID is a custom identifier used when identifying your users within the Novu platform. [Read more here](/platform/subscribers).
- - ENVIRONMENT_ID is a context of an environment you can locate your environment id in the setting in the dashboard. Settings. -
- - INTEGRATION_IDENTIFIER optional, is a unique identifier of the integration. You can locate your integration identifier in the Integration Store. When not provided the last created integration will be used. - -If you are using the `Add to Slack` button you have to provide the `Shareable URL` as the `redirect_uri` parameter like in this example. Make sure that the `Shareable URL` is url encoded. - -```html -Add to Slack -``` - -### Manual Management - - - - -Create a new endpoint on your server that will handle the following steps (you can use Request Bin for an easy HTTPS service for redirects): - -1. Listen for redirect requests to your endpoint (REDIRECT_URL) after the user completes step 5 and grants permissions. Make sure to store the 'code' parameter from the request query as it will be needed later. -2. Send a POST request to with the following request body: - Use the "Client ID" and "Client Secret" from Slack's Developer Dashboard under "Basic Information". The request body should be in the format: { code: string, client_id: string, client_secret: string }. - Store the webhook URL from the response, which can be found under `response.data.incoming_webhook.url`. - (read more on Slack's documentation here) -3. When the `incoming_webhook.url` is obtained you need to save it on the relevant subscriber entity in Novu you can use the Node SDK: - - ```typescript - import { Novu, ChatProviderIdEnum } from '@novu/node'; - - const novu = new Novu(process.env.NOVU_API_KEY); - - const body = req.body; // From your HTTPS listener - await novu.subscribers.setCredentials('subscriberId', ChatProviderIdEnum., { - webhookUrl: body.incoming_webhook.url, - }); - ``` - - - subscriberId is a custom identifier used when identifying your users within the Novu platform. [Read more here](/platform/subscribers). - - providerId is a unique provider identifier. We recommend using our ChatProviderIdEnum.Slack if you're using Node, else string of `slack` to specify the provider. - - The third parameter is the credentials object. In this case we use the webhookUrl property to specify the webhook URL generated in the previous step. - - :::info - You need to set credentials for every subscriber because Slack generates a new Webhook URL on every new app install. - ::: - -4. Configure your Slack application as mentioned [below](/channels/chat/slack#slack-application-configuration). -5. Add the `Add to Slack` button or the shareable URL to your application in order to request permission of access (scope: incoming-webhook). -6. After the end-user finishes the authorization you will get the webhookUrl from the response of the OAuth under `body.incoming_webhook.url`, that you will use in step 3. -7. You are all set up and ready to send your first chat message via our @novu/node package or directly using the REST API. - - - - -## Slack Application Configuration - -1. Go to OAuth & Permissions on Slack's Developer Dashboard and add your REDIRECT_URL in Redirect URLs. - - If you use a manual Management solution, add the API endpoint you created on [step 1](/channels/chat/slack#manual-manage). - - If you use Novu Managed solution add https://api.novu.co/v1/subscribers/. -2. Go to Incoming Webhooks from the left menu and Activate Incoming Webhooks. -3. Go to Manage Distribution and at the bottom of the page, tick Remove Hard Coded Information and Activate Public Distribution. - -### Enabling HMAC Encryption - -In order to enable Hash-Based Message Authentication Codes, you need to do the following steps: - -1. Visit the integration store page and enable HMAC encryption under your chat provider. -2. Next step would be to generate an HMAC encrypted subscriberId on your backend: - - ```ts - import { createHmac } from 'crypto'; - - const hmacHash = createHmac('sha256', process.env.NOVU_API_KEY) - .update(subscriberId) - .digest('hex'); - ``` - -3. Add the newly created hash HMAC to the Sharable URL as a query. diff --git a/docs/docs/channels/email/_category_.json b/docs/docs/channels/email/_category_.json deleted file mode 100644 index 04d2fb62154..00000000000 --- a/docs/docs/channels/email/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Email", - "position": 1 -} diff --git a/docs/docs/channels/email/custom-smtp.md b/docs/docs/channels/email/custom-smtp.md deleted file mode 100644 index 97e3c5796dc..00000000000 --- a/docs/docs/channels/email/custom-smtp.md +++ /dev/null @@ -1,35 +0,0 @@ -# Custom SMTP - -You can use the Custom SMTP provider like [Nodemailer](https://nodemailer.com/about/) to send transactional emails through your custom SMTP server to your customers using the Novu Platform with a single API. - -## Getting Started - -To use the Custom SMTP provider in the email channel, you will need to have your personal SMTP server configured and add `host`, `port`, `user`, `password` to the Custom SMTP integration on the Novu platform. - -You can also provide value **`true`** for `secure` field if you want the connection to be secure, and if not, leave it empty. - -### DKIM (DomainKeys Identified Mail) - -DKIM options can be used in order to sign messages sent using Custom SMTP with DKIM keys. - -Those options are: - -- `DKIM Domain` -- `DKIM Private Key` -- `DKIM Key Selector` - -## Create a Custom SMTP integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Custom SMTP and click on the **Connect** button. -- Enter your SMTP credentials - - `host` - - `port` - - `username` - - `password` - - `secure` (on demand) - - And `DKIM` options if you want to sign messages with _DKIM_ -- Fill the `From email address` field using the authenticated email from the previous step. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Custom SMTP in Novu. diff --git a/docs/docs/channels/email/index.mdx b/docs/docs/channels/email/index.mdx deleted file mode 100644 index e79d6607496..00000000000 --- a/docs/docs/channels/email/index.mdx +++ /dev/null @@ -1,84 +0,0 @@ -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# Email - -Novu can be used to deliver email messages to your customers using a unified delivery API. You can easily integrate your favorite delivery provider using the built-in integration store. - -## Configuring email providers - -When creating an email provider integration you will be asked to provide additional fields alongside the provider-specific credentials: - -- **Sender name** - Will be displayed as the sender of the message -- **From email address** - Emails sent using Novu will be sent using this address - -For some email providers including SendGrid you will have to authenticate the **From email address** to make sure you will send email messages using an authorized address. - -## Sending Email Overrides - -The overrides field supports an email property that should have the interface of this: - -```ts -import { Novu } from '@novu/node'; - -const novu = new Novu(''); - -novu.trigger('event-name', { - to: { - subscriberId: '...', - }, - payload: { - attachments: [ - { - file: fs.readFileSync(__dirname + '/data/test.jpeg'), - name: 'test.jpeg', - mime: 'image/jpg', - }, - ], - }, - overrides: { - email: { - to: ['to@novu.co'], - from: 'from@novu.co', - senderName: 'Novu Team' - text: 'text version of email', - replyTo: 'no-reply@novu.co', - cc: ['1@novu.co'], - bcc: ['2@novu.co'], - }, - }, -}); -``` - -## Sending Email attachments - -You can easily send attachments with the Novu API by passing the attachments array when triggering an Email based workflow. - -In this article, we’ll go over the benefits of planning for your webinar and top actionable tips to get you moving forward with your webinar marketing strategy. - - - - -```ts -import { Novu } from '@novu/node'; - -const novu = new Novu(''); - -novu.trigger('event-name', { - to: { - subscriberId: '123', - }, - payload: { - attachments: [ - { - file: fs.readFileSync(__dirname + '/data/test.jpeg'), - name: 'test.jpeg', - mime: 'image/jpg', - }, - ], - }, -}); -``` - - - diff --git a/docs/docs/channels/email/infobip.md b/docs/docs/channels/email/infobip.md deleted file mode 100644 index 2360acb9040..00000000000 --- a/docs/docs/channels/email/infobip.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -sidebar_position: 13 ---- - -# Infobip - -You can use the [Infobip](https://www.infobip.com/developers/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Infobip provider in the email channel, you will need to create an Infobip account and add your API key and Base URL to the Infobip integration on the Novu platform. - -## Generate API Key - -To generate a new API key in Infobip, you can follow these steps: - -- [Sign up](https://www.infobip.com/signup) or [Log in](https://portal.infobip.com/login/) to your Infobip account. -- Navigate to the [Settings](https://portal.infobip.com/settings/accounts/api-keys) of your account and look for the API Keys section at the top of the settings page. - -## Create an Infobip integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Infobip** and click on the **Connect** button. -- Enter your Infobip API Key. -- Enter your Base URL. - - To see your base URL, log in to the account. Once logged in, on all pages you should see your base URL in this format: `xxxxx.api.infobip.com`. -- Fill the `From email address` field using the authenticated email from the previous step. -- Fill the `Sender name`. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Infobip in Novu. diff --git a/docs/docs/channels/email/mailersend.md b/docs/docs/channels/email/mailersend.md deleted file mode 100644 index bed609c532e..00000000000 --- a/docs/docs/channels/email/mailersend.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -sidebar_position: 8 ---- - -# MailerSend - -[MailerSend](https://www.mailersend.com/) is an email delivery service that allows you to send emails from your application. - -## Getting Started - -To use the MailerSend provider in the email channel, you will need to create a MailerSend account and add your API key to the MailerSend integration on the Novu platform. -To generate the API token go visit the [MailerSend API Tokens](https://www.mailersend.com/help/managing-api-tokens) page. - -## Create the MailerSend integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate MailerSend and click on the **Connect** button. -- Enter API key. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using MailerSend in Novu. diff --git a/docs/docs/channels/email/mailgun.md b/docs/docs/channels/email/mailgun.md deleted file mode 100644 index acc90cf10a1..00000000000 --- a/docs/docs/channels/email/mailgun.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -sidebar_position: 10 ---- - -# Mailgun - -You can use the [Mailgun](https://mailgun.com/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Mailgun provider in the email channel, you will need to create a Mailgun account and add your API key and domain name to the Mailgun integration on the Novu platform. - -## Generate API Key - -To generate a new API key in Mailgun, you can follow these steps: - -- [Sign up](https://signup.mailgun.com/new/signup) or [Log in](https://login.mailgun.com/login/) to your Mailgun account. -- Click on the **Profile** section in the top right corner of the screen, and then click "API Keys" from the drop-down menu. -- On the [API Keys](https://app.mailgun.com/app/account/security/api_keys) page, copy the generated **Private API Key** - -## Add new domain name - -Mailgun recommends that you add a subdomain as a domain name. To do so: - -- Visit the page to add a [domain name](https://app.mailgun.com/app/sending/domains/new). - - During this process, you will need to choose a region for the domain name which is between `US` and `EU`. The default is `US`. -- Follow the [instructions](https://documentation.mailgun.com/en/latest/user_manual.html#verifying-your-domain-1) to verify the domain name. - -## Create a Mailgun integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Mailgun and click on the **Connect** button. -- Enter your Mailgun API Key. -- Enter your Base URL. - - For domains created in the EU region, the base URL is: `https://api.eu.mailgun.net/` - - Otherwise, leave the base URL blank. -- Fill the `Username`. -- Fill the `Domain name` registered on Mailgun. -- Fill the `From email address` field using the authenticated email from the previous step. -- Fill the `Sender name`. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Mailgun in Novu. diff --git a/docs/docs/channels/email/mailjet.md b/docs/docs/channels/email/mailjet.md deleted file mode 100644 index d6298ec353c..00000000000 --- a/docs/docs/channels/email/mailjet.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -sidebar_position: 7 ---- - -# Mailjet - -You can use the [Mailjet](https://mailjet.com/) provider to send transactional emails to your customers using the Novu Platform with a single API. - -## Getting Started - -To use the Mailjet provider in the email channel, you will need to create a Mailjet account and add your API key to the Mailjet integration on the Novu platform. - -## Generate API Key - -To generate a new API key in Mailjet, you can follow these steps: - -- Log in to your Mailjet account. -- Click on the **Settings** in the top-right corner of the screen, and then click **API KEYS & TRACKING** from the drop-down menu. -- On the API Keys page, click the **Create an API Key** button. -- Give the API key a name and choose the access level **Write and Read** -- Click the **Generate Key** button to create the new key. Once generated you can see the key but it will be hidden after refresh - -## Authenticate your sender identity - -Before you can send emails on a large scale, you will need to authenticate your Sender identity. This is due to the latest regulatory changes regarding SPAM rules and email fraud. Most of the providers including Mailjet require you to authenticate your Sender identity before you can send emails. - -Mailjet allows you to authenticate your sender identity using one of the following methods: - -- [Single Sender Verification](https://dev.mailjet.com/email/guides/senders-and-domains/#sender-validation) - This is the easiest way to authenticate your sender identity. -- [Entire Domain Authentication](https://dev.mailjet.com/email/guides/senders-and-domains/#spf-and-dkim-validation) - This is recommended if you are sending emails from multiple accounts under your domain. - -## Create a Mailjet integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Mailjet and click on the **Connect** button. -- Enter your Mailjet API key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Mailjet in Novu. diff --git a/docs/docs/channels/email/mandrill.md b/docs/docs/channels/email/mandrill.md deleted file mode 100644 index 5ca3159dc47..00000000000 --- a/docs/docs/channels/email/mandrill.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -sidebar_position: 11 ---- - -# Mandrill - -You can use the [Mandrill by Mailchimp](https://mandrillapp.com/) provider to send transactional emails to your customers using the Novu Platform with a single API. - -## Getting Started - -To use the Mandrill provider in the email channel, you will need to create a Mandrill account and add your API key to the Mandrill integration on the Novu platform. - -## Generate API Key - -To generate a new API key in Mandrill, you can follow these steps: - -- [Sign up](https://login.mailchimp.com/signup/) or [Log in](https://login.mailchimp.com/) to your Mandrill account. -- Navigate to the [Settings](https://mandrillapp.com/settings) of your account and look for the API Keys section at the bottom of the settings page. -- Click on the **+ Add API Key** button to create an API key. Copy the generated key immediately and store it in a secure location. You won’t be able to see or copy the key once you finish generating it. - -# Add a sending domain - -To get started, you’ll need to add the domain that you want to send messages from. - -- Navigate to [Settings page](https://mandrillapp.com/settings/sending-domains) and choose Domains -- Type a new domain in the domain input and click Add -- Follow the instructions to [verify ownership](https://mailchimp.com/developer/transactional/docs/authentication-delivery/#authentication) of your sending domain and [update your DNS records](https://mailchimp.com/developer/transactional/docs/authentication-delivery/#configure-your-dns). - -## Create the Mandrill integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Mandrill and click on the **Connect** button. -- Enter your Mandrill API key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Fill the `Sender name`. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Mandrill in Novu. diff --git a/docs/docs/channels/email/netcore.md b/docs/docs/channels/email/netcore.md deleted file mode 100644 index 0c7eb88373f..00000000000 --- a/docs/docs/channels/email/netcore.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -sidebar_position: 12 ---- - -# Netcore - -You can use the [Netcore](https://netcorecloud.com/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Netcore provider in the email channel, you will need to create a Netcore account and add your API key to the Netcore integration on the Novu platform. - -## Generate API Key - -To generate a new API key in Netcore, you can follow these steps: - -- [Log in](https://email.netcorecloud.com/) to your Netcore account. -- Go to the **Integration** page under **Settings** menu and click on the **API** tab. -- The API Key is hidden for security purpose. Click Show. System will prompt you to enter your account password. Once you enter the password, the API key will be accessible. - -## Set up sending domains - -To start sending emails, you need to add and verify your sending domains. You can either use your top-level domain (e.g. my-company.com) or a sub-domain like email.my-company.com. The verification is done to ensure your sending domain’s security. - -Follow the instructions on this [page](https://emaildocs.netcorecloud.com/docs/what-is-a-sending-domain-how-to-set-up-sending-domains) to get started - -## Create a Netcore integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Netcore and click on the **Connect** button. -- Enter your Netcore API Key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Fill the `Sender name`. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Netcore in Novu. diff --git a/docs/docs/channels/email/outlook365.md b/docs/docs/channels/email/outlook365.md deleted file mode 100644 index bb9f04bee14..00000000000 --- a/docs/docs/channels/email/outlook365.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -sidebar_label: Outlook 365 -sidebar_position: 9 ---- - -# Outlook365 ( based in custom SMTP server) - -You can use the [Outlook 365](https://office.com) provider to send transactional emails through your instance of Office 365 to your customers using the Novu Platform with a single API. - -## Getting Started - -To use the Outlook 365 provider in the email channel, you will need to have the sender's email (user) and the password for the account. This account cannot be a shared mailbox or distribution list. It will need to be properly licensed to send email via Office 365. - -## Create the Outlook 365 integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Outlook 365 and click on the **Connect** button. -- Enter your SMTP credentials - - `from`: Complete email address of the sending user. (e.g. jdoe@mycompany.com) - - `senderName`: Sender Name should be the same email address of the sending user. (e.g. jdoe@mycompany.com) - - `password`: Password used to sign in with the email account. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Outlook 365 in Novu. diff --git a/docs/docs/channels/email/plunk.md b/docs/docs/channels/email/plunk.md deleted file mode 100644 index 4c2203fedaa..00000000000 --- a/docs/docs/channels/email/plunk.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -sidebar_position: 14 ---- - -# Plunk - -You can use the [Plunk](https://useplunk.com/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Plunk provider in the email channel, you will need to create a Plunk account and add your API key to the Plunk integration on the Novu platform. - -## Get API Key - -To generate a new API key in Plunk, you can follow these steps: - -- Log in to your Plunk account. -- Click on `Project Settings` on the side bar and then `API keys` on the tab. -- On the API Keys page, click on `Secret API key` to copy. - -## Authenticate your sender identity - -Before you can send emails on a large scale, you will need to authenticate your Sender Identity. Plunk allows you to authenticate your sender identity using [Domain Authentication](https://app.useplunk.com/settings/identity) - -## Create a Plunk integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Plunk and click on the **Connect** button. -- Enter your Plunk secret API Key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Plunk in Novu. diff --git a/docs/docs/channels/email/postmark.md b/docs/docs/channels/email/postmark.md deleted file mode 100644 index 00cbfc7e678..00000000000 --- a/docs/docs/channels/email/postmark.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -sidebar_position: 6 ---- - -# Postmark - -It is possible to use [Postmark](https://postmarkapp.com/) as a provider to send transactional emails to the customers using the Novu Platform with a single API. - -## Getting Started - -The first step to use the Postmark provider in the email channel is to create a Postmark account and add the personal API key to the Postmark integration on the Novu platform. - -## Find the API Key - -- To find the Postmark API key, log into the personal Postmark account and navigate to the servers page. -- After selecting the server to use, the API key (referred to as "Server API tokens") will be in the "API Tokens" section of server chosen. - -## Authenticate the sender identity - -Due to the latest regulatory changes regarding SPAM rules and email fraud it is needed to authenticate the sender's identity before sending emails on a large scale. -Most of the providers, including Postmark, require an authentication to unlock the possibility of sending emails. - -Postmark allows the authentication of the sender identity using one of the following methods: - -- [Single Sender Verification](https://account.postmarkapp.com/signatures/new) - This is the easiest way to authenticate the sender identity. -- [Entire Domain Authentication](https://postmarkapp.com/support/article/1046-how-do-i-verify-a-domain#:~:text=be%20verified%20automatically.-,Navigate%20to%20Sender%20Signatures.,to%20your%20DNS%2C%20choose%20Verify.) - This is recommended for sending emails from multiple accounts under the same domain. - -## Create a Postmark integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Postmark and click on the **Connect** button. -- Enter the Postmark API key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- Now is possible to send notifications using Postmark in Novu. diff --git a/docs/docs/channels/email/resend.md b/docs/docs/channels/email/resend.md deleted file mode 100644 index 3c45a390711..00000000000 --- a/docs/docs/channels/email/resend.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -sidebar_position: 4 ---- - -# Resend - -You can use the [Resend](https://resend.com/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Resend provider in the email channel, you will need to create a Resend account and add your API key to the Resend integration on the Novu platform. - -## Generate API Key - -To generate a new API key in Resend, you can follow these steps: - -- [Sign up](https://resend.com/secret) or [Log in](https://resend.com/login) to your Resend account. -- Click on the **API Keys** link in the left sidebar, and then click "Create API Key" button on the top right part of the page. -- On the [API Keys](https://resend.com/api-keys) page, click the **Create API Key** button. -- Give the API key a name and click on the **Add** button. -- Copy the generated API Key. - -## Authenticate your Sender Identity - -Before you can send emails on a large scale, you will need to authenticate your Sender Identity. - -Resend allows you to authenticate your sender identity using [Domain Authentication](https://resend.com/docs/dashboard/domains/introduction). - -## Create a Resend integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Resend and click on the **Connect** button. -- Enter your Resend API Key. -- If you have verified your domain in previous step, fill the `From email address` field with any domain email address. For example, if your organization domain name is `linear.app` then you can use any valid email address like `hello@linear.app`. - - For testing, you can use `onboarding@resend.dev` if you have not authenticated your sender identity. -- Fill the `Sender name`. - -:::info -Resend does not support sender name field separately. To show your preferred `Sender Name` in emails, enter `Team Linear ` in `From email address` field instead of `hello@linear.app`. Here **Team Linear** is `Sender Name`. -::: - -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Resend in Novu. diff --git a/docs/docs/channels/email/sendgrid.md b/docs/docs/channels/email/sendgrid.md deleted file mode 100644 index 02f7dabd43c..00000000000 --- a/docs/docs/channels/email/sendgrid.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -sidebar_position: 1 ---- - -# SendGrid - -You can use the [SendGrid](https://sendgrid.com/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Sendgrid provider in the email channel, you will need to create a Sendgrid account and add your API key to the SendGrid integration on the Novu platform. - -## Generate API Key - -To generate a new API key in SendGrid, you can follow these steps: - -- Log in to your SendGrid account. -- Click on the **Settings** gear icon in the top right corner of the screen, and then click "API Keys" from the drop-down menu. -- On the API Keys page, click the **Create API Key** button. -- Give the API key a name and select the following permissions - --**Mail Send** - Full Access - -- (Optional) Template Engine - Read Only - -- Click the **Create & View** button to generate the API key. The key will be displayed on the screen, but you will only be able to view it once, so make sure to save it in a safe place. - -:::note -The access level of key will determine what actions the API Key can take, so please choose the correct one. -::: - -- **Mail Send** - Full Access -- (Optional) Template Engine - Read Only - -## Authenticate your [Sender Identity](https://docs.sendgrid.com/for-developers/sending-email/sender-identity) - -Before you can send emails on a large scale, you will need to authenticate your Sender Identity. This is due to the latest regulatory changes regarding SPAM rules and email fraud. Most of the providers including Sendgrid require you to authenticate your Sender Identity before you can send emails. - -SendGrid allows you to authenticate your sender identity using one of the following methods: - -- [Single Sender Verification](https://docs.sendgrid.com/ui/sending-email/sender-verification) - This is the easiest way to authenticate your sender identity. -- [Entire Domain Authentication](https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-domain-authentication) - This is recommended if you are sending emails from multiple accounts under your domain. - -## Create a SendGrid integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate SendGrid and click on the **Connect** button. -- Enter your SendGrid API Key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using SendGrid in Novu. diff --git a/docs/docs/channels/email/sendinblue.md b/docs/docs/channels/email/sendinblue.md deleted file mode 100644 index 6ef05dbcfca..00000000000 --- a/docs/docs/channels/email/sendinblue.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -sidebar_position: 3 ---- - -# Sendinblue - -You can use the [Sendinblue](https://www.sendinblue.com/) provider to send transactional emails to your customers using the Novu Platform with a single API. - -## Getting Started - -To use the Sendinblue provider in the email channel, you will need to create a Sendinblue account and add your API key to the Sendinblue integration on the Novu platform. - -## Find the API Key - -- To find your Sendinblue API key, log into your Sendinblue account and navigate to the [API Keys](https://account.sendinblue.com/advanced/api) page. - -## Authenticate your sender identity - -Before you can send emails on a large scale, you will need to authenticate your sender's identity. This is due to the latest regulatory changes regarding SPAM rules and email fraud. Most of the providers including Sendinblue require you to authenticate your sender identity before you can send emails. - -Sendinblue allows you to authenticate your sender identity using one of the following methods: - -- [Single Sender Verification](https://account.sendinblue.com/senders) - This is the easiest way to authenticate your sender identity. -- [Entire Domain Authentication](https://help.sendinblue.com/hc/en-us/articles/115000185270-What-is-a-verified-domain-on-Sendinblue-) - This is recommended if you are sending emails from multiple accounts under your domain. - -## Create a Sendinblue integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Sendinblue and click on the **Connect** button. -- Enter your Sendinblue API key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Sendinblue in Novu. diff --git a/docs/docs/channels/email/ses.md b/docs/docs/channels/email/ses.md deleted file mode 100644 index 8ce29ae77f3..00000000000 --- a/docs/docs/channels/email/ses.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -sidebar_position: 2 ---- - -import FAQ from '@site/src/components/FAQ'; -import FAQItem from '@site/src/components/FAQItem'; - -# Amazon SES - -You can use the [Amazon SES](https://aws.amazon.com/ses/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Amazon SES provider in the email channel, you will need to create a SES account and add your credentials to the Amazon SES integration on the Novu platform. - -## How to set up SES in AWS? - -- Either use root aws account or create a new IAM account with appropriate permission policies. -- Create new access key and save generated `ACCESS_KEY_ID` and `ACCESS_SECRET_KEY` carefully -- Choose Amazon Simple Email Service. -- Create new identity. -- Either choose domain or email. -- Verify your domain (by adding few DNS records as mentioned in SES instructions) or email (AWS sends a verification email to your email). -- Verify recipient email also by creating new email identity type [only in sandbox mode]. -- Test if your SES is setup correctly using test email feature. - -## Create a SES integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate Amazon SES and click on the **Connect** button. -- Enter previously saved `ACCESS_KEY_ID` and `ACCESS_SECRET_KEY`. -- Fill the `From email address` field using the authenticated sender email id in previous step. -- Enter `region` and `Sender name` also. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using Amazon SES in Novu. - -## FAQ - - - - -Possible reasons: - -- You have not verified subscriber's email address in SES (if you are in sandbox environment). -- Your daily sending limit has reached (if you are in sandbox environment). -- You have entered wrong aws region in integration form. - - - diff --git a/docs/docs/channels/email/sparkpost.md b/docs/docs/channels/email/sparkpost.md deleted file mode 100644 index 43ea7b6335a..00000000000 --- a/docs/docs/channels/email/sparkpost.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -sidebar_position: 5 ---- - -# SparkPost - -You can use the [SparkPost](https://messagebird.com/email/cloud-sending) provider to send transactional emails to your customers using the Novu Platform with a single API. - -## Getting Started - -To use the SparkPost provider in the email channel, you will need to create a SparkPost account and add your API key to the SparkPost integration on the Novu platform. - -## Generate API Key - -To generate a new API key in SparkPost, you can follow these steps: - -- [Sign up](https://app.sparkpost.com/join) or [Log in](https://app.sparkpost.com/auth) to your SparkPost account. - - > During sign up, note that SparkPost is available in multiple regions. "SparkPost" refers to the SparkPost service hosted in North America. "SparkPost EU" refers to the SparkPost service hosted in Western Europe. An account created with SparkPost cannot be used with SparkPost EU, and vice-versa. You may use accounts in both regions.
~ [_SparkPost Documentation_](https://support.sparkpost.com/docs/getting-started/getting-started-sparkpost/) - -- Click on the **Configuration** link on the navbar, and then click "API Keys" link that pops up from the available options. -- On the [API Keys](https://app.sparkpost.com/account/api-keys) page, click the **Create API Key** button. -- Give the API key a name and click on the **Create API key** button. -- Copy the generated API Key. - -## Authenticate your Sender Identity - -Before you can send emails on a large scale, you will need to authenticate your Sender Identity. - -SparkPost allows you to authenticate your sender identity using [Sending Domains](https://app.sparkpost.com/domains/list/sending). - -## Create a SparkPost integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate SparkPost and click on the **Connect** button. -- Enter your SparkPost API Key. -- Fill the `From email address` field using the authenticated email from the previous step. -- Fill the `Sender name`. -- Toggle the `eu` switch to true if you're in Western Europe -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. -- You should now be able to send notifications using SparkPost in Novu. diff --git a/docs/docs/channels/notification-center.md b/docs/docs/channels/notification-center.md deleted file mode 100644 index 8b275819261..00000000000 --- a/docs/docs/channels/notification-center.md +++ /dev/null @@ -1,7 +0,0 @@ -# Notification Center - -:::info - -This document is still under construction - -::: diff --git a/docs/docs/channels/push/_category_.json b/docs/docs/channels/push/_category_.json deleted file mode 100644 index 2cf573d8623..00000000000 --- a/docs/docs/channels/push/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Push Notifications", - "position": 3 -} diff --git a/docs/docs/channels/push/apns.md b/docs/docs/channels/push/apns.md deleted file mode 100644 index cf845aadd5f..00000000000 --- a/docs/docs/channels/push/apns.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -sidebar_label: APNS -sidebar_position: 3 ---- - -# Apple Push Notification Service - -[Apple Push Notification Service](https://docs.expo.dev/push-notifications/overview/) is a notification delivery service provided by Apple. - -Apple provides two authentication methods to make a secure connection to APNs. The first is Certificate-Based Authentication (using a .p12 certificate). The second is Token-Based Authentication (using a .p8 key). We'll make use of the **.p8** key. - -To enable APNS integration, you need to create an [Apple Developer](https://developer.apple.com) account with [Admin role](https://appstoreconnect.apple.com/access/users). - -To generate the p8 key for your account: -
- -1. Head over to **Certificates, Identifiers & Profiles > Keys**. -2. Register a new key and give it a name. -3. Enable the Apple Push Notifications service (APNs) checkbox by selecting it. -4. Click the **Continue** button and on the next page, select **Register**. -5. Download the **.p8** key file. - -You also need the following to connect to APNs: - -1. **Key ID** - This is a 10 character unique identifier for the authentication key. You can find it in the key details section of the newly created key in your Apple developer account. -2. **Team ID** - This is available in your Apple developer account. -3. **Bundle ID** - This is the ID of your app. You can find it in the app info section of your Apple developer account. - -The overrides field supports all [Notification payload](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification?language=objc) values, example below: - - - - -```ts -import { Novu } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -novu.trigger('event-name', { - to: { - subscriberId: '...', - }, - payload: { - abc: 'def', // If the notification is a data notification, the payload will be sent as the data - }, - overrides: { - apns: { - payload: { - aps: { - notification: { - title: 'Test', - body: 'Test push', - }, - data: { - key: 'value', - }, - }, - }, - }, - }, -}); -``` - -```ts -import { Novu } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -novu.trigger('event-name', { - to: { - subscriberId: '...', - }, - payload: { - key1: 'val1', - key2: 'val2', // If the notification is a data notification, the payload will be sent as the data - }, - overrides: { - type: 'data', - apns: { - headers: { - 'apns-priority': '5', - }, - payload: { - aps: { - alert: { - 'loc-key': 'GAME_PLAY_REQUEST_FORMAT', - 'loc-args': ['Shelly', 'Rick'], - }, - sound: 'demo.wav', - }, - }, - }, - }, -}); -``` - - - - -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: - -```typescript -import { Novu, PushProviderIdEnum } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.APNS, { - deviceTokens: ['token1', 'token2'], -}); -``` diff --git a/docs/docs/channels/push/expo.md b/docs/docs/channels/push/expo.md deleted file mode 100644 index aeb3f95fd2a..00000000000 --- a/docs/docs/channels/push/expo.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -sidebar_label: Expo Push -sidebar_position: 2 ---- - -# Expo Push - -[Expo Push](https://docs.expo.dev/push-notifications/overview/) is a notification delivery service provided by Expo. - -To enable Expo Push integration, you need to create an [Expo Application Services (EAS)](https://expo.dev) account and generate an access token in the EAS dashboard. - -The overrides field supports all [Message Request](https://docs.expo.dev/push-notifications/sending-notifications/#message-request-format) values, example below: - - - - -```ts -import { Novu } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -novu.trigger('event-name', { - to: { - subscriberId: '...', - }, - payload: { - abc: 'def', - }, -}); -``` - - - - -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: - -```typescript -import { Novu, PushProviderIdEnum } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -const body = req.body; // From your HTTPS listener -await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.EXPO, { - deviceTokens: ['token1', 'token2'], -}); -``` diff --git a/docs/docs/channels/push/fcm.md b/docs/docs/channels/push/fcm.md deleted file mode 100644 index fb8968a0648..00000000000 --- a/docs/docs/channels/push/fcm.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -sidebar_label: FCM -sidebar_position: 1 ---- - -# Firebase Cloud Messaging - -[Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) is a free notification delivery service provided by Google Firebase. - -To enable the FCM integration, you need to get your service account key from the [Firebase Console](https://console.firebase.google.com). - -## Generate Service Account Key JSON - -To acquire the account key JSON file for your service account - -1. Select your project, click the gear icon on the top of the sidebar. -2. Head to the service account tab. -3. Click **Generate New Private Key,** then confirm by clicking **Generate Key.** -4. Clicking **Generate Key** downloads the JSON file. - -After that, paste the entire JSON file content in the Service Account field of FCM provider in integration store. - -Make sure your service account json content contains these fields - -```ts -{ - "type": "service_account", - "project_id": "PROJECT_ID", - "private_key_id": "PRIVATE_KEY_ID", - "private_key": "PRIVATE_KEY", - "client_email": "FIREBASE_ADMIN_SDK_EMAIL", - "client_id": "CLIENT_ID", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "CLIENT_X509_CERT_URL" -} -``` - -## FCM Overrides - -The overrides field supports apns, android, webpush and fcmOptions overrides - -| Override Field | Type / Interface | Link | -| -------------- | ---------------- | ---------------------------------------------------------------------------------------------- | -| android | AndroidConfig | | -| apns | ApnsConfig | | -| webPush | WebpushConfig | | -| fcmOptions | FcmOptions | | - -## Set 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: - -```ts -import { Novu, PushProviderIdEnum } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.FCM, { - deviceTokens: ['token1', 'token2'], -}); -``` - -## SDK Trigger Example - -```ts -import { Novu } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -novu.trigger('event-name', { - to: { - subscriberId: '...', - }, - payload: { - abc: 'def', // If the notification is a data notification, the payload will be sent as the data - }, - overrides: { - fcm: { - - // type: 'data' => will turn this into a FCM data notification, where the payload is sent as a data notification. If type is not set, you can use the "data" override to send notification messages with optional data payload - type: 'data', - - // URL of an image to be displayed in the notification. - imageUrl: "https://domain.com/image.png" - - // If type is not set, you can use the "data" override to send notification messages with optional data payload - data: { - key: 'value', - }, - - // Check FCM Overrides section above for these types - android: {}, - apns: {}, - webPush: {}, - fcmOptions: {} - }, - }, -}); -``` - -Device/notification identifiers can be set by using [setCredentials](#set-device-token) or by using the `deviceIdentifiers` field in overrides. - -:::info - -Novu uses FCM version V1 - -::: diff --git a/docs/docs/channels/push/index.md b/docs/docs/channels/push/index.md deleted file mode 100644 index 17471a032bb..00000000000 --- a/docs/docs/channels/push/index.md +++ /dev/null @@ -1,18 +0,0 @@ -# Push Notifications - -Novu can be used to deliver push notifications to your customers devices using a unified delivery API. Both Mobile and Web push notifications are supported. - -You can save a user's notification/device identifiers using [Subscriber Credentials](/platform/subscribers#updating-subscriber-credentials). - -You can easily integrate your favorite delivery provider using the built-in [integration store](https://web.novu.co/integrations). - -To read a provider specific documentation: - -- [Firebase Cloud Messages](/channels/push/fcm) -- [Expo Push](/channels/push/expo) -- [Apple Push Notification Service](/channels/push/apns) -- [OneSignal](/channels/push/one-signal) - -:::info -Novu supports multiple active providers for push channel. -::: diff --git a/docs/docs/channels/push/one-signal.md b/docs/docs/channels/push/one-signal.md deleted file mode 100644 index 6d1ad29f728..00000000000 --- a/docs/docs/channels/push/one-signal.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -sidebar_label: One Signal -sidebar_position: 4 ---- - -# One Signal - -[OneSignal](https://onesignal.com/) is a paid push notification service that supports sending messages via both [Apple Push Notification Service](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server) (APNs) as well as [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging) (FCM). - -To configure the OneSignal integration, you will need an active account which has credentials for APNs, FCM or both, and have access to the `OneSignal App ID` and `Rest API Key` available via your [application's settings page](https://documentation.onesignal.com/docs/keys-and-ids). - -## Set Device Token - -Once OneSignal has been configured with your credentials for APNs/FCM, and the OneSignal SDK has been [setup and configured](https://documentation.onesignal.com/docs/onboarding-with-onesignal#step-1-setup-onesignal-sdk) for your application, your users will begin to be automatically assigned a unique OneSignal [player_id](https://documentation.onesignal.com/docs/users#player-id) identifier by the SDK. - -This identifier allows targeting your user when sending push notifications without having to retrieve the specific Android or iOS device tokens - which are managed by OneSignal. - -In order to target the OneSignal user from Novu, you must register the OneSignal `player_id` as the `deviceToken` for your Novu subscriber. This value can be retrieved via the [OneSignal SDK](https://documentation.onesignal.com/docs/users-and-devices#finding-users) for your platform. - -Once you have the user's `player_id` value, the `deviceToken` for your Novu subscriber can be set via: - -```ts -import { Novu, PushProviderIdEnum } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.OneSignal, { - // Your user's unique 'player_id' from OneSignal - deviceTokens: ['ad0452ca-3ca7-43b5-bf9b-fa93fd322035'], -}); -``` - -## SDK Trigger Example - -```ts -import { Novu } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -novu.trigger('event-name', { - to: { - subscriberId: '...', - }, - payload: { - abc: 'def', // If the notification is a data notification, the payload will be sent as the data - }, -}); -``` - -Device/notification identifiers can be set by using [setCredentials](#set-device-token) or by using the `deviceIdentifiers` field in overrides. diff --git a/docs/docs/channels/push/webhook.md b/docs/docs/channels/push/webhook.md deleted file mode 100644 index 559937248ab..00000000000 --- a/docs/docs/channels/push/webhook.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -sidebar_label: Push Webhook -sidebar_position: 5 ---- - -# Push Webhook - -Push Webhook provider is a bit different different from other push providers as it does not depend on other third party services. -Users can use their own api url as webhook url and novu will make a post request on that webhook url. - -## Steps To Configure - -1. Go to [integration store](https://web.novu.co/integrations) and click on `Add a provider` button. Choose `Push` channel and then `Push Webhook` provider. -2. Enter your Webhook URL. For quick testing use [this](https://webhook.site/) website. -3. Enter Secret Hmac Key. Novu will use this secret hmac key to encrypt the data using `HMAC SHA256` algorithm and send the hash as value of `x-novu-signature` header. User can use `x-novu-signature` header to test authenticity of the request. Read more [here](#checking-authenticity) -4. Click on the update button. -5. Update the subscriber credentials. Read more [here](#set-device-token) - -:::info -Your webhook url should accept `POST` request. -::: - -## Set Device Token - -This step is a mandatory step. Other push providers have third party dependencies where a device token can be generated. But in case of push webhook provider, there is no any way to generate device token. Any random string can be used as device token. - -```typescript -import { Novu, PushProviderIdEnum } from '@novu/node'; - -const novu = new Novu(process.env.NOVU_API_KEY); - -// PushProviderIdEnum.PushWebhook = push-webhook -await novu.subscribers.setCredentials('subscriberId', PushProviderIdEnum.PushWebhook, { - deviceTokens: ['ANY_RANDOM_STRING'], -}); -``` - -## Checking Authenticity - -```typescript -import crypto from "crypto" - -// secret key added in step 3 -const secretKey = "YOUR_HMAC_SECRET_KEY" - -// function to handle webhook url route request -async acceptNovuPushWebHookRequest(request, response){ - - const payloadSentByNovu = request.body - const hmacHashSentByNovu = request.headers['x-novu-signature'] - - const actualHashValue = crypto - .createHmac('sha256', secretKey) - .update(payloadSentByNovu, 'utf-8') - .digest('hex'); - - if(hmacHashSentByNovu === actualHashValue){ - // handle the notification - console.log("Request sent by Novu") - } else { - throw new Error("Not a valid request") - } -} -``` diff --git a/docs/docs/channels/sms/SMS77.md b/docs/docs/channels/sms/SMS77.md deleted file mode 100644 index 2e8968a9153..00000000000 --- a/docs/docs/channels/sms/SMS77.md +++ /dev/null @@ -1,19 +0,0 @@ -# SMS77 - -It is possible to use the [SMS77](https://www.sms77.io/en) provider to send SMS messages to the customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the SMS77 provider in the SMS channel, the first step is to create a SMS77 account and add the personal API key to the SMS77 integration on the Novu platform. - -## Find the API key - -To find the SMS77 API key, log into the personal SMS77 account and navigate to the API Keys page by clicking on the 'Developer' tab present at the end of the sidebar. It is suggested to create a new API key for use with Novu. Copy the newly created API key. - -## Create a AWS SNS integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **SMS77** under SMS section and click on the **Connect** button. -- Enter the `API key`. -- Click on the **Save** button. -- Now it is possible to send SMS notifications using **SMS77** in Novu. diff --git a/docs/docs/channels/sms/_category_.json b/docs/docs/channels/sms/_category_.json deleted file mode 100644 index 00cb7e7eafd..00000000000 --- a/docs/docs/channels/sms/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "SMS", - "position": 5 -} diff --git a/docs/docs/channels/sms/africas-talking.md b/docs/docs/channels/sms/africas-talking.md deleted file mode 100644 index d5e56382cc6..00000000000 --- a/docs/docs/channels/sms/africas-talking.md +++ /dev/null @@ -1,104 +0,0 @@ -# Africa's Talking - -You can use [Africa's Talking](https://africastalking.com/) provider to send SMS messages to your customers using the Novu platform with a single API to create multi-channel experiences. - -## Getting Started - -To use Africa's Talking provider in the SMS channel, the first step is to create an Africa's Talking account and add your `API Key`, `username` and `Sender's ID` to Africa's Talking integration on the Novu platform. - -## Create a username - -You’ll need to create an application to create a username in Africa’s Talking. To do so, follow the steps below: - -- [Sign up](https://account.africastalking.com/auth/register) or [Log in](https://account.africastalking.com/auth/login) to your Africa's Talking account. - -- Select the team you want your app to be in. - -![Image showing Africa’s talking dashboard and a red arrow pointing to a team with text that says “Click Here”](/img/providers/sms/africas-talking/create-a-username-1.png) - -If you're a new user and don't have a team yet, you'll have to do so by clicking on `New Team` and entering your team name. Click on `Save` when you're done. - -![Image showing the modal to add a new team on Africa’s Talking dashboard](/img/providers/sms/africas-talking/create-a-username-1-1.png) - -- On the page that appears, click on the `Create App` button. - -![Image showing the modal to add a new team on Africa’s Talking dashboard](/img/providers/sms/africas-talking/create-an-app-button.png) - -- On the pop up that appears, enter your application name, username and select a country. Then click Save. - -The `username` is what you will use on the Novu platform. - -![Image showing the modal to add a new team on Africa’s Talking dashboard](/img/providers/sms/africas-talking/create-an-app.png) - -## Generate API key - -To generate a new API key, you can follow these steps: - -:::note -Ensure you have created an app in your team. -::: - -- Click on the app you created. - -![Image show Africa’s Talking dashboard with a red arrow pointing to an app name](/img/providers/sms/africas-talking/click-app.png) - -- On the page that appears, click on `Settings`(on the menu on your left). This will display a dropdown. Click on `API Key` from the dropdown options. - -![Image displaying the Settings menu and the API Key page](/img/providers/sms/africas-talking/settings-menu.png) - -- On the page that appears, enter your password and click Generate. - -![Image showing page to generate API key on Africa’s Talking platform](/img/providers/sms/africas-talking/generate-api-key.png) - -- Copy the API Key generated and paste it into the Novu platform or record it somewhere safe for later use because you will not see it from the dashboard on subsequent visits. - -:::note -Once you've generated your API Key, wait about 3 minutes before testing it. -::: - -## Get your Sender's ID - -Sender IDs allow you to brand your messages as you send them to your customers. There are two kinds of sender IDs, **short codes** and **alphanumerics**. The difference is that you can send and receive messages with short codes but only send messages with alphanumerics. - -To create a Short Code: - -- On your app dashboard, click on SMS (on the menu on your left). This will display a dropdown. Click on `Shortcodes` from the dropdown options. This will also display a dropdown from which you can then click on `My Shortcodes` to view your codes. - -![Image showing Africa’s Talking dashboard page where you can create Shortcodes for sending SMS](/img/providers/sms/africas-talking/short-codes.png) - -If you have not created one yet, on the `Shortcodes` dropdown option, click on `Request`. - -On the page that appears, fill in the form and submit - -![Image showing the dashboard page that allows you to request for Shortcodes on Africa’s Talking](/img/providers/sms/africas-talking/request-short-codes.png) - -To create an Alphanumeric: - -- On your app dashboard, click on SMS (on the menu on your left). This will display a dropdown. Click on `Alphanumerics` from the dropdown options. This will also display a dropdown from which you can then click on `My Alphanumerics` to view your codes. - -![Image showing Africa’s Talking dashboard page where you create an alphanumeric for sending SMS](/img/providers/sms/africas-talking/alphanumeric.png) - -If you have not created one yet, on the `Alphanumerics` dropdown option, click on `Request`. - -On the page that appears, fill in the form and submit - -![Image showing the dashboard page that allows you to request for an alphanumeric on Africa’s Talking](/img/providers/sms/africas-talking/request-alphanumeric.png) - -Once you're done, add either your short code or alphanumeric to the `from` field on the Novu platform. - -## Create an Africa's Talking integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Africa's Talking** under the SMS section and click on the **Connect** button. - -![Image showing Novu web platform integration store page](/img/providers/sms/africas-talking/integration.png) - -- Enter the `API key`. -- Fill in the `username` field. -- Fill in the `from` field. This is your registered `short code` or `alphanumeric` value. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. - -![Africa’s Talking integration modal on Novu’s web integration page](/img/providers/sms/africas-talking/web.png) - -Now it is possible to send SMS notifications using **Africa's Talking** in Novu. diff --git a/docs/docs/channels/sms/index.md b/docs/docs/channels/sms/index.md deleted file mode 100644 index b1e9e133f0b..00000000000 --- a/docs/docs/channels/sms/index.md +++ /dev/null @@ -1,16 +0,0 @@ -# SMS - -Novu can be used to send SMS to your customers using a unified delivery API. You can easily integrate your favorite delivery provider using the built-in integration store. - -To read a provider specific documentation: - -- [Twilio](/channels/sms/twilio) -- [SMS77](/channels/sms/SMS77) -- [Africa's Talking](/channels/sms/africas-talking) -- [Infobip](/channels/sms/infobip) -- [Nexmo](/channels/sms/nexmo) -- [Plivo](/channels/sms/plivo) -- [Sendchamp](/channels/sms/sendchamp) -- [AWS SNS](/channels/sms/sns) -- [Telnyx](/channels/sms/telnyx) -- [Termii](/channels/sms/termii) diff --git a/docs/docs/channels/sms/infobip.md b/docs/docs/channels/sms/infobip.md deleted file mode 100644 index 166769517be..00000000000 --- a/docs/docs/channels/sms/infobip.md +++ /dev/null @@ -1,54 +0,0 @@ -# Infobip - -You can use the [Infobip](https://www.infobip.com/developers/) provider to send SMS messages to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Infobip provider in the SMS channel, you will need to create an Infobip account and add your API key and Base URL to the Infobip integration on the Novu platform. - -## Retrieve your API Key - -To Find a new API key in Infobip, you can follow these steps: - -- [Sign up](https://www.infobip.com/signup) or [Log in](https://portal.infobip.com/login/) to your Infobip account. -- On the [Homepage](https://portal.infobip.com/homepage/), you'll see your API key. - -![Image displaying the API Key on the homepage](/img/providers/sms/infobip/api-key.png) - -Alternatively, you can find the API key on the Developer Tools page. - -- On the sidebar (on the left), click on `Developer Tools`. -- This will display a dropdown from which you can then click on `API Ksys` to view your API key. - -![Image displaying the API Key on the Developer Tools page](/img/providers/sms/infobip/dev-tools-api-key.png) - -If you want to create an API key: - -- Click on the `CREATE API KEY` button -- Fill the form -- Click on `GENERATE` - -![Image displaying the form to generate an API Key on the Developer Tools page](/img/providers/sms/infobip/generate-api-key.png) - -## Find Base URL - -To see your base URL, log in to the account. Once logged in, on the Homepage, you should see your base URL in this format: `xxxxx.api.infobip.com`. - -![Image displaying the API Key on the settings page](/img/providers/sms/infobip/base-url.png) - -## Create an Infobip integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Infobip** under the SMS section and click on the **Connect** button. - -![Image showing Novu web platform integration store page](/img/providers/sms/infobip/integration.png) - -- Enter your Infobip API Key. -- Enter your Base URL. -- Fill the `From` field. -- Click on the `Disabled` button and mark as `Active`. -- Click on the **Connect** button. - -![Infobip integration modal form on Novu’s web integration page](/img/providers/sms/infobip/web.png) - -You should now be able to send SMS notifications using **Infobip** in Novu. diff --git a/docs/docs/channels/sms/nexmo.md b/docs/docs/channels/sms/nexmo.md deleted file mode 100644 index b1bf1940f9f..00000000000 --- a/docs/docs/channels/sms/nexmo.md +++ /dev/null @@ -1,20 +0,0 @@ -# Nexmo - -You can use the [Nexmo By Vonage](https://www.vonage.com/) provider to send SMS messages to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Nexmo provider in the SMS channel, the first step is to create a Nexmo account and add the API key and API Secret to the Nexmo integration on the Novu platform. - -## Find the API key and secret - -First, [sign up for a Vonage account](https://ui.idp.vonage.com/ui/auth/login) if you don't already have one, and make a note of your API key and secret on the [dashboard getting started page](https://dashboard.nexmo.com/getting-started-guide). - -## Create a Nexmo integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Nexmo** under SMS section and click on the **Connect** button. -- Enter the `API key` and `API Secret`. -- Enter a valid `From` email address. -- Click on the **Connect** button. -- Now it is possible to send SMS notifications using **Nexmo** in Novu. diff --git a/docs/docs/channels/sms/plivo.md b/docs/docs/channels/sms/plivo.md deleted file mode 100644 index 7719b3f69fa..00000000000 --- a/docs/docs/channels/sms/plivo.md +++ /dev/null @@ -1,27 +0,0 @@ -# Plivo - -You can use the [Plivo](https://www.plivo.com/) provider to send SMS messages to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Plivo provider in the SMS channel, the first step is to create a Plivo account and add the Account SID and Auth token to the Plivo integration on the Novu platform. - -## Find the Account SID and Auth token - -[Sign up](https://console.plivo.com/accounts/register/) or [Login](https://console.plivo.com/accounts/login/) to your Plivo account, and make a note of your Account SID and Auth token on the [Plivo console page](https://console.plivo.com/dashboard/). - -## Create a Plivo integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Plivo** under SMS section and click on the **Connect** button. - -![Image showing Novu web platform integration store page](/img/providers/sms/plivo/integration.png) - -- Enter the `Account SID`. -- Enter the `Auth token`. -- Fill the `From` field. -- Click on the **Connect** button. - -![Plivo integration modal on Novu’s web integration page](/img/providers/sms/plivo/web.png) - -Now it is possible to send SMS notifications using **Plivo** in Novu. diff --git a/docs/docs/channels/sms/sendchamp.md b/docs/docs/channels/sms/sendchamp.md deleted file mode 100644 index 1f959a7bd30..00000000000 --- a/docs/docs/channels/sms/sendchamp.md +++ /dev/null @@ -1,63 +0,0 @@ -# Sendchamp - -You can use the [Sendchamp](https://www.sendchamp.com/) provider to send SMS messages to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use Sendchamp provider in the SMS channel, the first step is to create a Sendchamp account and add your API key and Sender ID to the Sendchamp integration on the Novu platform. - -## Retrieve your API Key - -To find your Sendchamp API key: - -- [Sign up](https://my.sendchamp.com/signup) or [Login](https://my.sendchamp.com/login) to your Sendchamp account. -- Click on the Avatar icon in the top right corner of the screen, and then click `API & Integrations` from the drop-down menu. - -![Image displaying how to access the API Key from the Avatar Icon dropdown](/img/providers/sms/sendchamp/avatar-api-key.png) - -Alternatively, you can access the API key from the Accounts menu. - -- Scroll to the bottom of the sidebar (on the left) and click on `Accounts`. -- This will display a dropdown from which you can then click on `API keys & Webhooks` to view your API key. - -![Image displaying how to access the API Key from the Accounts menu dropdown](/img/providers/sms/sendchamp/accounts-menu-api-key.png) - -- On the API Keys page, copy the `Public access key`. - -![Image displaying the access the API Key on the API Keys page](/img/providers/sms/sendchamp/api-key.png) - -## Get your Sender's ID - -The Sender ID represents the sender of the message to your customers. - -To get your Sender's ID: - -- On the sidebar (on the menu on your left), click on `SMS`. This will display a dropdown. Click on `Sender ID` from the dropdown options. -- On the page that appears, you'll find a list of your Sender IDs - -![Image showing SMS page where you can view the list of your Sender IDs](/img/providers/sms/sendchamp/sender-id.png) - -If you have not created one yet: - -- Click on the `Create sender ID` button to request for a Sender ID. -- Fill in the form. -- Click on `Add sender ID` button. - -![Image showing the form that allows you to request for Sender ID on Sendchamp](/img/providers/sms/sendchamp/sender-id-request-form.png) - -Once it is approved, you can use your Sender ID as the `from` field on the Novu platform. - -## Create a Sendchamp integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Sendchamp** under SMS section and click on the **Connect** button. - -![Image showing Novu web platform integration store page](/img/providers/sms/sendchamp/web.png) - -- Enter your Sendchamp API Key. -- Fill the `From` field. -- Click on the **Connect** button. - -![Sendchamp integration modal on Novu’s web integration page](/img/providers/sms/sendchamp/integration.png) - -Now it is possible to send SMS notifications using **Sendchamp** in Novu. diff --git a/docs/docs/channels/sms/sns.md b/docs/docs/channels/sms/sns.md deleted file mode 100644 index 8a6f5bca0db..00000000000 --- a/docs/docs/channels/sms/sns.md +++ /dev/null @@ -1,25 +0,0 @@ -# AWS SNS - -You can use the [AWS SNS](https://aws.amazon.com/sns/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To integrate AWS SNS on the Novu platform, you will need to have in AWS, an IAM user who has the `sns:Publish` permission. - -## Create User - -To create a user, login to AWS Console and follow these steps: - -- Go to `IAM` service page. -- Create a new user with `sns:Publish` permission, or add `sns:Publish` permission to an existing user. -- Add `Access Key` credential to the user and copy `Access key ID` and `Secret access key`. - -For security reasons, it is suggested that you create a new User to use with Novu. - -## Create an AWS SNS integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Amazon SNS** and click on the **Connect** button. -- Enter your `Access key ID`, `Secret access key`, and `AWS region`. -- Click on the **Save** button. -- You should now be able to send SMS notifications using **Amazon SNS** in Novu. diff --git a/docs/docs/channels/sms/telnyx.md b/docs/docs/channels/sms/telnyx.md deleted file mode 100644 index 6f7fb24edb9..00000000000 --- a/docs/docs/channels/sms/telnyx.md +++ /dev/null @@ -1,42 +0,0 @@ -# Telnyx - -You can use the [Telnyx](https://telnyx.com/) provider to send transactional emails to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use the Telnyx provider in the SMS channel, you will need to create a Telnyx account and add your API key to the Telnyx integration on the Novu platform. - -## Find the API Key - -To find your Telnyx API key: - -- Log into your Telnyx account. -- Navigate to Account Setting. -- Then go to [Keys & Credentials](https://portal.telnyx.com/#/app/api-keys). -- You can copy API key from there. -- Alternatively, you can create an API key by tapping on the Create API Key button. - -Before copying it, make sure its status is showing active. - -## Find the Message profile ID - -To get your Message profile ID: - -- Navigate to [Messaging](https://portal.telnyx.com/#/app/messaging) to find the profiles. -- Make sure you created a Telnyx Messaging Profile previously. Learn more [here](https://developers.telnyx.com/docs/v2/messaging/quickstarts/portal-setup). -- Go to the active Messaging Profile. -- Copy the profile ID. - -## Make sure From address is valid - -A valid from address must be a valid phone number in +E.164 format, a short code, or an alphanumeric sender ID associated with the sending messaging profile. Alphanumeric sender IDs must be between 1 and 11 characters long, and can only contain ASCII letters, numbers, and spaces. They must contain at least one letter. - -## Create a Telnyx integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on the Novu. -- Locate Telnyx and click on the **Connect** button. -- Enter your Telnyx API Key. -- Fill the Message profile ID field. -- Enter the Valid From address. -- Click on the **Save** button. -- You should now be able to send notifications using Telnyx in Novu. diff --git a/docs/docs/channels/sms/termii.md b/docs/docs/channels/sms/termii.md deleted file mode 100644 index f0b2d6558bc..00000000000 --- a/docs/docs/channels/sms/termii.md +++ /dev/null @@ -1,60 +0,0 @@ -# Termii - -You can use the [Termii](https://termii.com/) provider to send SMS messages to your customers using the Novu Platform with a single API to create multi-channel experiences. - -## Getting Started - -To use Termii provider in the SMS channel, the first step is to create a Termii account and add your API key and Sender ID to the Termii integration on the Novu platform. - -## Retrieving your API Key - -To find your Termii API key: - -- [Sign up](https://accounts.termii.com/#/register) or [Login](https://accounts.termii.com/#/login) to your Termii account. -- Navigate to your [dashboard](https://accounts.termii.com/#/). -- Then scroll to the bottom of the page to find your API key. - -![Image displaying the API Key on the dashboard](/img/providers/sms/termii/api-key.png) - -Alternatively, you can find the API key on the Settings page. - -- Scroll to the bottom of the sidebar (on the left) and click on settings. -- This will display a dropdown from which you can then click on `API Token` to view your API key. - -![Image displaying the API Key on the settings page](/img/providers/sms/termii/api-key-2.png) - -## Get your Sender's ID - -Sender IDs allow you to brand your messages as you send them to your customers. - -To get your Sender's ID: - -- On the sidebar (on the menu on your left), click on `Rental`. This will display a dropdown. Click on `SMS Sender IDs` from the dropdown options. -- On the page that appears, you'll find a list of your Sender IDs - -![Image showing Rental page where you can view the list of your Sender IDs](/img/providers/sms/termii/sender-id.png) - -If you have not created one yet: - -- click on `Make a new request` button to request for a Sender ID. -- Fill in the form -- Click on `Save` - -![Image showing the form that allows you to request for Sender ID on Termii](/img/providers/sms/termii/sender-id-request-form.png) - -Once it is approved, you can use your Sender ID as the `from` field on the Novu platform. - -## Create a Termii integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Termii** under SMS section and click on the **Connect** button. - -![Image showing Novu web platform integration store page](/img/providers/sms/termii/integration.png) - -- Enter your Termii API Key. -- Fill the `From` field. -- Click on the **Connect** button. - -![Termii integration modal on Novu’s web integration page](/img/providers/sms/termii/web.png) - -Now it is possible to send SMS notifications using **Termii** in Novu. diff --git a/docs/docs/channels/sms/twilio.md b/docs/docs/channels/sms/twilio.md deleted file mode 100644 index d9171131158..00000000000 --- a/docs/docs/channels/sms/twilio.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -sidebar_label: Twilio -sidebar_position: 1 ---- - -# Twilio SMS - -You can utilize the [Twilio](https://www.twilio.com/) API to communicate in all sorts of ways with your customers. Mainly though, using SMS messaging will you get the best value. - -## Setup Twilio - -First go to [Twilio](https://www.twilio.com/) and create an account, probably starting with their free trial. Next, to send out SMS messages with Twilio they will provide us with a phone number that we can use, in the middle of page we should have access to a Getting a Phone Number step cycle. - -## Getting and utilizing the Phone Number - -When first using Twilio there should be a section in the main console. Otherwise, -you may have to [Buy](https://console.twilio.com/us1/develop/phone-numbers/manage/search?frameUrl=%2Fconsole%2Fphone-numbers%2Fsearch%3Fx-target-region%3Dus1¤tFrameUrl=%2Fconsole%2Fphone-numbers%2Fsearch%3FisoCountry%3DUS%26searchTerm%3D%26searchFilter%3Dleft%26searchType%3Dnumber%26x-target-region%3Dus1%26__override_layout__%3Dembed%26bifrost%3Dtrue) a number from that link to begin using it. Assuming this is the first run though, utilize the free number given to us. Simply follow one of their many [Tutorials](https://www.twilio.com/docs/usage/requests-to-twilio) within their docs to understand every part of the process. - -In short, no matter the language you prefer the process is the same. Load the Account SID and Auth token into the code, using some sort of safe environment such as .env variables. Nobody should have access to this but you. Create a client object from Twilio that take the SID and Token as variables then create a message with the client. The message is an object that has three things; that free number from earlier, the number you would like to send to, and a body message that you want to send through SMS. - -## Create a Twilio integration with Novu - -- Visit the [Integrations](https://web.novu.co/integrations) page on Novu. -- Locate **Twilio** and click on the **Connect** button. -- Go to your [Console](https://console.twilio.com/) on Twilio and access the Account Info section at the bottom of the page -- Enter your `Account SID`, `Auth Token` and `Twilio Phone Number`. -- Click on the **Save** button. -- You should now be able to send SMS notifications using **Twilio** in Novu. diff --git a/docs/docs/community/_category_.json b/docs/docs/community/_category_.json deleted file mode 100644 index 64081e34f08..00000000000 --- a/docs/docs/community/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "Community", - "position": 7, - "collapsible": false -} diff --git a/docs/docs/community/code-conduct.md b/docs/docs/community/code-conduct.md deleted file mode 100644 index bc5d9a926f2..00000000000 --- a/docs/docs/community/code-conduct.md +++ /dev/null @@ -1,132 +0,0 @@ ---- -sidebar_position: 6 ---- - -# Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, religion, or sexual identity -and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the - overall community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or - advances of any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email - address, without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -support@novu.co. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series -of actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or -permanent ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within -the community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.0, available at -. - -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/inclusion/blob/master/code-of-conduct-enforcement/consequence-ladder.md). - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see the FAQ at -. Translations are available at -. diff --git a/docs/docs/community/create-provider.md b/docs/docs/community/create-provider.md deleted file mode 100644 index 32c69a2363c..00000000000 --- a/docs/docs/community/create-provider.md +++ /dev/null @@ -1,273 +0,0 @@ ---- -sidebar_position: 4 -sidebar_label: 'Add a new provider' ---- - -# How to add a new provider? - -Novu currently supports five channels `in_app`, `push`, `email`, `chat` and `sms`. For `in_app` we support only our own provider, so new providers cannot be added for this channel. For the other four channels we support integration of external providers. This guide will help in adding new providers for any of these 4 channels. **In this guide, we are adding a new provider for email channel, but all of the mentioned steps are similar for other channels as well**. - -## Description - -Providers allow us to handle message delivery over multiple channels. We have multiple providers for each channel (SMS, Email, Push and Chat). To get started with adding a new provider let's look at setting up our repository. - -## Requirements - -- Node.js version v16.15.1 -- MongoDB -- Redis -- **(Optional)** pnpm - Needed if you want to install new packages -- **(Optional)** localstack (required only in S3 related modules) - -Need help installing the requirements? Read more [here](https://novuhq.notion.site/Dev-Machine-Setup-98d274c80fa249b0b0be75b9a7a72acb#a0e6bf0db22f46d8a2677692f986e366). - -:::info -We have used pnpm package manager in this guide. You can use npm as well. -::: - -## Initialization - -Fork the novu repository and clone it in your local machine. - -```shell -git clone https://github.com/<'YOUR_GITHUB_USER_NAME'>/novu.git -``` - -To set up the repository, run the initial setup command: - -```shell -pnpm run setup:project -``` - -At the root of the project build the `node` package to get started. - -```shell -cd packages/node && pnpm run build -``` - -## Generate provider - -After the project is initialized, a new provider can be generated using below command. - -```shell -pnpm run generate:provider -``` - -:::note -Use above command in root of the project. -::: - -Choose the provider type. - -```shell -> generate:provider -> npx hygen provider new - -? What type -❯ EMAIL - SMS - PUSH - CHAT -``` - -Use `up` and `down` arrow to switch `channel` type and press `enter` to select. - -For this example, we will be selecting `EMAIL` as our provider type. The name for our provider will be `example-provider`. - -```shell -? Write the provider name `kebab-cased` (e.g. proton-mail, outlook365, yahoo-mail): example-provider -``` - -Make sure your selected name is not conflicting with our existing provider's name. Boilerplate files for this new `example-provider` is generated in your local machine project. - -> In above example, we have given our provider name as `example-provider` for simplicity. If provider you want to add have name as `twilio`, don't use `twilio-provider` as name, instead use `twilio` only. If one provider supports multiple channels like `infobip` supports both `sms` and `email` channels, use `infobip-email` or `infobip-sms` to differentiate these providers. - -Once our `example-provider` is generated we will need to begin working from within `/providers/example-provider` directory. Make sure to write the test for this new provider. - -```ts title='providers/example-provider/src/lib/example-provider.provider.ts' -import { - ChannelTypeEnum, - ISendMessageSuccessResponse, - IEmailOptions, - IEmailProvider, -} from '@novu/stateless'; - -export class ExampleProviderEmailProvider implements IEmailProvider { - id = 'example-provider' - channelType = ChannelTypeEnum.EMAIL as ChannelTypeEnum.EMAIL; - - constructor( - private config: { - apiKey: string; - } - ) {} - - async sendMessage(options: IEmailOptions): Promise { - return { - id: 'id_returned_by_provider', - date: 'current_time' - } -} -``` - -Template test case for `example-provider`. - -```ts title='providers/example-provider/src/lib/example-provider.provider.sepc.ts' -import { ExampleProviderEmailProvider } from './example-provider.provider'; - -test('should trigger example-provider library correctly', async () => {}); -``` - -:::info -Add provider's sdk as dependency in provider's package.json file. Run `pnpm run setup:project` to build all dependencies again. Use this newly sdk methods to complete provider's `sendMessage` function. Check [`Important Links`](#important-links) section for each channel's provider example. -::: - -## Add provider logos - -In order to present this new provider in the `integration store` we need logos in dark and light mode. Add dark and light color logs in respective folders of `apps/web/public/static/images/providers` directory. Use provider name as file name. Sample name for our above added provider is `example-provider.png`. The possible formats are `svg` and `png`. - -## Add config items in the list - -In order to build the UI integration store, we need to provide it list of all provider integrations. -This part is made up of two parts: - -- Create credentials config -- Add ProviderId Enum -- Add provider configuration to providers list - -### 1. Create credentials config - -Every provider requires some credentials to create instance. Novu will add these credentials field in integration store provider's form so that user can use thier credentials to connect to their preferred provider to use for that channel notification. -For example, in above added `example-provider`, we have only one credential `ApiKey`. We will need to add -a config object for `example-provider` with all existing provider's configs like below. - -```typescript title='libs/shared/src/consts/providers/credentials/provider-credentials.ts' -export const exampleProviderConfig: IConfigCredentials[] = [ - { - key: CredentialsKeyEnum.ApiKey, - displayName: 'API Key', - type: 'text', - required: true, - }, - ...mailConfigBase, -]; -``` - -1. Here `key` is of type `CredentialsKeyEnum`. If you want to add a new type of credentials key, you can add in `CredentialsKeyEnum`. -2. `displayName` is human-friendly easy to understand name which will be shown in provider integration form for this credential. -3. `type` here means text field type. this can be string for text, text for text-area, switch for toggle. -4. `required` is of boolean type. -5. `mailConfigBase` is an object having default credentials required by any `email` provider. Make sure not to add duplicate provider which are already there in `mailConfigBase`. In case of other channel provider, we will use that channel config base in place of `mailConfigBase`. - -> A credential can be made secret by adding in `./secure-credentials.ts` file. - -### 2. Add ProviderId Enum - -Add this new provider id in respective channel provider id enum in file `libs/shared/src/consts/providers/provider.enum.ts`. As our `example-provider` is of email type, add this in `EmailProviderIdEnum` with all existing providers like below - -```typescript title='libs/shared/src/consts/providers/provider.enum.ts' -export enum EmailProviderIdEnum { - ExampleProvider = 'example-provider', -} -``` - -### 3. Add provider to providers list - -Now we need to add the provider data to the list located at `libs/shared/src/consts/providers/channels/email.ts`. -Note that the `id` is the provider's name, `displayName` is the provider's name in pascal case, `credentials` are the one we created in the previous step, `logoFileName` should be as it was on the adding logo step (with the format type included). - -```typescript title='libs/shared/src/consts/providers/channels/email.ts' -{ - id: 'example-provider', - displayName: 'Example Provider', - channel: ChannelTypeEnum.EMAIL, - credentials: exampleProviderConfig, - // Use valid documentation link - docReference: 'https://docs.example-provider.com/', - logoFileName: { light: 'example-provider.png', dark: 'example-provider.png' } -} -``` - -## Add provider handler in the API - -### 1. Adding the provider dependency in application-generic package - -In the previous step, we created a standalone provider package that will be published to NPM. However currently in our development environment, it is not yet published. In order to use it locally please go to the `package.json` located in `apps/packages/application-generic/package.json` and add it manually to the dependencies list: `"@novu/": "^"` - -> Please note that the provider name and version can be found from the provider `package.json` you created earlier. - -After adding the dependency run `pnpm run setup:project` from the root of the monorepo. so, it can create the required symlinks for the newly created package. - -### 2. Create provider handler - -In order to map internally the different providers credentials, we need to add a provider handler at respective channel handlers located. For Email it can be found at `apps/packages/application-generic/src/factories/mail/handlers`. Other channel handlers can also be found here. - -Create a new file `example-provider.handler.ts` here with the following code - -```typescript title='packages/application-generic/src/factories/mail/handlers/example-provider.handler.ts' -import { ChannelTypeEnum } from '@novu/shared'; -import { ExampleProviderEmailProvider } from '@novu/example-provider'; -import { BaseHandler } from './base.handler'; - -export class ExampleProviderHandler extends BaseHandler { - constructor() { - super('example-provider', ChannelTypeEnum.EMAIL); - } - - buildProvider(credentials, from: string) { - const config: { apiKey: string } = { apiKey: credentials.apiKey }; - - this.provider = new ExampleProviderEmailProvider(config); - } -} -``` - -Add below line to export this handler - -```typescript title='packages/application-generic/src/factories/mail/handlers/index.ts' -export * from './example-provider.handler'; -``` - -### 3. Add handler to factory - -The last step is to initialize the handler in the factory located in `packages/application-generic/src/factories/mail/mail.factory.ts` - -```typescript title='packages/application-generic/src/factories/mail/mail.factory.ts' -import { ExampleProviderHandler } from './handlers'; - -export class MailFactory { - handlers: IMailHandler[] = [new ExampleProviderHandler()]; -} -``` - -## Final Steps - -Now, build the project again using this command - -```shell -pnpm run setup:project -``` - -Run novu in your local machine. Read [here](./run-locally.md) to learn on how to run novu in local machine and test this new provider. - -Run below command in the root of project to run providers test - -```shell -pnpm run test:providers -``` - -If everything is working fine without any error, commit your local branch changes, push this branch and create a new pull request to our main repo. - -Hurray 🎉! You have successfully added a new provider in Novu! - -:::info -In this guide, we have used only one credential `apiKey` for our `example-provider`. This is for reference purpose only. Provider can have more than one credential as per its `SDK` requirements. At each step, you will need to be add all credentials carefully. Check providers in below `Important Links` section for reference. -::: - -## Important Links - -- [SendGrid Email Provider](https://github.com/novuhq/novu/blob/next/providers/sendgrid/src/lib/sendgrid.provider.ts) -- [Twilio SMS Provider](https://github.com/novuhq/novu/blob/next/providers/twilio/src/lib/twilio.provider.ts) -- [FCM Push Provider](https://github.com/novuhq/novu/blob/next/providers/fcm/src/lib/fcm.provider.ts) -- [Slack Chat Provider](https://github.com/novuhq/novu/blob/next/providers/slack/src/lib/slack.provider.ts) -- [Resend - How to add an Email API Provider to Novu](https://dev.to/novu/resend-how-to-add-an-email-api-provider-to-novu-49cd) diff --git a/docs/docs/community/faq.md b/docs/docs/community/faq.md deleted file mode 100644 index 58db30b601f..00000000000 --- a/docs/docs/community/faq.md +++ /dev/null @@ -1,72 +0,0 @@ -import FAQ from '@site/src/components/FAQ'; -import FAQItem from '@site/src/components/FAQItem'; - -# FAQ - -Here we will outline some of the most common questions we get asked about the project. Missing a question? Feel free to open an [issue](https://github.com/novuhq/novu/issues) or PR to add it to the list. - - - - -Novu consists of multiple services written in Node.js and Typescript. The following are the dependencies required to run the project fully: - -- Node.js version v16.15.1 -- MongoDB -- Redis -- File storage (S3/GCP/Azure) - Optional - - - - -In Novu, [handlebar variables](https://handlebarsjs.com/guide/) (variables enclosed within double curly brackets) are used to customize messages. Using this, one can take advantage of the following tools: - -- **Custom Variables:** You can create [custom variables](https://docs.novu.co/platform/workflows#variable-usage) by defining it in the payload and accessing its value using the following syntax: - - ```html - {{variable_name}} - ``` - -- **Iteration/Looping:** You can iterate through a list of variables using [each](https://docs.novu.co/platform/workflows#iteration) keyword. The code within the block will loop once for each element that is present in the iterable variable. The syntax is as follows: - - ```html - {{#each iterable}} ... {{/each}} - ``` - -- **Conditional Block:** - You can render a block conditionally using the [if](https://docs.novu.co/platform/workflows#conditional) keyword. The block is defined similar to the iteration block: - - ```html - {{#if condition}} ... {{/if}} - ``` - -For an in-depth explanation with examples, check out [Templates](https://docs.novu.co/platform/workflows#messages). - - - - -No, switching organization will only switch organization in UI, from API side all organizations are still active. Each organization has different api keys, subscribers and workflows. Notification template of one organization can not be used with other organization's subscriber. - - - - -Multiple active providers are only supported in [push](../channels/push) and [chat](../channels/chat) channels. - - - - -For Novu cloud users - notifications and activity feed data will be saved for 1 month. -In-app messages will be saved for 6 months. -After that time - the records will be archived. - -For self-hosted - the same time frame applies before records will be deleted. A TTL expiration date will be set for them. -Self-hosted users can disable ttl setting by adding environment variable `DISABLE_TTL=true`. - -Affected schemes: - -- Notification (1 month) -- Job (1 month) -- Message (in app - 1 year, all others - 1 month) -- ExecutionDetails (1 month) - - - diff --git a/docs/docs/community/monorepo-structure.md b/docs/docs/community/monorepo-structure.md deleted file mode 100644 index af047e1d404..00000000000 --- a/docs/docs/community/monorepo-structure.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -sidebar_position: 2 ---- - -# Monorepo structure - -In this guide, we will explore the Novu mono-repo structure and high-level structure of the different libraries and services we use. - -![Monorepo outline of packages and services](/img/monorepo-structure.jpeg) - -## Setting up the monorepo - -Novu uses [PNPM](https://pnpm.js.org/) as its package manager, and [NX](https://nx.dev/) as its build CLI tool. PNPM reduces the installation time and generates symlinks for all the internal packages we use. - -To initialize the monorepo, run the following command from the root of the project: - -```bash -npm run setup:project -``` - -This will: - -- run `pnpm install`, which will download all the needed dependencies and create symlinks for packages. -- copy the `.env.example` file to the `.env` file for the API service. -- execute the `npm run build` command to build all the dependency trees locally. - -For additional information on running Novu locally, visit the [run locally](https://docs.novu.co/community/run-locally) guide. - -## Apps - -The apps folder contains high-level applications and APIs. The app's outputs usually contain deployable units that a user can interact with either as an API or as a web/cli application. - -### API - -The API package is our main service for handling backend logic. It handles anything from authentication, authorization, workflow management, triggering events, etc... This is where the Novu business logic is handled. - -### WS aka Web-Socket - -This is the WebSocket NestJs server which connects to the widget and provides real-time updates about new notifications to the widget consumer. - -### WEB aka Admin Panel - -This is the Novu admin panel which is used to visually communicate with the API. You can configure workflows, manage content, enable or disable notifications, visually track the notification activity feed, etc... - -The `WEB` project is a create-react-app built, well, with React. 😄 - -### Widget - -This is the client of our embeddable notification center widget. It is consumed mainly with the embed script in an Iframe. We can access it on port 4500 to interact with it directly. - -## Libs - -### @novu/dal - -The `DAL` is our Data-Access-Layer. This is our connection to the DB service and wraps MongoDB and mongoose. When another service or API needs to consume the DB, it does not do that directly but uses the DAL as an interface. Importing `mongoose` directly outside the `dal` is not allowed. - -### @novu/testing - -This is a utility library that contains testing helpers. The testing helpers can generate test sessions and other functionality for e2e and unit-tests between our services. - -### @novu/shared - -The shared library contains reusable code and typescript interfaces between client and server packages. Code in the shared library should not contain any sensitive content because it can be accessed and downloaded by the web or other clients. - -### @novu/embed - -This is the connector between our client's web app and the widget project. It’s a small shim script that generates an iframe and attaches it to a client-specified div to host the notification widget. - -If you are familiar with the Google Analytics embedded snippet or intercom-like embeddings, it uses the same mechanics. - -## Packages (on npm) - -### @novu/node - -A Standalone Node.js wrapper around the Novu API. Exists to provide type-safe and easier access to the different API endpoints Novu exposes (Triggers, subscribers, etc…). - -### @novu/nest - -A Nest.js wrapper around the `@novu/node` package was created by the community to easily interact with the core library from a nest project. Also released on NPM as a package. - -### @novu/notification-center - -React component library that contains widget bell with the notification center. Can get override of components like ‘bell icon’, and ‘notification center’. - -## Providers - -These are the API wrappers created by the community to wrap communication providers in the following channels: - -Novu provides a single API to manage providers across multiple channels with a simple-to-use interface. - -### 💌 Email - -- [Sendgrid](https://github.com/novuhq/novu/tree/main/providers/sendgrid) -- [Netcore](https://github.com/novuhq/novu/tree/main/providers/netcore) -- [Mailgun](https://github.com/novuhq/novu/tree/main/providers/mailgun) -- [SES](https://github.com/novuhq/novu/tree/main/providers/ses) -- [Postmark](https://github.com/novuhq/novu/tree/main/providers/postmark) -- [Custom SMTP](https://github.com/novuhq/novu/tree/main/providers/nodemailer) -- [Mailjet](https://github.com/novuhq/novu/tree/main/providers/mailjet) -- [Mandrill](https://github.com/novuhq/novu/tree/main/providers/mandrill) -- [SendinBlue](https://github.com/novuhq/novu/tree/main/providers/sendinblue) - -### 📞 SMS - -- [Twilio](https://github.com/novuhq/novu/tree/main/providers/twilio) -- [Plivo](https://github.com/novuhq/novu/tree/main/providers/plivo) -- [SNS](https://github.com/novuhq/novu/tree/main/providers/sns) -- [Nexmo - Vonage](https://github.com/novuhq/novu/tree/main/providers/nexmo) -- [Sms77](https://github.com/novuhq/novu/tree/main/providers/sms77) -- [Telnyx](https://github.com/novuhq/novu/tree/main/providers/telnyx) -- [Termii](https://github.com/novuhq/novu/tree/main/providers/termii) -- [Gupshup](https://github.com/novuhq/novu/tree/main/providers/gupshup) - -### 📱 Push - -- [FCM](https://github.com/novuhq/novu/tree/main/providers/fcm) -- [Expo](https://github.com/novuhq/novu/tree/main/providers/expo) -- [SNS](https://github.com/novuhq/novu/tree/main/providers/sns) - -### 👇 Chat - -- [Slack](https://github.com/novuhq/novu/tree/main/providers/slack) -- [Discord](https://github.com/novuhq/novu/tree/main/providers/discord) - -### 📱 In-App - -- [Novu](https://docs.novu.co/notification-center/getting-started) - -### Other (Coming Soon...) - -- PagerDuty diff --git a/docs/docs/community/projects-and-articles.md b/docs/docs/community/projects-and-articles.md deleted file mode 100644 index e0625528475..00000000000 --- a/docs/docs/community/projects-and-articles.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -sidebar_position: 7 ---- - -# Projects and articles - -Here we will showcase some of the projects and articles our community have done with or about Novu. - -## Projects - -- [Hacksquad](https://github.com/novuhq/hacksquad-website) - -## Articles - -- [How Novu Made Email Notifications Easy For Businesses?](https://aviyel.com/post/3866/how-novu-made-email-notifications-easy-for-businesses) -- [Why do Notifications matter and should be use more in user flow?](https://iqra-firdose.hashnode.dev/why-do-notifications-matter-and-should-be-used-more-in-user-flow) diff --git a/docs/docs/community/run-locally.md b/docs/docs/community/run-locally.md deleted file mode 100644 index 517b6f8feb5..00000000000 --- a/docs/docs/community/run-locally.md +++ /dev/null @@ -1,268 +0,0 @@ ---- -sidebar_position: 1 ---- - -import FAQ from '@site/src/components/FAQ'; -import FAQItem from '@site/src/components/FAQItem'; - -# Run Novu locally - -## ⚡ Immediate working space with Gitpod - -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/novuhq/novu) - -## Requirements - -- Node.js version v16.15.1 -- MongoDB -- Redis -- **(Optional)** pnpm - Needed if you want to install new packages -- **(Optional)** localstack (required only in S3 related modules) - -Need help installing the requirements? Read more [here](https://novuhq.notion.site/Dev-Machine-Setup-98d274c80fa249b0b0be75b9a7a72acb#a0e6bf0db22f46d8a2677692f986e366). - -## Setup the project - -After installing the required services on your machine, you can clone and set up your forked version of the project: - -- Fork [Novu's repository](https://github.com/novuhq/novu). Clone or download your fork to your local machine. -- Run the project locally using `npm run start`. - -The `npm run start` will start the Jarvis CLI tool which allows you to run the whole project with an ease. -If you only want to run parts of the platform, you can use the following run commands from the root project: - -- **start:dev** - Synonym to `npm run start` -- **start:web** - Only starts the web management platform -- **start:ws** - Only starts the WebSocket service for notification center updates -- **start:widget** - Starts the widget wrapper project that hosts the notification center inside an iframe -- **start:api** - Runs the API in watch mode -- **start:worker** - Runs the worker application in watch mode -- **start:dal** - Runs the Data Access Layer package in watch mode -- **start:shared** - Starts the watch mode for the shared client and API library -- **start:node** - Runs the `@novu/node` package in watch mode -- **start:notification-center** - Runs and builds the React package for the Novu notification center - -## Set up your environment variables - -If you have used Jarvis CLI tool from the previous step you don't need to setup the env variables as Jarvis will do that on the first run if setup wasn't done before. - -The command `npm run setup:project` creates default environment variables that are required to run Novu in a development environment. -However, if you want to test certain parts of Novu or run it in production mode, you need to change some of them. These are all the available environment variables: - - - - -- `NODE_ENV` (default: local)
The environment of the app. Possible values are: dev, test, production, ci, local -- `S3_LOCAL_STACK`
The AWS endpoint for the S3 Bucket required for storing various media -- `S3_BUCKET_NAME`
The name of the S3 Bucket -- `S3_REGION`
The AWS region of the S3 Bucket -- `PORT`
The port on which the API backend should listen on -- `FRONT_BASE_URL`
The base url on which your frontend is accessible for the user. (e.g. web.novu.co) -- `DISABLE_USER_REGISTRATION` (default: false)
If users should not be able to create new accounts. Possible values are: true, false -- `REDIS_HOST`
The domain / IP of your redis instance -- `REDIS_PORT`
The port of your redis instance -- `REDIS_PASSWORD`
Optional password of your redis instance -- `REDIS_DB_INDEX`
The Redis database index -- `REDIS_CACHE_SERVICE_HOST`
The domain / IP of your redis instance for caching -- `REDIS_CACHE_SERVICE_PORT`
The port of your redis instance for caching -- `REDIS_CACHE_DB_INDEX`
The Redis cache database index -- `REDIS_CACHE_TTL`
The Redis cache ttl -- `REDIS_CACHE_PASSWORD`
The Redis cache password -- `REDIS_CACHE_CONNECTION_TIMEOUT`
The Redis cache connection timeout -- `REDIS_CACHE_KEEP_ALIVE`
The Redis cache TCP keep alive on the socket timeout -- `REDIS_CACHE_FAMILY`
The Redis cache IP stack version -- `REDIS_CACHE_KEY_PREFIX`
The Redis cache prefix prepend to all keys -- `REDIS_CACHE_SERVICE_TLS`
The Redis cache TLS connection support -- `IS_IN_MEMORY_CLUSTER_MODE_ENABLED`
The flag that enables the cluster mode. It might be Redis or ElastiCache cluster, depending on the env variables set for either service. -- `ELASTICACHE_CLUSTER_SERVICE_HOST`
ElastiCache cluster host -- `ELASTICACHE_CLUSTER_SERVICE_PORT`
ElastiCache cluster port -- `REDIS_CLUSTER_SERVICE_HOST`
Redis cluster host -- `REDIS_CLUSTER_SERVICE_PORTS`
Redis cluster ports -- `REDIS_CLUSTER_DB_INDEX`
Redis cluster database index -- `REDIS_CLUSTER_TTL`
Redis cluster ttl -- `REDIS_CLUSTER_PASSWORD`
Redis cluster password -- `REDIS_CLUSTER_CONNECTION_TIMEOUT`
Redis cluster connection timeout -- `REDIS_CLUSTER_KEEP_ALIVE`
Redis cluster TCP keep alive on the socket timeout -- `REDIS_CLUSTER_FAMILY`
Redis cluster IP stack version -- `REDIS_CLUSTER_KEY_PREFIX`
Redis cluster prefix prepend to all keys -- `JWT_SECRET`
The secret keybase which is used to encrypt / verify the tokens issued for authentication -- `SENDGRID_API_KEY`
The api key of the Sendgrid account used to send various emails -- `MONGO_URL`
The URL of your MongoDB instance -- `MONGO_MAX_POOL_SIZE`
The max pool size of the MongoDB connection -- `NOVU_API_KEY`
The api key of web.novu.co used to send various emails -- `SENTRY_DSN`
The DSN of sentry.io used to report errors happening in production - -
- - -- `NODE_ENV` (default: local)
The environment of the app. Possible values are: dev, test, production, ci, local -- `PORT`
The port on which the Worker app should listen on -- `STORE_ENCRYPTION_KEY`
The encryption key used to encrypt/decrypt provider credentials -- `MAX_NOVU_INTEGRATION_MAIL_REQUESTS`
The number of free emails that can be sent with the Novu email provider -- `NOVU_EMAIL_INTEGRATION_API_KEY`
The Novu email provider Sentry API key -- `STORAGE_SERVICE`
The storage service name: AWS, GCS, or AZURE -- `S3_LOCAL_STACK`
The LocalStack service URL -- `S3_BUCKET_NAME`
The name of the S3 Bucket -- `S3_REGION`
The AWS region of the S3 Bucket -- `GCS_BUCKET_NAME`
The name of the GCS Bucket -- `AZURE_ACCOUNT_NAME`
The name of the Azure account -- `AZURE_ACCOUNT_KEY`
The Azure account key -- `AZURE_HOST_NAME`
The Azure host name -- `AZURE_CONTAINER_NAME`
The Azure container name -- `AWS_ACCESS_KEY_ID`
The AWS access key -- `AWS_SECRET_ACCESS_KEY`
The AWS secret access key -- `REDIS_HOST`
The domain / IP of your redis instance -- `REDIS_PORT`
The port of your redis instance -- `REDIS_PASSWORD`
Optional password of your redis instance -- `REDIS_DB_INDEX`
The Redis database index -- `REDIS_CACHE_SERVICE_HOST`
The domain / IP of your redis instance for caching -- `REDIS_CACHE_SERVICE_PORT`
The port of your redis instance for caching -- `REDIS_DB_INDEX`
The Redis cache database index -- `REDIS_CACHE_TTL`
The Redis cache ttl -- `REDIS_CACHE_PASSWORD`
The Redis cache password -- `REDIS_CACHE_CONNECTION_TIMEOUT`
The Redis cache connection timeout -- `REDIS_CACHE_KEEP_ALIVE`
The Redis cache TCP keep alive on the socket timeout -- `REDIS_CACHE_FAMILY`
The Redis cache IP stack version -- `REDIS_CACHE_KEY_PREFIX`
The Redis cache prefix prepend to all keys -- `REDIS_CACHE_SERVICE_TLS`
The Redis cache TLS connection support -- `IS_IN_MEMORY_CLUSTER_MODE_ENABLED`
The flag that enables the cluster mode. It might be Redis or ElastiCache cluster, depending on the env variables set for either service. -- `ELASTICACHE_CLUSTER_SERVICE_HOST`
ElastiCache cluster host -- `ELASTICACHE_CLUSTER_SERVICE_PORT`
ElastiCache cluster port -- `REDIS_CLUSTER_SERVICE_HOST`
Redis cluster host -- `REDIS_CLUSTER_SERVICE_PORTS`
Redis cluster ports -- `REDIS_CLUSTER_DB_INDEX`
Redis cluster database index -- `REDIS_CLUSTER_TTL`
Redis cluster ttl -- `REDIS_CLUSTER_PASSWORD`
Redis cluster password -- `REDIS_CLUSTER_CONNECTION_TIMEOUT`
Redis cluster connection timeout -- `REDIS_CLUSTER_KEEP_ALIVE`
Redis cluster TCP keep alive on the socket timeout -- `REDIS_CLUSTER_FAMILY`
Redis cluster IP stack version -- `REDIS_CLUSTER_KEY_PREFIX`
Redis cluster prefix prepend to all keys -- `MONGO_URL`
The URL of your MongoDB instance -- `MONGO_MAX_POOL_SIZE`
The max pool size of the MongoDB connection -- `NEW_RELIC_APP_NAME`
The New Relic app name -- `NEW_RELIC_LICENSE_KEY`
The New Relic license key -- `SEGMENT_TOKEN`
The Segment Analytics token - -
- - -- `REACT_APP_ENVIRONMENT`
The environment of the app. Possible values are: dev, test, production, ci, local -- `REACT_APP_API_URL`
The base url on which your API backend would be accessible -- `REACT_APP_WS_URL`
The base url on which your WebSocket service would be accessible -- `SKIP_PREFLIGHT_CHECK` (default: true)
Solves a problem with React App dependency tree. - -:::warning - -When configuring different than default values for the API and WebSocket URLs, in order for the Web app to apply the changes done to the `./env` file, it is needed to run the script `pnpm envsetup`. -This will generate a file called `env-config.js` that will be copied inside of the `public` folder of the application. Its purpose is to inject in the `window._env_` object the chosen environment variables that manage the URLs the Web client will call to access to the API backend and the WebSocket service. - -::: - -
- - -- `NODE_ENV` (default: local)
The environment of the app. Possible values are: dev, test, production, ci, local -- `SENTRY_DSN`
The DSN of sentry.io used to report errors happening in production -- `REDIS_HOST`
The domain / IP of your redis instance -- `REDIS_PORT`
The port of your redis instance -- `REDIS_DB_INDEX`
The database index of your redis instance -- `REDIS_PASSWORD`
Optional password of your redis instance -- `JWT_SECRET`
The secret keybase which is used to encrypt / verify the tokens issued for authentication -- `MONGO_URL`
The URL of your MongoDB instance -- `MONGO_MAX_POOL_SIZE`
The max pool size of the MongoDB connection -- `PORT`
The port on which the WebSocket service should listen on - -
-
- -## Running tests - -After making changes, you can run the tests for the respective package using the appropriate CLI commands: - -### API - -To run the API tests, run the following command: - -```shell -npm run start:worker:test -npm run start:e2e:api -``` - -The tests create a new instance of Novu and a test db and run the tests against it. The test db is removed after all tests have finished running. - -### Web - -To run the front end tests for the web project using cypress you need to install localstack. -The cypress tests perform E2E tests. To be able to perform E2E tests, you need to run the API service in the appropriate test environment. - -Run the services in test env with the following commands: - -```shell -npm run start:web -npm run start:api:test -npm run start:worker:test -npm run start:ws:test -``` - -Run the cypress test suite with the following command: - -```shell -cd apps/web && npm run cypress:run -``` - -To open the cypress management window to debug tests, run the following commands: - -```shell -cd apps/web && npm run cypress:open -``` - -### Different ports used by the services the project spins up - -- **3000** - API -- **3002** - WebSocket Service -- **3004** - Worker application -- **4200** - Web Management UI -- **4701** - Iframe embed for notification center -- **4500** - Widget Service - -### Testing providers - -To run tests against the providers folder, you can use the `npm run test:providers` command. - -### Local environment setup script (beta) - -As an option in our script runner `Jarvis` we have made available an option to run [this script](https://github.com/novuhq/novu/blob/2f2abdcaaad8a7735e0a2d488607c3276c8975fd/scripts/dev-environment-setup.sh) that will automatically try to install all the dependencies needed to be able to run Novu locally, as previous step of installing the project dependencies through `pnpm install`. -When executing it inside `Jarvis`, you will need to have previously installed by yourself `git` and `node`, as we mentioned earlier on this page. - -The script can be run on its own without any previously dependency installed, as it is prepared to execute the following tasks: - -- Check of the running OS in the local machine (currently only MacOSx and [GNU Linux](https://en.wikipedia.org/wiki/GNU/Linux_naming_controversy) supported) -- Install of OS dependencies (currently only MacOSx supported) - -- MacOSx: It will execute the following tasks - --- Will try to install or update [XCode](https://developer.apple.com/xcode/) (skippable step; though XCode installs [`git`](https://git-scm.com/) that is a required dependency for later) - --- Will install [Rosetta](https://support.apple.com/en-gb/HT211861) for Apple CPUs - --- Will set up some opinionated OS settings -- Will check if [`git`](https://git-scm.com/) is installed and if not will abort operation -- Will make [ZSH](https://en.wikipedia.org/wiki/Z_shell) as the default shell to be able to execute the next task -- Will (opinionatedly) install [Oh My Zsh!](https://ohmyz.sh/) (skippable task) -- Will (opinionatedly) install the [Homebrew](https://brew.sh/) package manager and will set up your local environment to execute it besides adding some casks -- Will (opinionatedly) install [NVM](https://github.com/nvm-sh/nvm) as Node.js version manager -- Will install the required [Node.js](https://nodejs.org/en/) version to be able to [run Novu](https://github.com/novuhq/novu/blob/2f2abdcaaad8a7735e0a2d488607c3276c8975fd/package.json#L180) -- Will install [PNPM](https://pnpm.io/) as package manager, required dependency for some of the tasks inside Novu's scripts -- Will install [Docker](https://www.docker.com/) as containerized application development tool -- Will install required databases [MongoDB](https://www.mongodb.com/) (Community version) and [Redis](https://redis.io/) through Homebrew -- Will install the [AWS CLI](https://aws.amazon.com/cli/) tool (not required to run Novu; it is a core maintainers used tool) -- Will create a local development domain `local.novu.co` in your local machine -- Will clone Novu repository in your local machine (skippable step) to a selected folder `$HOME/Dev` - -:::warning - -This script has only been thoroughly tested in MacOSx. Little testing has been run in GNU Linux. - -::: - -:::info -This script is not bullet-proof and some of the tasks have intertwined dependencies with each other. We have tried to make it as idempotent as possible but some loose knots will probably show or because conflicts between versions of the different dependencies. -Please report to us any problem found and we will try to fix or assist though we have not the resources to make it idempotent in every potential system and potential combinations. - -::: diff --git a/docs/docs/cookbook/_category_.json b/docs/docs/cookbook/_category_.json deleted file mode 100644 index a91acfa9469..00000000000 --- a/docs/docs/cookbook/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "Cookbook", - "position": 5, - "collapsible": false -} diff --git a/docs/docs/cookbook/introduction.md b/docs/docs/cookbook/introduction.md deleted file mode 100644 index 382257f3405..00000000000 --- a/docs/docs/cookbook/introduction.md +++ /dev/null @@ -1,181 +0,0 @@ ---- -sidebar_position: 6 -sidebar_label: Introduction ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -# Cookbook - -This cookbook contains recipes and code samples demonstrating how to accomplish everyday tasks with Novu in your application. Each code example uses our libraries and SDKs. - -![UML flow](https://res.cloudinary.com/dxc6bnman/image/upload/v1690181515/flow-2x-straight-white-bg_l8elfm.png) - -## Fetch Subscriber Feed - -A subscriber feed is a list of all In-App messages for a single subscriber. It's a continuous stream of messages displayed in a list that subscribers can scroll through on the frontend via the Notification Center. - -It is a dynamic list with **seen** and **unseen** capabilities. Multiple feeds can exist for a subscriber. - -:::info -**Subscriber Feed** is very different from **Activity Feed**. The former is for In-App channels, while the latter is a list of every message and relevant metadata across all channels shown in your dashboard. -::: - -The code sample below fetches the list of all In-App messages sent to a specific subscriber. - - - - -```js -const { data: inAppMessages } = await novu.subscribers.getNotificationsFeed('subscriberId', { - page: 0, - limit: 10, - - // it is of type string. By default all feeds messages are fetched - feedIdentifier: 'Marketing', - - // seen and read filter of type boolean - seen: true, - read: true, -}); -``` - - - - -## Fetch All Feeds - -In-App messages are grouped in Feeds. There can be one or multiple feeds. - -The code sample below fetches all the feeds that have been created and exist in the In-App steps. - - - - -```javascript -const { data: feedsData } = await novu.feeds.get(); -``` - - - - -## Delete a Message From a Feed - -A message is a content sent to a single subscriber over a single channel. Some messages are simple, like SMS, while others have more features and capabilities, such as Email, Chat, In-App. - -A single message can be deleted from a Feed. The code sample below shows how to do it: - - - - -```javascript -// messageId is of MongoDB Id type -await novu.messages.deleteById('messageId'); -``` - - - - -## Fetch all Messages Sent To All Subscribers - -You can retrieve all messages sent to all subscribers. There are a couple of filters you can apply to fetch these messages. - -- channel: fetches all messages that were sent via a specific channel, e.g Email, Sms, Push, In-App -- subscriberId: fetches all messages sent to a specific subscriber -- transactionIds: fetches all messages via transaction ids. - - - - -```javascript -import { ChannelTypeEnum } from '@novu/node'; - -// All fields are optional -const listMessagesOptions = { - // pagination options - page: 0, - limit: 20, - - /** - * Filter options - */ - // use ChannelTypeEnum.PUSH for push, ChannelTypeEnum.IN_APP for in-app, - channel: ChannelTypeEnum.EMAIL, // only email type messages will be fetched - subscriberId: '6444105141ffb0919496dfcb', - transactionIds: ['644-41051-41ffb0-919496-dfcb'], -}; - -const { data: messagesData } = await novu.messages.list(listMessagesOptions); -``` - - - - -## Mark an In-App Message as Read/Seen - -You can mark an In-App message as read/seen. Messages from other channels: **Email**, **Push**, **Chat**, **Sms** can't be marked as read/seen. - - - - -```javascript -const { data: markMessageAsRead } = await novu.subscribers.markMessageRead( - 'subscriberId', - 'messageId' -); - -const { data: markMessageAsSeen } = await novu.subscribers.markMessageSeen( - 'subscriberId', - 'messageId' -); -``` - - - - -## Mark an In-App Message as Read/Unread/Seen/Unseen - -You can mark an In-App message as read/unread/seen/unseen. Messages from other channels: **Email**, **Push**, **Chat**, **Sms** can't be marked as read/unread/seen/unseen. - - - - -```javascript -const { data: markMessageAs } = await novu.subscribers.markMessageAs('subscriberId', 'messageId', { - seen: true, - read: false, -}); -``` - - - - -## Mark all In-App Messages as Read/Unread/Seen/Unseen - -You can mark all In-App messages as read/unread/seen/unseen. - -Messages from other channels: **Email**, **Push**, **Chat**, **Sms** can't be marked as read/unread/seen/unseen. - - - - -```javascript -import { MarkMessagesAsEnum } from "@novu/node" - -const { data: markAllInAppMessages } = await novu.subscribers.markAllMessagesAs( - 'subscriberId', - - // can be filtered with feed identifiers - feedIdentifier: ['Marketing', 'Product'] - - // MarkMessageAsEnum.READ => It will mark all messages as read - // MarkMessageAsEnum.SEEN => It will mark all messages as seen - // MarkMessageAsEnum.UNREAD => It will mark all messages as unread - // MarkMessageAsEnum.UNSEEN => It will mark all messages as unseen - markAs: MarkMessageAsEnum.Read -); -``` - - - diff --git a/docs/docs/guides/_category_.json b/docs/docs/guides/_category_.json deleted file mode 100644 index 0e09fa97984..00000000000 --- a/docs/docs/guides/_category_.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "label": "Guides", - "position": 6, - "collapsible": false -} diff --git a/docs/docs/guides/how-to-add-digest-to-email-notifications.md b/docs/docs/guides/how-to-add-digest-to-email-notifications.md deleted file mode 100644 index b355b9eaf6e..00000000000 --- a/docs/docs/guides/how-to-add-digest-to-email-notifications.md +++ /dev/null @@ -1,269 +0,0 @@ ---- -sidebar_position: 2 -sidebar_label: How to Add Digest to Email Notifications ---- - -# How to Add Digest to Email Notifications - -## Introduction - -In this guide, you’ll learn how to add digest functionality to email notifications. But before exploring the actual code, let’s understand what a digest notification is and how it works. - -You can find the entire code(frontend as well as backend) for this app [here](https://github.com/novuhq/digest-email-app). - -:::info -If, instead, you want to add digest to in-app notifications, we have a guide for that as well. Take a look [here](https://docs.novu.co/guides/how-to-add-digest-to-in-app-notifications). -::: - -### What is a Digest Notification? - -Often when you associate notifications with user activity, the end user can be bombarded with messages because of the nature of the activity. Take for example the case of commenting in the context of a social media app. If you were to send a notification to a user for every comment they receive, and they happen to receive 100 comments, it could lead to user fatigue since you would have to send 100 messages. - -This is where digest notifications come into the picture! - -A digest notification is a notification that consolidates information from several notifications into one and delivers that notification to the end user instead of several separate messages. - -### How does Digest Notification Work? - -Novu has a built-in digest engine that collects multiple trigger events, aggregates them into a single message, and delivers it to the subscriber. You can use the digest engine by adding a ‘digest node’ to your workflow in the workflow editor in the [Novu dashboard](https://web.novu.co/workflows). If you want to learn more about it, [this](https://docs.novu.co/platform/digest/) is a great place to start. - -Let’s see it in action now! - -## Add Digest Notification To An App - -To get started with this, you need the following: - -- A Novu account. [Sign up for free](http://web.novu.co) if you don’t have one yet. -- A working React development environment. - -## Workflow setup in Novu - -Once, you have these, follow the steps below: - -1. Head over to the Novu Dashboard. -2. Click “Workflows” on the left sidebar of your Novu dashboard. -3. Click the “Create Workflow” button on the top right: - -![Create workflow on Novu web dashboard](https://res.cloudinary.com/dxc6bnman/image/upload/v1688127676/guides/SCR-20230630-pqdm_z5npqe.png) - -Once you click the ‘create workflow’ button, you’ll see a dropdown. Select ‘blank workflow’ from the dropdown: - -![select blank workflow in dropdown](https://res.cloudinary.com/dxc6bnman/image/upload/v1688131596/guides/Screenshot_2023-06-25_at_10.54.37_PM_cstufw.png) - -You’ll now be taken to the workflow editor: - -![workflow editor in Novu workflow editor](https://res.cloudinary.com/dxc6bnman/image/upload/v1688131696/guides/Screenshot_2023-06-25_at_10.56.11_PM_b7fc7i.png) - -Once here, you can add the channels you want to use for sending notifications and configure them. For this guide, we’ll use the ‘Email’ channel. You’ll also see the ‘Digest’ action on the right sidebar. - -:::info -Note: Each node that is added below the digest node will only be triggered after the specified time interval -::: - -For example, in our case, say we want the email notification to be sent after every 6 hours. So, add the 'digest' action below the 'trigger node', and add the 'email' channel node below the 'digest' node as shown below: - -![Add digest action below the trigger node and email channel node below the digest node](https://res.cloudinary.com/dxc6bnman/image/upload/v1689095077/guides/Screenshot_2023-07-11_at_10.33.23_PM_peyqdm.png) - -The 'digest' node allows you to set a specific time interval for when notifications should be sent: - -![Configure the time interval in the digest node](https://res.cloudinary.com/dxc6bnman/image/upload/v1689095225/guides/Screenshot_2023-07-11_at_10.36.48_PM_wslpsu.png) - -Once, you’ve configured it. Go ahead and configure the 'email’ channel as per your need: - -![Various options in the email channel](https://res.cloudinary.com/dxc6bnman/image/upload/v1689095875/guides/SCR-20230711-tprk_yjit6u.png) - -Here’s a brief explanation of all the options: - -- **1-Preview:** This shows you a glimpse of what the email notification item will look like when delivered to the client. -- **2-Sender Name:** Lets you set the sender name for emails that the client will receive. -- **3-Subject:** This lets you define the subject line for the emails that the client will receive. -- **4-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](https://docs.novu.co/platform/step-filter/#subscriber-seen--read-filters). -- **5-Custom Code** - In custom code, you can write custom digest templates to show some/all parts of a message. Read [more about it here](https://docs.novu.co/platform/digest#writing-digest-templates). -- **6-Test** - This allows you to send a test email to test if everything is working as per your wish. - -You can write your own digest template in the 'custom code' section or just follow this guide as shown in the picture above. -Once you’re done configuring this to your liking, click on the ‘update’ button on the top right. - -It’ll automatically create a trigger code that you can use in your app. To get it, click on the ‘get snippet’ button on the top right and copy it: - -![code snippet to trigger ](https://res.cloudinary.com/dxc6bnman/image/upload/v1689096592/guides/Screenshot_2023-07-11_at_10.59.42_PM_pmd1as.png) - -Now, let’s see how to add Novu to our app! - -## Add Novu to the Backend and Configure it - -In your backend, install the novu package using the following code: - -```bash -npm install @novu/node -``` - -Now, create a route that you want to hit when called from the front end. In our demo app, this is the route: - -```jsx -import express from 'express'; - -import { getEmailDigest } from '../controller/emaildigest.js'; - -const router = express.Router(); - -router.post('/sending-email-digest', getEmailDigest); - -export default router; -``` - -Now, we need to write a controller function that will handle the logic for what is to be sent in the trigger function’s payload. In our case, this is the controller function: - -```jsx -import { sendEmailDigest } from '../novu/novu.js'; - -export const getEmailDigest = async (req, res) => { - const { notif, email } = req.body; - try { - await sendEmailDigest(notif, email); - res.status(201).json({ message: 'success', notif: notif }); - } catch (error) { - res.status(409).json({ message: error.message }); - } -}; -``` - -To make it modular, we’ll keep the trigger code in a separate function in a separate file (’novu.js’, in our case) and the trigger function is getting called in the controller function above by the name ‘getEmailDigest’. - -If you’re following the guide, you’ve already copied the trigger function. But before we can add it to our app, we need one key thing - Subscribers. - -Subscribers are users to which the notifications are sent. You can see a list of subscribers in the [Novu dashboard](https://web.novu.co/subscribers) as well. - -In our app, we’ll create a subscriber in Node.js as we’re writing our backend in Node.js, but we also have backend SDKs ([Node.js](https://github.com/novuhq/novu/tree/next/packages/node), [PHP](https://github.com/novuhq/novu-php), [.NET](https://github.com/novuhq/novu-dotnet), [Elixir](https://github.com/novuhq/novu-elixir), [Go](https://github.com/novuhq/go-novu), [Ruby](https://github.com/novuhq/novu-ruby), [Python](https://github.com/novuhq/novu-python), and [Kotlin](https://github.com/novuhq/novu-kotlin)) to choose from. The recommended way to create a subscriber in NodeJS is as follows: - -```jsx -await novu.subscribers.identify('digestEmailSub', { - firstName: 'digest email subscriber', - email: email, -}); -``` - -Here, we’re creating a subscriber with the `subscriberID` of `digestEmailSub.` In most real-world scenarios, the `subscriberId` should be an alphanumeric entity like `adfa67y87ad0`. You can read more about subscribers [here](https://docs.novu.co/platform/subscribers/). - -Back in our app, we can now add the trigger function: - -```jsx -import { Novu } from '@novu/node'; - -export const sendEmailDigest = async (notif, email) => { - const novu = new Novu(process.env.YOUR_NOVU_API_KEY); - await novu.subscribers.identify('digestEmailSub', { - firstName: 'digest email subscriber', - email: email, - }); - - novu.trigger('emaildigestworkflow', { - to: { - subscriberId: 'digestEmailSub', - email: email, - }, - payload: { - notif: notif, - }, - }); -}; -``` - -Now, we just need to hit the route defined above from the front end. - -## Hit the backend route from the front end - -From the front end, we just need to hit the route we had defined above. Below, I'm sharing the body component of the demo app I created to illustrate this: - -```jsx -const Body = () => { - const [formInput, setFormInput] = useState({ notif: '', email: '' }); - const [buttonClicked, setButtonClicked] = useState(false); - - const onSubmitHandler = async (e) => { - e.preventDefault(); - const response = await fetch( - 'https://emaildigestbackend.onrender.com/api/v1/sending-email-digest', - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(formInput), - } - ); - console.log(response.data); - setFormInput({ notif: '' }); - }; - - const handleClick = () => { - setButtonClicked(true); - - // Reset the button feedback after a certain duration - setTimeout(() => { - setButtonClicked(false); - }, 100); - }; - - const onChangeHandler = (e) => { - const value = e.target.name === 'email' ? e.target.value.trim() : e.target.value; - - setFormInput((prev) => ({ - ...prev, - [e.target.name]: value, - })); - }; - return ( -
-

Email Digest Playground

-

- Don't know how to? Start{' '} - - {' '} - here - -

-
-
-
- - -
-
- -