-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v2: dashboard structure * feat: add hero card * feat: api ref anchor * feat: add client-side * feat: add initia lstructure * fix: side menu * fix: move getting started * feat: introduction screen * feat: add quickstart * fix: update endpoint page * feat: update branding * fix: sdks menu * fix: update docs * feat: fix endpoint page * fix: quick start * feat: colors * feat: colors * fix: remove inbox title * fix: typo * chore: update framework example A user suggested we nix the +1 from the `{events.length +1}` example in the framework-terminal docs page and example. * modified the Build Workflow section * fixes * Added more changes * fix: document structure and navigation * fix: * fix: rename * feat: workflow page * feat: remove step conditions from framework * feat: remove client side sdks empty menu * inti * Added visual aid to 'What is Novu' page * Added 'add inbox' optional step to the quickstart * Added 'tags' pages * Modified the - 'Introduction' page * Modified the 'Template Editor' page to include more Liquid filter examples * Modified the 'Digest Action Step' page and chnaged the visual aid * Changed the Digest image * Delete architecture/diagrams.mdx * Delete architecture/introduction.mdx * Delete concepts/controls.mdx * Delete deployment/actions.mdx * Delete deployment/cli.mdx * Delete deployment/production.mdx * Delete deployment/syncing.mdx * modified the tags page * modified the image of how Novu works * fix: spelling * Added notifications concept page * Modified the quickstart page * Not final draft * Not final draft * Not final draft * Not final draft * Not final draft * second deaft * second deaft * second deaft * second draft * second draft * second draft * second draft * second draft * second draft * second draft * added socials * fix:anchors * fix: items * fixed broken links * small fix * chore: content and style review * chore: content, style, and spelling review * chore: tweak language, spelling, apply style guide * chore: update framework/overview and related nav * chore: update nav for framework/overview move * chore: introduction to overview and update links * chore: update language, apply style guide * chore: language, spalling, and style updates * chore: update language and apply style guide * chore: update language and structure, fix spelling, apply style guide * chore: apply style guide * chore: framework introduction -> overview * chore: inbox introduction -> overview * chore: community intro -> overview, apply style guide * fix: community intro->overview mint.json correction * chore: framework/typescript/intro -> overview --------- Co-authored-by: Justin Nemmers <[email protected]> Co-authored-by: StarL0rdDude <[email protected]> Co-authored-by: Emil Pearce <[email protected]>
- Loading branch information
1 parent
b9494c0
commit 909fb8d
Showing
181 changed files
with
3,639 additions
and
1,583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: "Security and Compliance" | ||
description: "Common questions related to security, compliance, privacy policy and terms and conditions" | ||
description: "Common questions about security, compliance, privacy policy, and terms and conditions" | ||
icon: "shield" | ||
--- | ||
|
||
|
@@ -39,8 +39,8 @@ By default, data is stored using the following TTL values | |
- Notifications (for 1 month) | ||
- Jobs (for 1 month) | ||
- Message (for in-app messages - 12 months, for all other messages - 1 month) | ||
- Execution Details (for 1 month) | ||
- Subscribers, Workflows, Feeds, Layouts (Not deleted automatically, can be deleted by the user at any time) | ||
- Execution details (for 1 month) | ||
- Subscribers, workflows, feeds, layouts (not deleted automatically, can be deleted by the user at any time) | ||
|
||
If you want to delete any specific data or information, reach out to us at [email protected] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,68 @@ | ||
--- | ||
title: "Bridge Endpoint" | ||
title: "Framework Endpoint" | ||
description: "Learn how to customize and extend any aspect of the Novu platform using the Framework SDK powered bridge endpoint." | ||
--- | ||
|
||
Novu Framework requires a **single** `HTTP` endpoint (`/api/novu` or similar) to be exposed by your application. This endpoint is used to receive events from our **Worker Engine**. | ||
|
||
You can view the Bridge Endpoint as a webhook endpoint that Novu will call when it needs to retrieve contextual information for a given subscriber and notification. | ||
|
||
Using the `npx novu init` command creates a Bridge application for you with a Bridge Endpoint ready to go. | ||
|
||
## The `serve` function | ||
|
||
We offer framework specific wrappers in form of an exported `serve` function that abstracts away: | ||
|
||
- Parsing the incoming request for `GET`, `POST`, `PUT` and `OPTIONS` requests | ||
- HMAC header authentication | ||
- Framework specific response and error handling | ||
|
||
Currently, we offer `serve` functions for the following frameworks: | ||
|
||
- [Next.js](/quickstart/nextjs) | ||
- [Express.js](/quickstart/express) | ||
- [Nuxt](/quickstart/nuxt) | ||
- [h3](/quickstart/h3) | ||
- [Remix](/quickstart/remix) | ||
- [Sveltekit](/quickstart/svelte) | ||
|
||
## Writing a custom `serve` function | ||
|
||
If we currently don't support your framework, you can write a custom `serve` function like the following example: | ||
|
||
```ts | ||
import { type Request, type Response } from "express"; | ||
import { NovuRequestHandler, ServeHandlerOptions } from "@novu/framework"; | ||
|
||
export const serve = (options: ServeHandlerOptions): any => { | ||
const requestHandler = new NovuRequestHandler({ | ||
frameworkName: "express", | ||
...options, | ||
handler: (incomingRequest: Request, response: Response) => ({ | ||
method: () => incomingRequest.method, | ||
headers: (key) => { | ||
const header = incomingRequest.headers[key]; | ||
return Array.isArray(header) ? header[0] : header; | ||
}, | ||
queryString: (key) => { | ||
const qs = incomingRequest.query[key]; | ||
return Array.isArray(qs) ? qs[0] : qs; | ||
}, | ||
body: () => incomingRequest.body, | ||
url: () => | ||
new URL( | ||
incomingRequest.url, | ||
`https://${incomingRequest.headers.get("host") || ""}` | ||
), | ||
transformResponse: ({ body, headers, status }) => { | ||
Object.entries(headers).forEach(([headerName, headerValue]) => { | ||
response.setHeader(headerName, headerValue); | ||
}); | ||
|
||
return response.status(status).send(body); | ||
}, | ||
}), | ||
}); | ||
|
||
return requestHandler.createHandler(); | ||
}; | ||
``` | ||
import { SvelteIcon } from "/snippets/icons/svelte.mdx"; | ||
import { NestjsIcon } from "/snippets/icons/nestjs.mdx"; | ||
import { ExpressjsIcon } from "/snippets/icons/expressjs.mdx"; | ||
import { LambdaIcon } from "/snippets/icons/lambda.mdx"; | ||
import { NuxtIcon } from "/snippets/icons/nuxt.mdx"; | ||
import { NextjsIcon } from "/snippets/icons/nextjs.mdx"; | ||
import { RemixIcon } from "/snippets/icons/remix.mdx"; | ||
import { H3Icon } from "/snippets/icons/h3.mdx"; | ||
import { FrameworkTerminal } from "/snippets/framework-terminal.mdx"; | ||
|
||
Novu was built for endless extensibility. Although not required for majority of your notification usecases, you can customize and extend any aspect of the Novu platform using the Framework SDK powered bridge endpoint. | ||
|
||
## Overview | ||
|
||
The framework endpoint is a Restful API path that runs on your server and environment and can be used for multiple usecases including: | ||
|
||
- Automating workflow creation using GitOps | ||
- Adding custom components to your emails and other channels | ||
- Hydrating resources including subscribers, topics and tenants directly from your database | ||
- Executing custom logic before, during and after a workflow is executed | ||
- Connect to 3rd-party services such as OpenAI, Stripe, Salesforce and more. | ||
- Implement custom delivery providers with internal systems | ||
|
||
## How it works | ||
|
||
<Frame> | ||
<img src="/images/novu-works.png" /> | ||
</Frame> | ||
|
||
### Build phase | ||
|
||
When [building new workflows](/workflow/overview), you will be using the [Novu Framework SDK](/framework/typescript/overview) to define the workflows and their steps directly in your IDE. The local workflows can be previewed and tested using our [Local Studio](/framework/studio) companion app. | ||
|
||
### Sync phase | ||
|
||
A sync is needed once a notification workflow code is created or updated. We offer multiple sync methods including CI/CD integrations and a custom CLI tool. | ||
|
||
During a sync, the workflows defined using the Novu Framework SDK will be pushed to our cloud service and will be persisted in our database. | ||
Once synced, you will be able to view the workflows in the workflows Page on the Dashboard. All the controls created using JSON Schema or Zod will be transformed into UI elements that can be modified without changing the source code. Read more about controls [here](/framework/controls). | ||
|
||
### Execution phase | ||
|
||
Once a workflow is synced, the workflow engine will make API requests to the bridge endpoint to execute individual workflow steps. | ||
After the fan-out is complete, the bridge endpoint will be triggered with the relevant execution context and will respond with the compiled content and metadata needed to deliver the notification. | ||
|
||
## Get Started | ||
|
||
To get started with the framework endpoint, visit the Getting Started page relevant to your tech-stack: | ||
|
||
<CardGroup cols={3}> | ||
<Card title="Next.js" color="#00D7FE" href="/framework/quickstart/nextjs" horizontal icon={<NextjsIcon />} /> | ||
<Card title="Express.js" color="#47BA87" href="/framework/quickstart/express" horizontal icon={<ExpressjsIcon />} /> | ||
<Card title="Remix" color="#BC002C" href="/framework/quickstart/remix" horizontal icon={<RemixIcon />} /> | ||
<Card title="NestJS" color="#BC002C" href="/framework/quickstart/nestjs" horizontal icon={<NestjsIcon />} /> | ||
<Card title="Svelte" color="#16a34a" href="/framework/quickstart/svelte" horizontal icon={<SvelteIcon />} /> | ||
<Card title="Nuxt" color="#16a34a" href="/framework/quickstart/nuxt" horizontal icon={<NuxtIcon />} /> | ||
<Card title="H3" color="#16a34a" href="/framework/quickstart/h3" horizontal icon={<H3Icon />} /> | ||
<Card title="Lambda" color="#16a34a" href="/framework/quickstart/lambda" horizontal icon={<LambdaIcon />} /> | ||
</CardGroup> | ||
|
||
<Warning> | ||
The Framework SDK is currently only supported in Typescript for JS based run-times. | ||
</Warning> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.