├── src ├── hooks │ └── .gitkeep ├── pages │ └── .gitkeep ├── components │ ├── shared │ │ ├── code │ │ │ ├── index.js │ │ │ └── code.jsx │ │ ├── link │ │ │ ├── index.js │ │ │ └── link.jsx │ │ ├── seo │ │ │ ├── index.js │ │ │ └── seo.jsx │ │ ├── burger │ │ │ ├── index.js │ │ │ └── burger.jsx │ │ ├── footer │ │ │ ├── index.js │ │ │ └── footer.jsx │ │ ├── header │ │ │ ├── index.js │ │ │ ├── theme-switcher │ │ │ │ ├── index.js │ │ │ │ ├── images │ │ │ │ │ ├── moon.inline.svg │ │ │ │ │ └── sun.inline.svg │ │ │ │ └── theme-switcher.jsx │ │ │ └── header.jsx │ │ ├── layout │ │ │ ├── index.js │ │ │ └── layout.jsx │ │ ├── code-snippets │ │ │ ├── code │ │ │ │ ├── index.js │ │ │ │ └── code.jsx │ │ │ ├── index.js │ │ │ └── code-snippets.jsx │ │ ├── mobile-menu │ │ │ ├── index.js │ │ │ └── mobile-menu.jsx │ │ ├── navigation │ │ │ ├── index.js │ │ │ └── navigation.jsx │ │ ├── section-wrapper │ │ │ ├── index.js │ │ │ └── section-wrapper.jsx │ │ ├── parametr-with-type │ │ │ ├── index.js │ │ │ ├── sub-parametr │ │ │ │ ├── index.js │ │ │ │ ├── sub-sub-parametr │ │ │ │ │ ├── index.js │ │ │ │ │ └── sub-sub-parametr.jsx │ │ │ │ └── sub-parametr.jsx │ │ │ └── parametr-with-type.jsx │ │ ├── method-with-endpoint │ │ │ ├── index.js │ │ │ └── method-with-endpoint.jsx │ │ ├── section-with-content │ │ │ ├── index.js │ │ │ └── section-with-content.jsx │ │ └── response-code │ │ │ ├── index.js │ │ │ └── response-code.jsx │ └── pages │ │ ├── main │ │ └── sections │ │ │ ├── index.js │ │ │ └── sections.jsx │ │ └── api-reference │ │ └── overview │ │ ├── index.js │ │ └── overview.jsx ├── images │ ├── favicon.png │ ├── algolia-black-logo.svg │ ├── algolia-white-logo.svg │ └── logo.inline.svg ├── styles │ ├── container.css │ ├── remove-search-cancel-button.css │ ├── safe-paddings.css │ ├── scrollbar-hidden.css │ ├── global.css │ ├── main.css │ ├── content.css │ ├── code-highlighting.css │ ├── fonts.css │ └── search.css ├── utils │ ├── get-path-without-prefix.js │ ├── scroll-to-section.js │ ├── get-value-for-parameter.js │ ├── generate-responses.jsx │ ├── get-all-data.js │ └── generate-snippets.jsx ├── icons │ ├── arrow.inline.svg │ ├── plus.inline.svg │ ├── copy.inline.svg │ └── github.inline.svg ├── config │ └── index.js ├── constants │ ├── menus.js │ └── links.js ├── templates │ ├── 404.jsx │ └── main.jsx └── html.jsx ├── .markdownlint.json ├── .prettierignore ├── jsconfig.json ├── static ├── images │ └── social-preview.jpg └── fonts │ ├── brother-1816 │ ├── brother-1816-book.woff2 │ ├── brother-1816-medium.woff2 │ └── brother-1816-regular.woff2 │ └── ibm-plex-mono │ ├── ibm-plex-mono-regular.woff2 │ └── ibm-plex-mono-semibold.woff2 ├── .lintstagedrc ├── netlify.toml ├── postcss.config.js ├── content ├── pages │ └── api-reference │ │ ├── overview │ │ └── overview.md │ │ ├── api-authorization │ │ └── api-authorization.md │ │ └── client-libraries │ │ └── client-libraries.md └── code-examples │ ├── changes │ ├── get.md │ ├── getCount.md │ ├── applyOne.md │ └── applyMany.md │ ├── notification-groups │ ├── get.md │ ├── delete.md │ ├── get-one.md │ ├── create.md │ └── update.md │ ├── subscribers │ ├── list.md │ ├── get.md │ ├── delete.md │ ├── get-preference.md │ ├── get-unseen-count.md │ ├── mark-message-seen.md │ ├── mark-message-action-seen.md │ ├── get-notifications-feed.md │ ├── identity.md │ ├── update.md │ ├── set-credentials.md │ └── update-preference.md │ ├── integrations │ ├── getAll.md │ ├── getActive.md │ ├── delete.md │ ├── getWebhookProviderStatus.md │ ├── update.md │ └── create.md │ ├── notification-templates │ ├── delete.md │ ├── get-all.md │ ├── get-one.md │ ├── update-status.md │ ├── create.md │ └── update.md │ ├── environments │ ├── get-all-environments.md │ ├── get-api-keys.md │ ├── get-current-environment.md │ ├── regenerate-api-keys.md │ ├── update-widget.md │ ├── create-environment.md │ └── update-environment.md │ ├── feeds │ ├── get.md │ ├── delete.md │ └── create.md │ └── events │ ├── cancel.md │ ├── broadcast.md │ └── trigger.md ├── .prettierrc ├── .commitlintrc.json ├── .github └── workflows │ └── deploy.yml ├── gatsby-browser.js ├── .gitignore ├── LICENSE ├── gatsby-node.js ├── tailwind.config.js ├── .eslintrc.js ├── package.json ├── gatsby-config.js ├── gatsby-ssr.js └── README.md /src/hooks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/pages/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/shared/code/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './code'; 2 | -------------------------------------------------------------------------------- /src/components/shared/link/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './link'; 2 | -------------------------------------------------------------------------------- /src/components/shared/seo/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './seo'; 2 | -------------------------------------------------------------------------------- /src/components/shared/burger/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './burger'; 2 | -------------------------------------------------------------------------------- /src/components/shared/footer/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './footer'; 2 | -------------------------------------------------------------------------------- /src/components/shared/header/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './header'; 2 | -------------------------------------------------------------------------------- /src/components/shared/layout/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './layout'; 2 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "line-length": false, 3 | "ol-prefix": false 4 | } 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .cache 2 | package.json 3 | package-lock.json 4 | public 5 | content 6 | -------------------------------------------------------------------------------- /src/components/pages/main/sections/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './sections'; 2 | -------------------------------------------------------------------------------- /src/components/shared/code-snippets/code/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "./code"; 2 | -------------------------------------------------------------------------------- /src/components/shared/mobile-menu/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './mobile-menu'; 2 | -------------------------------------------------------------------------------- /src/components/shared/navigation/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "./navigation"; 2 | -------------------------------------------------------------------------------- /src/components/shared/code-snippets/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './code-snippets'; 2 | -------------------------------------------------------------------------------- /src/components/pages/api-reference/overview/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './overview'; 2 | -------------------------------------------------------------------------------- /src/components/shared/section-wrapper/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './section-wrapper'; 2 | -------------------------------------------------------------------------------- /src/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/novuhq/api-docs/HEAD/src/images/favicon.png -------------------------------------------------------------------------------- /src/components/shared/header/theme-switcher/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "./theme-switcher"; 2 | -------------------------------------------------------------------------------- /src/components/shared/parametr-with-type/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './parametr-with-type'; 2 | -------------------------------------------------------------------------------- /src/components/shared/method-with-endpoint/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './method-with-endpoint'; 2 | -------------------------------------------------------------------------------- /src/components/shared/parametr-with-type/sub-parametr/index.js: -------------------------------------------------------------------------------- 1 | export { default } from "./sub-parametr"; 2 | -------------------------------------------------------------------------------- /src/components/shared/section-with-content/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './section-with-content'; 2 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "src", 4 | "jsx": "react" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/components/shared/response-code/index.js: -------------------------------------------------------------------------------- 1 | export { ResponseCode, RESPONSE_CODE_THEMES } from './response-code'; 2 | -------------------------------------------------------------------------------- /static/images/social-preview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/novuhq/api-docs/HEAD/static/images/social-preview.jpg -------------------------------------------------------------------------------- /src/components/shared/parametr-with-type/sub-parametr/sub-sub-parametr/index.js: -------------------------------------------------------------------------------- 1 | export { default } from './sub-sub-parametr'; 2 | -------------------------------------------------------------------------------- /static/fonts/brother-1816/brother-1816-book.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/novuhq/api-docs/HEAD/static/fonts/brother-1816/brother-1816-book.woff2 -------------------------------------------------------------------------------- /static/fonts/brother-1816/brother-1816-medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/novuhq/api-docs/HEAD/static/fonts/brother-1816/brother-1816-medium.woff2 -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{js,jsx,html,css,md}": "prettier --write", 3 | "*.{js,jsx}": "eslint --cache --fix", 4 | "*.md": "markdownlint --fix" 5 | } 6 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [[headers]] 2 | for = "/*" 3 | [headers.values] 4 | X-Robots-Tag = "noindex, nofollow" 5 | Access-Control-Allow-Origin = "*" 6 | 7 | -------------------------------------------------------------------------------- /static/fonts/brother-1816/brother-1816-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/novuhq/api-docs/HEAD/static/fonts/brother-1816/brother-1816-regular.woff2 -------------------------------------------------------------------------------- /src/styles/container.css: -------------------------------------------------------------------------------- 1 | @layer components { 2 | .container { 3 | @apply mx-auto max-w-[1472px] xl:px-10 lg:max-w-none md:px-7 sm:px-4; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /static/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/novuhq/api-docs/HEAD/static/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff2 -------------------------------------------------------------------------------- /static/fonts/ibm-plex-mono/ibm-plex-mono-semibold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/novuhq/api-docs/HEAD/static/fonts/ibm-plex-mono/ibm-plex-mono-semibold.woff2 -------------------------------------------------------------------------------- /src/utils/get-path-without-prefix.js: -------------------------------------------------------------------------------- 1 | const getPathWithoutPrefix = (path) => path.replace(/^\/api\//, '').replace('/', ''); 2 | 3 | export default getPathWithoutPrefix; 4 | -------------------------------------------------------------------------------- /src/icons/arrow.inline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/styles/remove-search-cancel-button.css: -------------------------------------------------------------------------------- 1 | @layer utilities { 2 | .remove-search-cancel-button { 3 | &::-webkit-search-cancel-button { 4 | appearance: none; 5 | -webkit-appearance: none; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/styles/safe-paddings.css: -------------------------------------------------------------------------------- 1 | @layer base { 2 | .safe-paddings { 3 | @apply px-safe; 4 | 5 | header& { 6 | @apply pt-safe; 7 | } 8 | 9 | footer& { 10 | @apply pb-safe; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/styles/scrollbar-hidden.css: -------------------------------------------------------------------------------- 1 | @layer utilities { 2 | .scrollbar-hidden { 3 | -ms-overflow-style: none; 4 | scrollbar-width: none; 5 | 6 | &::-webkit-scrollbar { 7 | display: none; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/config/index.js: -------------------------------------------------------------------------------- 1 | const URL = process.env.NOVU_API_URL || 'https://api.novu.co'; 2 | 3 | const getUrlForFrontend = () => process.env.GATSBY_NOVU_API_URL || 'https://api.novu.co'; 4 | 5 | module.exports = { 6 | URL, 7 | getUrlForFrontend, 8 | }; 9 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable global-require, import/no-extraneous-dependencies */ 2 | module.exports = { 3 | plugins: [ 4 | require('postcss-import'), 5 | require('tailwindcss/nesting'), 6 | require('tailwindcss'), 7 | require('autoprefixer'), 8 | ], 9 | }; 10 | -------------------------------------------------------------------------------- /content/pages/api-reference/overview/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Overview 3 | slug: overview 4 | baseUrl: https://api.novu.co/v1 5 | sort: 1 6 | --- 7 | 8 | The API enables you to access the entire Novu platform using a RESTful API. This API provides a programmatic access to the platform's data and functionality. -------------------------------------------------------------------------------- /content/code-examples/changes/get.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get all changes 3 | id: get-/v1/changes 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.changes.get(); 13 | ``` 14 | -------------------------------------------------------------------------------- /src/icons/plus.inline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /content/code-examples/notification-groups/get.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu gets all the notification groups 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationGroups.get(); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/list.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get subscribers 3 | id: get-/v1/subscribers 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.list(0); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/integrations/getAll.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Get all connected integrations 3 | id: get-/v1/integrations 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | export const novu = new Novu(''); 10 | await novu.integrations.getAll(); 11 | ``` -------------------------------------------------------------------------------- /content/code-examples/notification-groups/delete.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu delete notification group 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationGroups.delete("groupId"); 12 | ``` 13 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": true, 7 | "quoteProps": "as-needed", 8 | "jsxSingleQuote": false, 9 | "trailingComma": "es5", 10 | "bracketSpacing": true, 11 | "jsxBracketSameLine": false, 12 | "arrowParens": "always", 13 | "endOfLine": "lf" 14 | } 15 | -------------------------------------------------------------------------------- /content/code-examples/changes/getCount.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get the count of all changes 3 | id: get-/v1/changes/count 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.changes.getCount(); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/integrations/getActive.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Get all active integrations 3 | id: get-/v1/integrations/active 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | export const novu = new Novu(''); 10 | await novu.integrations.getActive(); 11 | ``` -------------------------------------------------------------------------------- /content/code-examples/notification-groups/get-one.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get single notification group 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationGroups.getOne("groupId"); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/code-examples/changes/applyOne.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu apply one change 3 | id: post-/v1/changes/:changeId/apply 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.changes.applyOne(changeId); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/notification-templates/delete.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu delete notification template 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationTemplates.delete("templateId"); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/code-examples/notification-templates/get-all.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu gets all the notification-templates 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationTemplates.getAll(1, 10); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/get.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get subscriber 3 | id: get-/v1/subscribers/:subscriberId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.get(user.id); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/notification-templates/get-one.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get single notification template 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationTemplates.getOne("templateId"); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/code-examples/changes/applyMany.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu apply several changes 3 | id: post-/v1/changes/bulk/apply 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.changes.applyMany({[changeIds]}); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/environments/get-all-environments.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get all environments 3 | id: get-/v1/environments/ 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.environments.getAll(); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/environments/get-api-keys.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get all api keys 3 | id: get-/v1/environments/api-keys 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.environments.getApiKeys(); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/integrations/delete.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Delete an integration 3 | id: delete-/v1/integrations/:integrationId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | export const novu = new Novu(''); 10 | await novu.integrations.delete('integrationId'); 11 | ``` -------------------------------------------------------------------------------- /content/code-examples/notification-groups/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu create notification group 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationGroups.create({ 12 | name: "name" 13 | }); 14 | ``` 15 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/delete.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu delete subscriber 3 | id: delete-/v1/subscribers/:subscriberId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.delete(user.id); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/environments/get-current-environment.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get current environment 3 | id: get-/v1/environments/me 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.environments.getCurrent(); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/notification-groups/update.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu update notification group 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationGroups.update("groupId", { 12 | name: "name" 13 | }) 14 | ``` 15 | -------------------------------------------------------------------------------- /content/pages/api-reference/api-authorization/api-authorization.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: API Authorization 3 | slug: api-authorization 4 | sort: 2 5 | --- 6 | 7 | Novu API is authorized by passing the ApiKey (generated from the [settings page](https://web.novu.co/settings)) with each request. 8 | 9 | ### Header Format 10 | ``` 11 | 'Authorization': 'ApiKey REPLACE_WITH_API_KEY' 12 | ``` 13 | -------------------------------------------------------------------------------- /content/code-examples/notification-templates/update-status.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu update status of notification template 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationTemplates.updateStatus('templateId', true); 12 | ``` 13 | -------------------------------------------------------------------------------- /content/code-examples/environments/regenerate-api-keys.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu regenerate api keys 3 | id: post-/v1/environments/api-keys/regenerate 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.environments.regenerateApiKeys(); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/get-preference.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get subscriber preferences 3 | id: get-/v1/subscribers/:subscriberId/preferences 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.getPreference(user.id); 13 | ``` 14 | -------------------------------------------------------------------------------- /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@commitlint/config-conventional"], 3 | "rules": { 4 | "scope-enum": [ 5 | 2, 6 | "always", 7 | [ 8 | "components", 9 | "constants", 10 | "hooks", 11 | "icons", 12 | "images", 13 | "pages", 14 | "styles", 15 | "templates", 16 | "utils" 17 | ] 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | 3 | on: 4 | # Allows you to run this workflow manually from the Actions tab 5 | workflow_dispatch: 6 | 7 | jobs: 8 | deployment: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Deploy Stage 12 | uses: fjogeleit/http-request-action@v1 13 | with: 14 | url: ${{ secrets.BUILD_WEBHOOK }} 15 | method: 'POST' 16 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/get-unseen-count.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get unseen count 3 | id: get-/v1/subscribers/:subscriberId/notifications/unseen 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.getUnseenCount(user.id, false); 13 | ``` 14 | -------------------------------------------------------------------------------- /src/styles/global.css: -------------------------------------------------------------------------------- 1 | @layer base { 2 | body { 3 | @apply min-w-[320px] bg-gray-12 font-sans text-base leading-normal text-black antialiased dark:bg-black dark:text-white; 4 | -webkit-tap-highlight-color: transparent; 5 | } 6 | } 7 | 8 | .break-word { 9 | word-break: break-word; 10 | } 11 | 12 | .ais-Highlight-highlighted { 13 | @apply bg-transparent text-primary-2 dark:text-primary-1; 14 | } 15 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/mark-message-seen.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu mark message seen 3 | id: post-/v1/subscribers/:subscriberId/messages/:messageId/seen 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.markMessageSeen(user.id, messageId); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/integrations/getWebhookProviderStatus.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Get the webhook provider status of the integration provider 3 | id: get-/v1/integrations/webhook/provider/:providerId/status 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | export const novu = new Novu(''); 10 | await novu.integrations.getWebhookProviderStatus(); 11 | ``` -------------------------------------------------------------------------------- /content/code-examples/integrations/update.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Update an integration 3 | id: put-/v1/integrations/:integrationId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | export const novu = new Novu(''); 10 | await novu.integrations.update('integrationId', { 11 | active: true, 12 | credentials: credentials, 13 | check: true 14 | }); 15 | ``` -------------------------------------------------------------------------------- /content/code-examples/subscribers/mark-message-action-seen.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu mark message action seen 3 | id: post-/v1/subscribers/:subscriberId/messages/:messageId/actions/:type 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.markMessageActionSeen(user.id, messageId, type); 13 | ``` 14 | -------------------------------------------------------------------------------- /content/code-examples/integrations/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu create an integration 3 | id: post-/v1/integrations 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | export const novu = new Novu(''); 10 | await novu.integrations.create('providerId', { 11 | credentials: credentials, 12 | active: true, 13 | channel: "channel", 14 | check: true 15 | }); 16 | ``` -------------------------------------------------------------------------------- /content/code-examples/environments/update-widget.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu update widget settings 3 | id: put-/v1/environments/widget/settings 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | const payload: IWidgetUpdatePayload = { 13 | notificationCenterEncryption: true 14 | } 15 | 16 | await novu.environments.updateWidget(payload); 17 | ``` 18 | -------------------------------------------------------------------------------- /src/components/shared/header/theme-switcher/images/moon.inline.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content/code-examples/feeds/get.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get feeds 3 | id: get-/v1/feeds/ 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.feeds.get(); 13 | ``` 14 | ```bash label=cURL 15 | curl -X GET \ 16 | -H "Content-Type: application/json" \ 17 | -H "Authorization: ApiKey REPLACE_WITH_API_KEY" \ 18 | https://api.novu.co/v1/feeds 19 | ``` -------------------------------------------------------------------------------- /content/code-examples/subscribers/get-notifications-feed.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get notifications feed 3 | id: get-/v1/subscribers/:subscriberId/notifications/feed 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.getNotificationsFeed(user.id, { 13 | page: 0, 14 | seen: false, 15 | feedIdentifier 16 | }); 17 | ``` 18 | -------------------------------------------------------------------------------- /content/code-examples/environments/create-environment.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu create one environment 3 | id: post-/v1/environments/ 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | const payload: IEnvironmentCreatePayload = { 13 | name: 'test', 14 | parentId: 'as20dfbjsfi3ssdk39dh' 15 | } 16 | 17 | await novu.environments.create(payload); 18 | ``` 19 | -------------------------------------------------------------------------------- /src/utils/scroll-to-section.js: -------------------------------------------------------------------------------- 1 | const scrollToSection = (id) => { 2 | const section = id ? document.getElementById(id) : null; 3 | const headerOffset = 60; 4 | 5 | if (section) { 6 | const offsetPosition = section.offsetTop - headerOffset; 7 | 8 | window.scrollTo({ 9 | top: offsetPosition, 10 | }); 11 | } 12 | 13 | window.history.replaceState( 14 | { 15 | id, 16 | }, 17 | '', 18 | `/api/${id}/` 19 | ); 20 | }; 21 | 22 | export default scrollToSection; 23 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/identity.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu create subscriber 3 | id: post-/v1/subscribers 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.identify(user.id, { 13 | email: user.email, 14 | firstName: user.firstName, 15 | lastName: user.lastName, 16 | phone: user.phone, 17 | avatar: user.profile_avatar 18 | }); 19 | ``` 20 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/update.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu update subscriber 3 | id: put-/v1/subscribers/:subscriberId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.identify(user.id, { 13 | email: user.email, 14 | firstName: user.firstName, 15 | lastName: user.lastName, 16 | phone: user.phone, 17 | avatar: user.profile_avatar 18 | }); 19 | ``` 20 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/set-credentials.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu subscriber set credentials 3 | id: put-/v1/subscribers/:subscriberId/credentials 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.setCredentials(user.id, providerId, { 13 | webhookUrl: 'http://webhook.url/novu'; 14 | notificationIdentifiers: [user.notificationIdentifier] 15 | }); 16 | ``` 17 | -------------------------------------------------------------------------------- /src/styles/main.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | @import 'tailwindcss/components'; 3 | @import 'tailwindcss/utilities'; 4 | 5 | /* Base */ 6 | @import './fonts.css'; 7 | @import './global.css'; 8 | @import './code-highlighting.css'; 9 | @import '@docsearch/css'; 10 | @import './search.css'; 11 | 12 | /* Components */ 13 | @import './container.css'; 14 | @import './content.css'; 15 | 16 | /* Utilities */ 17 | @import './safe-paddings.css'; 18 | @import './scrollbar-hidden.css'; 19 | @import './remove-search-cancel-button.css'; 20 | -------------------------------------------------------------------------------- /content/code-examples/subscribers/update-preference.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu get subscriber preferences 3 | id: post-/v1/subscribers/:subscriberId/preferences/:templateId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.subscribers.updatePreference(user.id, templateId, { 13 | channel: { 14 | type: 'fcm', 15 | enabled: true, 16 | }, 17 | enabled: true, 18 | }); 19 | ``` 20 | -------------------------------------------------------------------------------- /content/code-examples/feeds/delete.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Delete feed template 3 | id: delete-/v1/feeds/delete/:feedId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.feeds.delete('feedId'); 13 | ``` 14 | 15 | ```bash label=cURL 16 | curl -X DELETE \ 17 | -H "Content-Type: application/json" \ 18 | -H "Authorization: ApiKey REPLACE_WITH_API_KEY" \ 19 | https://api.novu.co/v1/feeds/delete/feedId 20 | ``` 21 | -------------------------------------------------------------------------------- /content/code-examples/events/cancel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Cancel event 3 | id: delete-/v1/events/trigger/:transactionId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.events.cancel('transactionId'); 13 | ``` 14 | 15 | ```bash label=cURL 16 | curl -X DELETE \ 17 | -H "Content-Type: application/json" \ 18 | -H "Authorization: ApiKey REPLACE_WITH_API_KEY" \ 19 | https://api.novu.co/v1/events/trigger/transactionId 20 | ``` 21 | -------------------------------------------------------------------------------- /content/code-examples/feeds/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu create feeds template 3 | id: post-/v1/feeds/:name 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.feeds.create({ 13 | name: "name" 14 | }); 15 | ``` 16 | ```bash label=cURL 17 | curl -X POST \ 18 | -H "Authorization: ApiKey REPLACE_WITH_API_KEY" \ 19 | -H "Content-Type: application/json" \ 20 | -d '{ 21 | "name": "name" 22 | }' \ 23 | https://api.novu.co/v1/feeds 24 | ``` -------------------------------------------------------------------------------- /content/pages/api-reference/client-libraries/client-libraries.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Client libraries 3 | slug: client-libraries 4 | sort: 3 5 | --- 6 | 7 | Novu offers native SDK in several popular programming languages: 8 | 9 | - [Go](https://github.com/novuhq/go-novu) 10 | - [Node.js](https://github.com/novuhq/novu/tree/main/packages/node) 11 | - [PHP](https://github.com/novuhq/novu-php) 12 | - [Ruby](https://github.com/novuhq/novu-ruby) 13 | - [Kotlin](https://github.com/novuhq/novu-kotlin) 14 | - [Python](https://github.com/novuhq/novu-python) 15 | - [.Net](https://github.com/novuhq/novu-dotnet) 16 | -------------------------------------------------------------------------------- /content/code-examples/environments/update-environment.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu update one environment 3 | id: put-/v1/environments/:environmentId 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | const payload: IEnvironmentUpdatePayload = { 13 | name: 'new environment'; 14 | identifier: 'test env'; 15 | parentId: '109ufdsnfkhk890hhjsdf'; 16 | } 17 | 18 | const envId = '12390dsfkhjk9dfd' 19 | 20 | await novu.environments.updateOne(envId, payload); 21 | ``` 22 | -------------------------------------------------------------------------------- /content/code-examples/notification-templates/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu create notification template 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationTemplates.create({ 12 | name: "name", 13 | notificationGroupId: "notificationGroupId", 14 | tags: ["tags"], 15 | description: "description", 16 | steps: ["steps"], 17 | active: true, 18 | draft: true, 19 | critical: true, 20 | preferenceSettings: preferenceSettings 21 | }); 22 | ``` 23 | -------------------------------------------------------------------------------- /gatsby-browser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Implement Gatsby's Browser APIs in this file. 3 | * 4 | * See: https://www.gatsbyjs.org/docs/browser-apis/ 5 | */ 6 | 7 | import getPathWithoutPrefix from 'utils/get-path-without-prefix'; 8 | import scrollToSection from 'utils/scroll-to-section'; 9 | import './src/styles/main.css'; 10 | 11 | export const onRouteUpdate = () => { 12 | if (process.env.NODE_ENV === 'production' && typeof window.plausible !== 'undefined') { 13 | window.plausible('pageview'); 14 | } 15 | }; 16 | 17 | export const onClientEntry = () => { 18 | const id = getPathWithoutPrefix(window.location.pathname); 19 | scrollToSection(id); 20 | }; 21 | -------------------------------------------------------------------------------- /content/code-examples/notification-templates/update.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu update notification template 3 | type: snippets 4 | --- 5 | 6 | ```javascript label=Node.js 7 | import { Novu } from '@novu/node'; 8 | 9 | export const novu = new Novu(''); 10 | 11 | await novu.notificationTemplates.update("templateId", { 12 | name: "name", 13 | tags: ["tags"], 14 | description: "description", 15 | identifier: "identifier", 16 | steps: ["steps"], 17 | notificationGroupId: "notificationGroupId", 18 | active: true, 19 | critical: true, 20 | preferenceSettings: preferenceSettings 21 | }) 22 | ``` 23 | -------------------------------------------------------------------------------- /src/icons/copy.inline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/styles/content.css: -------------------------------------------------------------------------------- 1 | @layer components { 2 | .content { 3 | ul, 4 | ol, 5 | p { 6 | @apply my-5 sm:my-4; 7 | } 8 | 9 | ul, 10 | ol { 11 | @apply space-y-2 pl-11 md:space-y-2.5 md:pl-8; 12 | } 13 | 14 | ul { 15 | > li { 16 | @apply relative; 17 | 18 | &::before { 19 | @apply absolute top-2.5 -left-2.5 h-1.5 w-1.5 -translate-x-full rounded-full bg-primary-2 content-[''] dark:bg-primary-1; 20 | } 21 | } 22 | } 23 | 24 | a { 25 | @apply relative font-normal text-primary-2 decoration-transparent underline-offset-[3px] transition-all duration-200 hover:underline hover:decoration-primary-2 dark:text-primary-1 dark:hover:text-white dark:hover:no-underline; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/components/shared/section-with-content/section-with-content.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React from 'react'; 3 | 4 | import SectionWrapper from 'components/shared/section-wrapper'; 5 | 6 | const ClientLibraries = ({ id, title, content }) => ( 7 | 8 | 9 | {title} 10 | 14 | 15 | 16 | ); 17 | 18 | ClientLibraries.propTypes = { 19 | id: PropTypes.string.isRequired, 20 | title: PropTypes.string.isRequired, 21 | content: PropTypes.string.isRequired, 22 | }; 23 | 24 | export default ClientLibraries; 25 | -------------------------------------------------------------------------------- /src/utils/get-value-for-parameter.js: -------------------------------------------------------------------------------- 1 | const getValueForParameter = (param, type, name) => { 2 | switch (type) { 3 | case 'string': 4 | if (param.example) { 5 | return `"${param.example}"`; 6 | } 7 | return `"${name}"`; 8 | case 'number': 9 | return 0; 10 | case 'boolean': 11 | if (param.example) { 12 | return param.example; 13 | } 14 | return true; 15 | case 'array': 16 | if (param.example) { 17 | return `[${JSON.stringify(param.example)}]`; 18 | } 19 | 20 | return `["${name}"]`; 21 | case 'object': 22 | if (param.example) { 23 | return JSON.stringify(param.example); 24 | } 25 | return `${name}`; 26 | default: 27 | return `"${name}"`; 28 | } 29 | }; 30 | 31 | export default getValueForParameter; 32 | -------------------------------------------------------------------------------- /src/constants/menus.js: -------------------------------------------------------------------------------- 1 | import LINKS from 'constants/links.js'; 2 | 3 | const MENUS = { 4 | footer: [ 5 | [ 6 | { text: 'Blog', ...LINKS.blog }, 7 | { text: 'Contributors', ...LINKS.contributors }, 8 | { text: 'Podcast', ...LINKS.podcast }, 9 | ], 10 | [ 11 | { text: 'Documentation', ...LINKS.documentation }, 12 | { text: 'Providers', ...LINKS.providers }, 13 | { text: 'Handbook', ...LINKS.handbook }, 14 | { text: 'Contact Us', ...LINKS.discord }, 15 | ], 16 | [ 17 | { text: 'Discord', ...LINKS.discord }, 18 | { text: 'Twitter', ...LINKS.twitter }, 19 | { text: 'GitHub', ...LINKS.github }, 20 | ], 21 | [ 22 | { text: 'Terms of Use', ...LINKS.termsOfUse }, 23 | { text: 'Privacy Policy', ...LINKS.privacyPolicy }, 24 | ], 25 | ], 26 | }; 27 | 28 | export default MENUS; 29 | -------------------------------------------------------------------------------- /content/code-examples/events/broadcast.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu broadcast event 3 | id: post-/v1/events/trigger/broadcast 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.broadcast('', 13 | { 14 | payload: { 15 | customVariables: 'Hello' 16 | }, 17 | transactionId: 'transactionId', 18 | } 19 | ); 20 | ``` 21 | 22 | ```bash label=cURL 23 | curl -X POST \ 24 | -H "Content-Type: application/json" \ 25 | -H "Authorization: ApiKey REPLACE_WITH_API_KEY" \ 26 | -d '{ 27 | "name": "Novu", 28 | "payload": { 29 | "test": "test" 30 | }, 31 | "transactionId": "transactionId" 32 | }' \ 33 | https://api.novu.co/v1/events/trigger/brodcast 34 | ``` 35 | -------------------------------------------------------------------------------- /src/components/shared/section-wrapper/section-wrapper.jsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import PropTypes from 'prop-types'; 3 | import React from 'react'; 4 | 5 | const SectionWrapper = ({ className, id, children }) => ( 6 | 13 | 14 | {children} 15 | 16 | 17 | ); 18 | 19 | SectionWrapper.propTypes = { 20 | className: PropTypes.string, 21 | id: PropTypes.string.isRequired, 22 | children: PropTypes.node.isRequired, 23 | }; 24 | 25 | SectionWrapper.defaultProps = { 26 | className: null, 27 | }; 28 | 29 | export default SectionWrapper; 30 | -------------------------------------------------------------------------------- /src/templates/404.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/prop-types */ 2 | import React from 'react'; 3 | 4 | import Layout from 'components/shared/layout'; 5 | import Link from 'components/shared/link'; 6 | 7 | const NotFoundPage = ({ pageContext, location }) => ( 8 | 9 | 10 | 11 | 404 error 12 | Page not found 13 | Sorry, we couldn’t find the page you’re looking for. 14 | 15 | 16 | Go back home 17 | 18 | 19 | 20 | 21 | 22 | ); 23 | 24 | export default NotFoundPage; 25 | -------------------------------------------------------------------------------- /src/components/pages/api-reference/overview/overview.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React from 'react'; 3 | 4 | import Code from 'components/shared/code'; 5 | import SectionWrapper from 'components/shared/section-wrapper'; 6 | 7 | const Overview = ({ id, title, baseUrl, content }) => ( 8 | 9 | 10 | {title} 11 | 15 | 16 | 17 | 18 | 19 | 20 | ); 21 | 22 | Overview.propTypes = { 23 | id: PropTypes.string.isRequired, 24 | title: PropTypes.string.isRequired, 25 | baseUrl: PropTypes.string.isRequired, 26 | content: PropTypes.string.isRequired, 27 | }; 28 | 29 | export default Overview; 30 | -------------------------------------------------------------------------------- /content/code-examples/events/trigger.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Novu Trigger event 3 | id: post-/v1/events/trigger 4 | type: snippets 5 | --- 6 | 7 | ```javascript label=Node.js 8 | import { Novu } from '@novu/node'; 9 | 10 | export const novu = new Novu(''); 11 | 12 | await novu.trigger('', 13 | { 14 | to: { 15 | subscriberId: '', 16 | email: 'email@email.com', 17 | firstName: 'John', 18 | lastName: 'Doe', 19 | }, 20 | payload: { 21 | customVariables: 'Hello' 22 | }, 23 | transactionId: 'transactionId', 24 | } 25 | ); 26 | ``` 27 | 28 | ```bash label=cURL 29 | curl -X POST \ 30 | -H "Content-Type: application/json" \ 31 | -H "Authorization: ApiKey REPLACE_WITH_API_KEY" \ 32 | -d '{ 33 | "name": "Novu", 34 | "payload": { 35 | "test": "test" 36 | }, 37 | "to": "to", 38 | "transactionId": "transactionId" 39 | }' \ 40 | https://api.novu.co/v1/events/trigger 41 | ``` 42 | -------------------------------------------------------------------------------- /src/utils/generate-responses.jsx: -------------------------------------------------------------------------------- 1 | import getValueForParameter from './get-value-for-parameter'; 2 | 3 | const generateResponses = (responses) => { 4 | const items = responses 5 | .map((response) => { 6 | if (!response.schema) { 7 | return null; 8 | } 9 | 10 | const { 11 | schema: { properties, items }, 12 | } = response; 13 | 14 | const props = properties || items?.properties; 15 | 16 | if (props) { 17 | return { 18 | label: `${response.status}`, 19 | language: 'json', 20 | content: `{ 21 | ${Object.keys(props) 22 | .map((propertyName) => { 23 | const { type } = props[propertyName]; 24 | 25 | return `${propertyName}: ${getValueForParameter(props[propertyName], type, propertyName)}`; 26 | }) 27 | .join(',\n ')} 28 | }`, 29 | }; 30 | } 31 | 32 | return null; 33 | }) 34 | .filter((item) => !!item); 35 | 36 | return items; 37 | }; 38 | 39 | export default generateResponses; 40 | -------------------------------------------------------------------------------- /src/styles/code-highlighting.css: -------------------------------------------------------------------------------- 1 | code { 2 | .token.atrule, 3 | .token.attr-value, 4 | .token.keyword { 5 | @apply text-[#E51A5E] dark:text-[#FF4C88]; 6 | } 7 | 8 | .token.function, 9 | .token.property { 10 | @apply text-[#E57300] dark:text-[#FFB366]; 11 | } 12 | 13 | .token.operator, 14 | .token.class-name, 15 | .token.punctuation { 16 | @apply text-black dark:text-white; 17 | } 18 | 19 | .token.tag, 20 | .token.boolean, 21 | .token.number, 22 | .token.deleted, 23 | .token.null { 24 | @apply text-[#AA00FF] dark:text-secondary-1; 25 | } 26 | 27 | .token.selector, 28 | .token.attr-name, 29 | .token.string, 30 | .token.char, 31 | .token.builtin, 32 | .token.inserted { 33 | @apply text-[#22C358] dark:text-[#AAFF80]; 34 | } 35 | 36 | .token.comment, 37 | .token.prolog, 38 | .token.doctype, 39 | .token.cdata { 40 | @apply text-gray-8 dark:text-gray-6; 41 | } 42 | } 43 | 44 | .react-syntax-highlighter-line-number { 45 | @apply mr-4 w-5 !min-w-0 !pr-0 !text-center text-gray-8 dark:text-gray-6; 46 | } 47 | -------------------------------------------------------------------------------- /src/components/shared/header/theme-switcher/images/sun.inline.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/shared/link/link.jsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import { Link as GatsbyLink } from 'gatsby'; 3 | import PropTypes from 'prop-types'; 4 | import React from 'react'; 5 | 6 | const styles = { 7 | base: 'inline-block leading-none transition-colors duration-200', 8 | size: { 9 | base: 'text-base', 10 | sm: 'text-sm', 11 | }, 12 | }; 13 | 14 | const Link = ({ className: additionalClassName, size, to, children, ...props }) => { 15 | const className = clsx(styles.base, styles.size[size], additionalClassName); 16 | 17 | if (to.startsWith('/')) { 18 | return ( 19 | 20 | {children} 21 | 22 | ); 23 | } 24 | 25 | return ( 26 | 27 | {children} 28 | 29 | ); 30 | }; 31 | 32 | Link.propTypes = { 33 | className: PropTypes.string, 34 | to: PropTypes.string, 35 | size: PropTypes.oneOf(Object.keys(styles.size)), 36 | children: PropTypes.node.isRequired, 37 | }; 38 | 39 | Link.defaultProps = { 40 | className: null, 41 | to: null, 42 | size: null, 43 | }; 44 | 45 | export default Link; 46 | -------------------------------------------------------------------------------- /src/constants/links.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // Pages 3 | home: { 4 | to: '/', 5 | }, 6 | blog: { 7 | to: 'https://novu.co/blog', 8 | }, 9 | contributors: { 10 | to: 'https://novu.co/contributors', 11 | }, 12 | podcast: { 13 | to: 'https://novu.co/podcast', 14 | }, 15 | termsOfUse: { 16 | to: 'https://novu.co/terms', 17 | }, 18 | privacyPolicy: { 19 | to: 'https://novu.co/privacy', 20 | }, 21 | 22 | // Other pages 23 | documentation: { 24 | to: 'https://docs.novu.co/overview/introduction', 25 | target: '_blank', 26 | }, 27 | providers: { 28 | to: 'https://github.com/novuhq/novu/tree/main/providers', 29 | target: '_blank', 30 | }, 31 | handbook: { 32 | to: 'https://handbook.novu.co', 33 | target: '_blank', 34 | }, 35 | 36 | // Social 37 | discord: { 38 | to: 'https://discord.novu.co', 39 | target: '_blank', 40 | }, 41 | twitter: { 42 | to: 'https://twitter.com/novuhq', 43 | target: '_blank', 44 | }, 45 | github: { 46 | to: 'https://github.com/novuhq/novu', 47 | target: '_blank', 48 | }, 49 | pixelPoint: { 50 | to: 'https://pixelpoint.io/', 51 | target: '_blank', 52 | }, 53 | }; 54 | -------------------------------------------------------------------------------- /src/icons/github.inline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/components/shared/method-with-endpoint/method-with-endpoint.jsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import PropTypes from 'prop-types'; 3 | import React from 'react'; 4 | 5 | const styles = { 6 | put: 'bg-[rgba(255,225,77,0.15)] dark:text-secondary-2', 7 | patch: 'bg-[rgba(0,227,189,0.15)] dark:text-primary-1', 8 | get: 'bg-[rgba(0,227,189,0.15)] dark:text-primary-1', 9 | delete: 'bg-[rgba(227,0,189,0.15)] dark:text-secondary-1', 10 | post: 'bg-[rgba(0,213,255,0.15)] dark:text-secondary-5', 11 | }; 12 | 13 | const MethodWithEndpoint = ({ className, method, endpoint }) => ( 14 | 15 | 21 | {method} 22 | 23 | 24 | {endpoint} 25 | 26 | 27 | ); 28 | 29 | MethodWithEndpoint.propTypes = { 30 | className: PropTypes.string, 31 | method: PropTypes.oneOf(Object.keys(styles)).isRequired, 32 | endpoint: PropTypes.string.isRequired, 33 | }; 34 | 35 | MethodWithEndpoint.defaultProps = { 36 | className: null, 37 | }; 38 | 39 | export default MethodWithEndpoint; 40 | -------------------------------------------------------------------------------- /src/styles/fonts.css: -------------------------------------------------------------------------------- 1 | @layer base { 2 | @font-face { 3 | font-family: 'Brother-1816'; 4 | src: url('https://api-ref.novu.co/api/fonts/brother-1816/brother-1816-book.woff2') 5 | format('woff2'); 6 | font-weight: 350; 7 | font-style: normal; 8 | font-display: fallback; 9 | } 10 | 11 | @font-face { 12 | font-family: 'Brother-1816'; 13 | src: url('https://api-ref.novu.co/api/fonts/brother-1816/brother-1816-regular.woff2') 14 | format('woff2'); 15 | font-weight: normal; 16 | font-style: normal; 17 | font-display: fallback; 18 | } 19 | 20 | @font-face { 21 | font-family: 'Brother-1816'; 22 | src: url('https://api-ref.novu.co/api/fonts/brother-1816/brother-1816-medium.woff2') 23 | format('woff2'); 24 | font-weight: 500; 25 | font-style: normal; 26 | font-display: fallback; 27 | } 28 | 29 | @font-face { 30 | font-family: 'IBM Plex Mono'; 31 | src: url('https://api-ref.novu.co/api/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff2') 32 | format('woff2'); 33 | font-weight: 400; 34 | font-style: normal; 35 | font-display: fallback; 36 | } 37 | 38 | @font-face { 39 | font-family: 'IBM Plex Mono'; 40 | src: url('https://api-ref.novu.co/api/fonts/ibm-plex-mono/ibm-plex-mono-semibold.woff2') 41 | format('woff2'); 42 | font-weight: 600; 43 | font-style: normal; 44 | font-display: fallback; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/html.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/prop-types, jsx-a11y/html-has-lang */ 2 | import React from 'react'; 3 | 4 | const fontsBasePath = `${process.env.GATSBY_DEFAULT_SITE_URL}/api/fonts`; 5 | 6 | const fontsPaths = [ 7 | '/brother-1816/brother-1816-book.woff2', 8 | '/brother-1816/brother-1816-medium.woff2', 9 | '/ibm-plex-mono/ibm-plex-mono-regular.woff2', 10 | ]; 11 | 12 | const HTML = ({ 13 | htmlAttributes, 14 | headComponents, 15 | bodyAttributes, 16 | preBodyComponents, 17 | body, 18 | postBodyComponents, 19 | }) => ( 20 | 21 | 22 | 23 | 24 | 28 | {fontsPaths.map((fontPath, index) => ( 29 | 37 | ))} 38 | {headComponents} 39 | 40 | 41 | {preBodyComponents} 42 | 43 | {postBodyComponents} 44 | 45 | 46 | ); 47 | 48 | export default HTML; 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Optional eslint cache 57 | .stylelintcache 58 | 59 | # Optional REPL history 60 | .node_repl_history 61 | 62 | # Output of 'npm pack' 63 | *.tgz 64 | 65 | # dotenv environment variable files 66 | .env* 67 | !.env.example 68 | 69 | # gatsby files 70 | .cache/ 71 | public 72 | 73 | # Mac files 74 | .DS_Store 75 | 76 | # Yarn 77 | yarn-error.log 78 | .pnp/ 79 | .pnp.js 80 | yarn.lock 81 | # Yarn Integrity file 82 | .yarn-integrity 83 | 84 | .vscode/snipsnap.code-snippets 85 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, Novu 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /src/components/shared/seo/seo.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/prop-types */ 2 | import { useStaticQuery, graphql } from 'gatsby'; 3 | import React from 'react'; 4 | import { Helmet } from 'react-helmet'; 5 | 6 | const SEO = ({ title, description, slug }) => { 7 | const { 8 | site: { 9 | siteMetadata: { siteTitle, siteDescription, siteUrl, siteImage, siteLanguage }, 10 | }, 11 | } = useStaticQuery(graphql` 12 | query SEO { 13 | site { 14 | siteMetadata { 15 | siteTitle 16 | siteDescription 17 | siteUrl 18 | siteImage 19 | siteLanguage 20 | } 21 | } 22 | } 23 | `); 24 | 25 | const currentTitle = title ? `${title} - ${siteTitle}` : siteTitle; 26 | const currentDescription = description ?? siteDescription; 27 | const currentUrl = slug ? `https://docs.novu.co/api/${slug}/` : 'https://docs.novu.co/api/'; 28 | 29 | return ( 30 | 37 | {/* General */} 38 | 39 | {/* Open Graph */} 40 | 41 | 42 | 43 | 44 | 45 | {/* Twitter */} 46 | 47 | 48 | ); 49 | }; 50 | 51 | export default SEO; 52 | -------------------------------------------------------------------------------- /src/components/shared/header/theme-switcher/theme-switcher.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | import React, { useState, useEffect } from 'react'; 3 | 4 | import MoonIcon from './images/moon.inline.svg'; 5 | import SunIcon from './images/sun.inline.svg'; 6 | 7 | const ThemeSwitcher = ({ className }) => { 8 | const [selectedTheme, setSelectedTheme] = useState(); 9 | 10 | useEffect(() => { 11 | if (selectedTheme) { 12 | document.documentElement.setAttribute('data-theme', selectedTheme); 13 | } else { 14 | setSelectedTheme(document.documentElement.getAttribute('data-theme')); 15 | } 16 | }, [selectedTheme]); 17 | 18 | return ( 19 | 20 | setSelectedTheme('dark')} 26 | > 27 | 28 | 29 | setSelectedTheme('light')} 35 | > 36 | 37 | 38 | 39 | ); 40 | }; 41 | 42 | ThemeSwitcher.propTypes = { 43 | className: PropTypes.string, 44 | }; 45 | 46 | ThemeSwitcher.defaultProps = { 47 | className: null, 48 | }; 49 | 50 | export default ThemeSwitcher; 51 | -------------------------------------------------------------------------------- /src/images/algolia-black-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/images/algolia-white-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /gatsby-node.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const getAllData = require('./src/utils/get-all-data'); 4 | 5 | async function createPages({ graphql, actions, menu, pages }) { 6 | const { createPage } = actions; 7 | 8 | const { 9 | data: { customPages }, 10 | } = await graphql(` 11 | { 12 | customPages: allMarkdownRemark(filter: { fileAbsolutePath: { regex: "/pages/" } }) { 13 | nodes { 14 | id 15 | frontmatter { 16 | title 17 | slug 18 | } 19 | } 20 | } 21 | } 22 | `); 23 | 24 | pages.forEach((page) => { 25 | page.methods.forEach((method) => { 26 | createPage({ 27 | path: method.slug, 28 | component: path.resolve('./src/templates/main.jsx'), 29 | context: { 30 | id: method.id, 31 | menu, 32 | sections: pages, 33 | seo: { 34 | title: method.summary, 35 | description: method.description, 36 | slug: method.slug, 37 | }, 38 | }, 39 | }); 40 | }); 41 | }); 42 | 43 | customPages.nodes.forEach(({ frontmatter: { title, slug } }) => { 44 | createPage({ 45 | path: slug, 46 | component: path.resolve('./src/templates/main.jsx'), 47 | context: { 48 | id: slug, 49 | menu, 50 | sections: pages, 51 | seo: { 52 | title, 53 | slug, 54 | }, 55 | }, 56 | }); 57 | }); 58 | } 59 | 60 | async function createNotFoundPage({ actions, menu }) { 61 | const { createPage } = actions; 62 | 63 | createPage({ 64 | path: '/404', 65 | component: path.resolve('./src/templates/404.jsx'), 66 | context: { 67 | menu, 68 | }, 69 | }); 70 | } 71 | 72 | exports.createPages = async (args) => { 73 | const { pages, menu, methods } = await getAllData(); 74 | 75 | const params = { 76 | ...args, 77 | pages, 78 | menu, 79 | methods, 80 | }; 81 | 82 | await createPages(params); 83 | await createNotFoundPage(params); 84 | }; 85 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies, global-require */ 2 | const defaultTheme = require('tailwindcss/defaultTheme'); 3 | 4 | module.exports = { 5 | content: ['./src/**/*.{js,jsx,ts,tsx}'], 6 | darkMode: 'class', 7 | corePlugins: { 8 | container: false, 9 | }, 10 | theme: { 11 | fontFamily: { 12 | sans: ['Brother-1816', ...defaultTheme.fontFamily.sans], 13 | mono: ['IBM Plex Mono', ...defaultTheme.fontFamily.mono], 14 | }, 15 | fontSize: { 16 | xs: ['12px'], 17 | sm: ['14px'], 18 | base: ['16px'], 19 | lg: ['18px'], 20 | xl: ['20px'], 21 | '2xl': ['24px'], 22 | '3xl': ['28px'], 23 | '4xl': ['36px'], 24 | '5xl': ['40px'], 25 | '6xl': ['48px'], 26 | '7xl': ['56px'], 27 | '8xl': ['64px'], 28 | }, 29 | fontWeight: { 30 | book: 350, 31 | ...defaultTheme.fontWeight, 32 | }, 33 | colors: ({ colors }) => ({ 34 | inherit: colors.inherit, 35 | current: colors.current, 36 | transparent: colors.transparent, 37 | black: '#000000', 38 | white: '#ffffff', 39 | primary: { 40 | 1: '#00D5FF', 41 | 2: '#0055FF', 42 | }, 43 | secondary: { 44 | 1: '#FF33DE', 45 | 2: '#FFE14D', 46 | 3: '#00E585', 47 | 4: '#FF3377', 48 | 5: '#00E3BD', 49 | }, 50 | gray: { 51 | 1: '#0D0D0D', 52 | 2: '#1A1A1A', 53 | 3: '#262626', 54 | 4: '#333333', 55 | 5: '#4D4D4D', 56 | 6: '#666666', 57 | 7: '#808080', 58 | 8: '#999999', 59 | 9: '#CCCCCC', 60 | 10: '#E6E6E6', 61 | 11: '#F5F5F5', 62 | 12: '#FAFAFA', 63 | }, 64 | }), 65 | screens: { 66 | '2xl': { max: '1919px' }, 67 | xl: { max: '1535px' }, 68 | lg: { max: '1279px' }, 69 | md: { max: '1023px' }, 70 | sm: { max: '767px' }, 71 | xs: { max: '359px' }, 72 | }, 73 | extend: { 74 | lineHeight: { 75 | denser: '1.125', 76 | }, 77 | spacing: { 78 | 18: '4.5rem', 79 | 22: '5.75rem', 80 | 30: '7.5rem', 81 | 34: '8.5rem', 82 | }, 83 | }, 84 | }, 85 | plugins: [require('tailwindcss-safe-area')], 86 | }; 87 | -------------------------------------------------------------------------------- /src/components/shared/code-snippets/code/code.jsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import PropTypes from 'prop-types'; 3 | import React from 'react'; 4 | import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter'; 5 | import bash from 'react-syntax-highlighter/dist/esm/languages/prism/bash'; 6 | import cshtml from 'react-syntax-highlighter/dist/esm/languages/prism/cshtml'; 7 | import css from 'react-syntax-highlighter/dist/esm/languages/prism/css'; 8 | import go from 'react-syntax-highlighter/dist/esm/languages/prism/go'; 9 | import java from 'react-syntax-highlighter/dist/esm/languages/prism/java'; 10 | import javascript from 'react-syntax-highlighter/dist/esm/languages/prism/javascript'; 11 | import json from 'react-syntax-highlighter/dist/esm/languages/prism/json'; 12 | import jsx from 'react-syntax-highlighter/dist/esm/languages/prism/jsx'; 13 | import php from 'react-syntax-highlighter/dist/esm/languages/prism/php'; 14 | import python from 'react-syntax-highlighter/dist/esm/languages/prism/python'; 15 | import ruby from 'react-syntax-highlighter/dist/esm/languages/prism/ruby'; 16 | 17 | SyntaxHighlighter.registerLanguage('javascript', javascript); 18 | SyntaxHighlighter.registerLanguage('jsx', jsx); 19 | SyntaxHighlighter.registerLanguage('ruby', ruby); 20 | SyntaxHighlighter.registerLanguage('python', python); 21 | SyntaxHighlighter.registerLanguage('go', go); 22 | SyntaxHighlighter.registerLanguage('php', php); 23 | SyntaxHighlighter.registerLanguage('bash', bash); 24 | SyntaxHighlighter.registerLanguage('cshtml', cshtml); 25 | SyntaxHighlighter.registerLanguage('json', json); 26 | SyntaxHighlighter.registerLanguage('css', css); 27 | SyntaxHighlighter.registerLanguage('java', java); 28 | 29 | const Code = ({ language, content, isActive }) => ( 30 | 31 | 37 | {content} 38 | 39 | 40 | ); 41 | 42 | Code.propTypes = { 43 | language: PropTypes.oneOf([ 44 | 'javascript', 45 | 'jsx', 46 | 'ruby', 47 | 'python', 48 | 'go', 49 | 'php', 50 | 'bash', 51 | 'cshtml', 52 | 'json', 53 | 'css', 54 | 'java', 55 | ]).isRequired, 56 | content: PropTypes.string.isRequired, 57 | isActive: PropTypes.bool, 58 | }; 59 | 60 | Code.defaultProps = { 61 | isActive: false, 62 | }; 63 | 64 | export default Code; 65 | -------------------------------------------------------------------------------- /src/components/shared/header/header.jsx: -------------------------------------------------------------------------------- 1 | import { DocSearch } from '@docsearch/react'; 2 | import PropTypes from 'prop-types'; 3 | import React from 'react'; 4 | 5 | import Burger from 'components/shared/burger'; 6 | import Link from 'components/shared/link'; 7 | import LINKS from 'constants/links'; 8 | import Logo from 'images/logo.inline.svg'; 9 | 10 | import ThemeSwitcher from './theme-switcher'; 11 | 12 | const Header = ({ isMobileMenuOpen, onBurgerClick }) => ( 13 | 14 | 15 | 16 | 17 | 18 | 19 | Novu API Reference 20 | 21 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 41 | Documentation 42 | 43 | 44 | 45 | 49 | GitHub 50 | 51 | 52 | 53 | 57 | Community 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | ); 68 | 69 | Header.propTypes = { 70 | isMobileMenuOpen: PropTypes.bool, 71 | onBurgerClick: PropTypes.func.isRequired, 72 | }; 73 | 74 | Header.defaultProps = { 75 | isMobileMenuOpen: false, 76 | }; 77 | 78 | export default Header; 79 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es6: true, 5 | }, 6 | extends: ['airbnb', 'airbnb/hooks', 'airbnb/whitespace', 'prettier'], 7 | globals: { 8 | Atomics: 'readonly', 9 | SharedArrayBuffer: 'readonly', 10 | }, 11 | parserOptions: { 12 | ecmaFeatures: { 13 | jsx: true, 14 | }, 15 | ecmaVersion: 2020, 16 | sourceType: 'module', 17 | }, 18 | plugins: ['react'], 19 | rules: { 20 | // Removes "default" from "restrictedNamedExports", original rule setup — https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js#L65 21 | 'no-restricted-exports': ['error', { restrictedNamedExports: ['then'] }], 22 | 'no-unused-vars': 'error', 23 | 'no-shadow': 'off', 24 | 'no-undef': 'error', 25 | 'react/prop-types': 'error', 26 | 'react/no-array-index-key': 'off', 27 | 'react/jsx-props-no-spreading': 'off', 28 | 'react/no-danger': 'off', 29 | 'react/forbid-prop-types': 'off', 30 | // Changes values from "function-expression" to "arrow-function", original rule setup — https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb/rules/react.js#L528 31 | 'react/function-component-definition': [ 32 | 'error', 33 | { 34 | namedComponents: 'arrow-function', 35 | unnamedComponents: 'arrow-function', 36 | }, 37 | ], 38 | 'react/jsx-sort-props': [ 39 | 'error', 40 | { 41 | callbacksLast: true, 42 | shorthandLast: true, 43 | noSortAlphabetically: true, 44 | }, 45 | ], 46 | 'import/order': [ 47 | 'error', 48 | { 49 | groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'], 50 | 'newlines-between': 'always', 51 | alphabetize: { 52 | order: 'asc', 53 | caseInsensitive: true, 54 | }, 55 | }, 56 | ], 57 | 'import/no-extraneous-dependencies': [ 58 | 'error', 59 | { 60 | devDependencies: [ 61 | '.storybook/**', 62 | 'src/components/**/*.stories.js', 63 | 'src/components/**/*.stories.jsx', 64 | 'gatsby-config.js', 65 | 'gatsby-node.js', 66 | 'gatsby-ssr.js', 67 | ], 68 | }, 69 | ], 70 | 'jsx-a11y/label-has-associated-control': [ 71 | 'error', 72 | { 73 | required: { 74 | some: ['nesting', 'id'], 75 | }, 76 | }, 77 | ], 78 | 'jsx-a11y/label-has-for': [ 79 | 'error', 80 | { 81 | required: { 82 | some: ['nesting', 'id'], 83 | }, 84 | }, 85 | ], 86 | }, 87 | settings: { 88 | 'import/resolver': { 89 | node: { 90 | paths: ['src'], 91 | }, 92 | }, 93 | }, 94 | }; 95 | -------------------------------------------------------------------------------- /src/utils/get-all-data.js: -------------------------------------------------------------------------------- 1 | const fetch = require(`node-fetch`); 2 | const SwaggerParser = require('@apidevtools/swagger-parser'); 3 | 4 | const { URL } = require('../config'); 5 | 6 | const PARAMETER_TYPES = { 7 | path: 'path', 8 | query: 'query', 9 | body: 'body', 10 | }; 11 | 12 | const getAllData = async () => { 13 | const dataSwagger = await fetch(`${URL}/api-json`).then((response) => 14 | response.json() 15 | ); 16 | 17 | const { paths, tags } = await SwaggerParser.dereference(dataSwagger); 18 | 19 | const pages = Object.keys(paths) 20 | .map((path) => ({ 21 | endpoint: path.replace(/{/g, ':').replace(/}/g, ''), 22 | methods: Object.keys(paths[path]).map((method) => ({ 23 | ...paths[path][method], 24 | id: `${method}-${path}`, 25 | method, 26 | endpoint: path.replace(/{/g, ':').replace(/}/g, ''), 27 | tag: paths[path][method]?.tags?.[0], 28 | slug: paths[path][method]?.summary?.replace(/\s/g, '-').toLowerCase(), 29 | parameters: { 30 | path: paths[path][method].parameters.filter((param) => param.in === PARAMETER_TYPES.path), 31 | query: paths[path][method].parameters.filter( 32 | (param) => param.in === PARAMETER_TYPES.query 33 | ), 34 | body: paths[path][method].requestBody?.content['application/json'].schema, 35 | }, 36 | responses: Object.keys(paths[path][method].responses).map((status) => { 37 | const schema = 38 | paths[path][method].responses[status]?.content?.['application/json']?.schema; 39 | return { 40 | status, 41 | description: paths[path][method].responses[status].description, 42 | schema, 43 | }; 44 | }), 45 | })), 46 | })) 47 | 48 | .filter((page) => page.methods.some((method) => method.tag && method.summary)) 49 | .sort((a, b) => { 50 | const aIndex = tags.findIndex((tag) => tag.name === a.methods[0].tag); 51 | const bIndex = tags.findIndex((tag) => tag.name === b.methods[0].tag); 52 | return aIndex - bIndex; 53 | }); 54 | 55 | const methods = pages.reduce((acc, path) => { 56 | path.methods.forEach((method) => { 57 | acc.push(method); 58 | }); 59 | return acc; 60 | }, []); 61 | 62 | const menu = tags 63 | .map((tag) => ({ 64 | label: tag.name, 65 | path: tag.name, 66 | subItems: methods 67 | .filter((method) => method.tags.includes(tag.name)) 68 | .map((method) => ({ 69 | label: method.summary, 70 | path: method.slug, 71 | ...method, 72 | })), 73 | })) 74 | .filter((tag) => tag.subItems.length > 0); 75 | 76 | return { 77 | pages, 78 | menu, 79 | methods, 80 | }; 81 | }; 82 | 83 | module.exports = getAllData; 84 | -------------------------------------------------------------------------------- /src/components/shared/navigation/navigation.jsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import PropTypes from 'prop-types'; 3 | import React from 'react'; 4 | 5 | import Link from 'components/shared/link'; 6 | import scrollToSection from 'utils/scroll-to-section'; 7 | 8 | const Navigation = ({ items, activePath, setActivePath }) => { 9 | const handleLinkClick = (sectionId, event) => { 10 | event.preventDefault(); 11 | 12 | setActivePath(sectionId); 13 | scrollToSection(sectionId); 14 | }; 15 | return ( 16 | 17 | 21 | 22 | 23 | {items.map((item, index) => ( 24 | 25 | {item.label} 26 | 27 | {item.subItems.map((link) => ( 28 | 29 | handleLinkClick(link.path, e)} 38 | > 39 | {link.label} 40 | 41 | 42 | ))} 43 | 44 | 45 | ))} 46 | 47 | 48 | 49 | 50 | ); 51 | }; 52 | 53 | Navigation.propTypes = { 54 | items: PropTypes.arrayOf( 55 | PropTypes.shape({ 56 | label: PropTypes.string.isRequired, 57 | subItems: PropTypes.arrayOf( 58 | PropTypes.shape({ 59 | label: PropTypes.string.isRequired, 60 | path: PropTypes.string.isRequired, 61 | }) 62 | ).isRequired, 63 | }) 64 | ).isRequired, 65 | activePath: PropTypes.string.isRequired, 66 | setActivePath: PropTypes.func.isRequired, 67 | }; 68 | 69 | export default Navigation; 70 | -------------------------------------------------------------------------------- /src/components/shared/burger/burger.jsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import { motion } from 'framer-motion'; 3 | import PropTypes from 'prop-types'; 4 | import React from 'react'; 5 | 6 | const ANIMATION_DURATION = 0.2; 7 | 8 | const Burger = ({ className: additionalClassName, isToggled, onClick }) => ( 9 | 15 | 30 | 43 | 58 | 73 | 88 | 89 | ); 90 | 91 | Burger.propTypes = { 92 | className: PropTypes.string, 93 | isToggled: PropTypes.bool, 94 | onClick: PropTypes.func, 95 | }; 96 | 97 | Burger.defaultProps = { 98 | className: null, 99 | isToggled: false, 100 | onClick: null, 101 | }; 102 | 103 | export default Burger; 104 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gatsby-tailwind-starter", 3 | "description": "A simple starter to get up and developing quickly with Gatsby", 4 | "version": "0.1.0", 5 | "author": "Alex Barashkov ", 6 | "scripts": { 7 | "start": "npm run develop", 8 | "develop": "gatsby develop -H 0.0.0.0", 9 | "build": "gatsby build --prefix-paths", 10 | "build:netlify": "npm run build && mv public public-tmp && mkdir -p public/api && mv public-tmp/* public/api/", 11 | "serve": "gatsby serve --prefix-paths", 12 | "clean": "gatsby clean", 13 | "format": "prettier --write --ignore-path .gitignore .", 14 | "lint": "npm run lint:js & npm run lint:md", 15 | "lint:fix": "npm run lint:js:fix & npm run lint:md:fix", 16 | "lint:js": "eslint --ext .js,.jsx --ignore-path .gitignore .", 17 | "lint:js:fix": "eslint --fix --ext .js,.jsx --ignore-path .gitignore .", 18 | "lint:md": "markdownlint --ignore-path .gitignore .", 19 | "lint:md:fix": "markdownlint --fix --ignore-path .gitignore .", 20 | "prepare": "husky install" 21 | }, 22 | "dependencies": { 23 | "@apidevtools/swagger-parser": "^10.1.0", 24 | "@docsearch/react": "^3.2.1", 25 | "@mdx-js/mdx": "^1.6.22", 26 | "@mdx-js/react": "^1.6.22", 27 | "clsx": "^1.1.1", 28 | "copy-to-clipboard": "^3.3.1", 29 | "framer-motion": "^6.3.11", 30 | "gatsby": "^4.16.0", 31 | "gatsby-plugin-canonical-urls": "^4.16.0", 32 | "gatsby-plugin-gatsby-cloud": "^4.21.0", 33 | "gatsby-plugin-image": "^2.16.1", 34 | "gatsby-transformer-remark": "^5.19.0", 35 | "node-fetch": "^2.6.7", 36 | "node-html-parser": "^6.1.4", 37 | "prop-types": "^15.8.1", 38 | "react": "^17.0.2", 39 | "react-dom": "^17.0.2", 40 | "react-helmet": "^6.1.0", 41 | "react-syntax-highlighter": "^15.5.0", 42 | "tailwindcss": "^3.1.2" 43 | }, 44 | "devDependencies": { 45 | "@babel/core": "^7.18.5", 46 | "@commitlint/cli": "^17.0.2", 47 | "@commitlint/config-conventional": "^17.0.2", 48 | "@svgr/webpack": "^6.2.1", 49 | "autoprefixer": "^10.4.7", 50 | "babel-loader": "^8.2.5", 51 | "eslint": "^8.17.0", 52 | "eslint-config-airbnb": "^19.0.4", 53 | "eslint-config-prettier": "^8.5.0", 54 | "eslint-plugin-import": "^2.26.0", 55 | "eslint-plugin-jsx-a11y": "^6.5.1", 56 | "eslint-plugin-react": "^7.30.0", 57 | "eslint-plugin-react-hooks": "^4.5.0", 58 | "gatsby-alias-imports": "^1.0.6", 59 | "gatsby-plugin-manifest": "^4.16.0", 60 | "gatsby-plugin-netlify": "^5.0.1", 61 | "gatsby-plugin-postcss": "^5.16.0", 62 | "gatsby-plugin-react-helmet": "^5.16.0", 63 | "gatsby-plugin-sharp": "^4.16.1", 64 | "gatsby-plugin-sitemap": "^5.16.0", 65 | "gatsby-plugin-svgr-svgo": "^2.0.0", 66 | "gatsby-source-filesystem": "^4.16.0", 67 | "gatsby-transformer-sharp": "^4.16.0", 68 | "husky": "^8.0.1", 69 | "lint-staged": "^13.0.1", 70 | "markdownlint-cli": "^0.31.1", 71 | "postcss": "^8.4.14", 72 | "postcss-import": "^14.1.0", 73 | "prettier": "^2.7.0", 74 | "prettier-plugin-tailwindcss": "^0.1.11", 75 | "tailwindcss-safe-area": "^0.2.2" 76 | }, 77 | "keywords": [ 78 | "react", 79 | "gatsby", 80 | "tailwind" 81 | ], 82 | "license": "MIT", 83 | "repository": { 84 | "type": "git", 85 | "url": "https://github.com/pixel-point/gatsby-tailwind-starter" 86 | }, 87 | "bugs": { 88 | "url": "https://github.com/pixel-point/gatsby-tailwind-starter/issues" 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /gatsby-config.js: -------------------------------------------------------------------------------- 1 | // Gatsby has dotenv by default 2 | // eslint-disable-next-line import/no-extraneous-dependencies 3 | require('dotenv').config(); 4 | 5 | module.exports = { 6 | flags: { DEV_SSR: process.env.GATSBY_DEV_SSR || false }, 7 | pathPrefix: '/api', 8 | assetPrefix: process.env.GATSBY_DEFAULT_SITE_URL, 9 | trailingSlash: 'always', 10 | siteMetadata: { 11 | siteTitle: 'Novu API Reference', 12 | siteDescription: 13 | 'Novu is an open-source notification infrastructure built for the engineering teams to help them build rich product notification experiences without constantly re-inventing the wheel.', 14 | siteImage: '/api/images/social-preview.jpg', 15 | siteLanguage: 'en', 16 | siteUrl: process.env.GATSBY_DEFAULT_SITE_URL || 'http://localhost:8000', 17 | authorName: 'Pixel Point', 18 | }, 19 | plugins: [ 20 | 'gatsby-plugin-react-helmet', 21 | { 22 | resolve: 'gatsby-source-filesystem', 23 | options: { 24 | name: 'images', 25 | path: `${__dirname}/src/images`, 26 | }, 27 | }, 28 | { 29 | resolve: 'gatsby-source-filesystem', 30 | options: { 31 | path: `${__dirname}/content`, 32 | }, 33 | }, 34 | 'gatsby-plugin-image', 35 | 'gatsby-transformer-sharp', 36 | 'gatsby-transformer-remark', 37 | { 38 | resolve: 'gatsby-plugin-sharp', 39 | options: { 40 | defaults: { 41 | quality: 85, 42 | placeholder: 'none', 43 | }, 44 | }, 45 | }, 46 | { 47 | resolve: 'gatsby-plugin-manifest', 48 | options: { 49 | name: 'gatsby-starter-default', 50 | short_name: 'starter', 51 | start_url: '/', 52 | display: 'minimal-ui', 53 | icon: 'src/images/favicon.png', 54 | }, 55 | }, 56 | { 57 | resolve: 'gatsby-plugin-svgr-svgo', 58 | options: { 59 | inlineSvgOptions: [ 60 | { 61 | test: /\.inline.svg$/, 62 | svgoConfig: { 63 | plugins: [ 64 | { 65 | name: 'preset-default', 66 | params: { 67 | overrides: { 68 | removeViewBox: false, 69 | }, 70 | }, 71 | }, 72 | 'prefixIds', 73 | 'removeDimensions', 74 | ], 75 | }, 76 | }, 77 | ], 78 | }, 79 | }, 80 | { 81 | resolve: 'gatsby-plugin-gatsby-cloud', 82 | options: { 83 | headers: { 84 | '/*': ['Access-Control-Allow-Origin: *'], 85 | '/api/fonts/*': ['Cache-Control: public, max-age=31536000, immutable'], 86 | }, 87 | }, 88 | }, 89 | { 90 | resolve: 'gatsby-plugin-netlify', 91 | options: { 92 | headers: { 93 | '/*': ['Access-Control-Allow-Origin: *'], 94 | '/api/fonts/*': ['Cache-Control: public, max-age=31536000, immutable'], 95 | }, 96 | }, 97 | }, 98 | 'gatsby-alias-imports', 99 | 'gatsby-plugin-postcss', 100 | { 101 | resolve: 'gatsby-plugin-sitemap', 102 | options: { 103 | resolveSiteUrl: () => 'https://docs.novu.co/', 104 | output: '/', 105 | }, 106 | }, 107 | { 108 | resolve: 'gatsby-plugin-canonical-urls', 109 | options: { 110 | siteUrl: 'https://docs.novu.co', 111 | }, 112 | }, 113 | ], 114 | }; 115 | -------------------------------------------------------------------------------- /gatsby-ssr.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const SITE_DOMAIN = 'docs.novu.co'; 4 | const PLAUSIBLE_DOMAIN = 'plausible.io'; 5 | const SCRIPT_URI = '/js/script.js'; 6 | 7 | // eslint-disable-next-line import/prefer-default-export 8 | export const onRenderBody = ({ setHeadComponents, setPreBodyComponents, setHtmlAttributes }) => { 9 | if (process.env.NODE_ENV === 'production') { 10 | const scriptProps = { 11 | 'data-domain': SITE_DOMAIN, 12 | src: `https://${PLAUSIBLE_DOMAIN}${SCRIPT_URI}`, 13 | }; 14 | 15 | setHeadComponents([ 16 | // eslint-disable-next-line react/jsx-filename-extension 17 | , 18 | , 19 | // See: https://plausible.io/docs/custom-event-goals#1-trigger-custom-events-with-javascript-on-your-site 20 | , 28 | ]); 29 | } 30 | 31 | setPreBodyComponents([ 32 |
404 error
Sorry, we couldn’t find the page you’re looking for.