### Install project dependencies Source: https://github.com/novuhq/docs/blob/main/content/docs/community/run-in-local-machine.mdx Navigate to the project directory and execute the setup script to install all required dependencies. ```shell cd novu && npm run setup:project ``` -------------------------------- ### Quick Start with OpenAI Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/build-with-ai/agent-toolkit.mdx Initialize the Novu Agent Toolkit for OpenAI and use it to send a welcome email. This example demonstrates basic setup and tool invocation. ```typescript import { createNovuAgentToolkit } from '@novu/agent-toolkit/openai'; import OpenAI from 'openai'; const openai = new OpenAI(); const toolkit = await createNovuAgentToolkit({ secretKey: process.env.NOVU_NOVU_SECRET_KEY, subscriberId: 'user-123', }); const response = await openai.chat.completions.create({ model: 'gpt-4o', messages: [{ role: 'user', content: 'Send a welcome email to user-123' }], tools: toolkit.tools, }); for (const toolCall of response.choices[0].message.tool_calls ?? []) { const result = await toolkit.handleToolCall(toolCall); console.log(result); } ``` -------------------------------- ### Clone and Setup Novu Docs Source: https://github.com/novuhq/docs/blob/main/README.md Clone the Novu docs repository, install dependencies using pnpm, and start the development server. Open http://localhost:3010 to view the documentation locally. ```bash git clone https://github.com/YOUR_USERNAME/docs.git cd docs pnpm install pnpm dev ``` -------------------------------- ### Clone and Setup Novu Repository Source: https://github.com/novuhq/docs/blob/main/content/docs/community/self-hosting-novu/data-migrations.mdx Prepare the local environment by checking out the specific version tag and installing dependencies. ```bash git clone https://github.com/novuhq/novu.git cd novu git checkout # e.g. v0.24.0 npm run clean npm run setup:project # really important to run if you change tag cd apps/api ``` -------------------------------- ### Initialize Project Setup Source: https://github.com/novuhq/docs/blob/main/content/docs/community/add-a-new-provider.mdx Run the initial setup command to configure the Novu project after cloning. This command installs dependencies and prepares the development environment. ```shell pnpm run setup:project ``` -------------------------------- ### Legacy Notification Center Setup Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/inbox/migration-guide.mdx This example shows the setup for the legacy `@novu/notification-center` package, including the `NovuProvider`, `PopoverNotificationCenter`, and `NotificationBell` components. ```tsx import { PopoverNotificationCenter, NotificationBell, NovuProvider, } from '@novu/notification-center'; function Novu() { return ( {({ unseenCount }) => } ); } export default Novu; ``` -------------------------------- ### Install React Email components Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/content/react-email.mdx Install the necessary packages to start building email templates with React. ```bash npm install @react-email/components react-email ``` -------------------------------- ### Download and Run Novu Setup Script Source: https://github.com/novuhq/docs/blob/main/content/docs/community/self-hosting-novu/deploy-with-docker.mdx Use this command to download the necessary files, generate secrets, and start Novu services using Docker Compose. ```bash curl -fsSL https://raw.githubusercontent.com/novuhq/novu/next/docker/community/setup.sh | bash ``` -------------------------------- ### Start the Novu project Source: https://github.com/novuhq/docs/blob/main/content/docs/community/run-in-local-machine.mdx Launch the Jarvis CLI tool to start the project services. ```shell npm run start ``` -------------------------------- ### Install Novu SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/inngest.mdx Install the Novu API package using npm. ```json npm i @novu/api ``` -------------------------------- ### Trigger Event with Custom Installation Source: https://github.com/novuhq/docs/blob/main/content/docs/community/self-hosting-novu/deploy-with-docker.mdx Example of triggering an event when self-hosting Novu. It demonstrates initializing the `Novu` object with the correct `backendUrl` and then calling the `trigger` method. ```tsx import { Novu } from '@novu/api'; const novu = new Novu({ secretKey: '', serverURL: '', }); await novu.trigger({ workflowId: 'workflowId', to: { subscriberId: 'subscriberId', }, payload: {}, }); ``` -------------------------------- ### Install Novu React SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/inbox/headless-mode.mdx Install the Novu React SDK package using npm. ```bash npm i @novu/react ``` -------------------------------- ### Install Dependencies Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/webhooks/stripe.mdx Install the necessary packages for Stripe and Novu integration. ```bash npm install @novu/api @clerk/nextjs @stripe ``` -------------------------------- ### Install Dependencies and Generate Types Source: https://github.com/novuhq/docs/blob/main/AGENTS.md Installs project dependencies and runs `fumadocs-mdx` to generate type definitions. Re-run if type errors occur after installation. ```bash pnpm install ``` -------------------------------- ### Install Agent Toolkit Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/build-with-ai/agent-toolkit.mdx Install the @novu/agent-toolkit package using npm. You will also need to install the peer dependency for your chosen AI framework. ```bash npm install @novu/agent-toolkit ``` -------------------------------- ### Install AI SDK and OpenAI Source: https://github.com/novuhq/docs/blob/main/content/docs/agents/custom-code-agent/build-your-first-agent.mdx Install the necessary packages for AI integration and set your OpenAI API key. ```bash npm install ai @ai-sdk/openai ``` ```bash OPENAI_API_KEY=sk-... ``` -------------------------------- ### Install Novu PHP SDK using Composer Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/server/php.mdx Use this command to install the SDK and add it as a dependency to your project's composer.json file. ```bash composer require "novuhq/novu" ``` -------------------------------- ### Start Agent Locally Source: https://github.com/novuhq/docs/blob/main/content/docs/agents/custom-code-agent/quickstart.mdx Run this command to start your agent locally. It will start the app, open a dev tunnel, and register the bridge URL. ```bash npm run dev:novu ``` -------------------------------- ### Launch Local Studio Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/studio.mdx Starts the Local Studio companion app in the terminal. ```bash npx novu@latest dev ``` -------------------------------- ### Install Novu Inbox UI Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/inbox/setup-inbox.mdx Install the required package for your specific framework. ```bash npm install @novu/nextjs ``` ```bash npm install @novu/react ``` -------------------------------- ### Install Dependencies Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/webhooks/clerk.mdx Install the necessary packages for Clerk and Novu integration in your Next.js application. ```bash npm install svix @novu/api @clerk/nextjs ``` -------------------------------- ### Full OpenAI Example with Tool Loop Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/build-with-ai/agent-toolkit.mdx A complete example demonstrating how to integrate the Novu Agent Toolkit with OpenAI, including handling tool calls and managing conversation messages. ```typescript import { createNovuAgentToolkit } from '@novu/agent-toolkit/openai'; import OpenAI from 'openai'; const openai = new OpenAI(); const toolkit = await createNovuAgentToolkit({ secretKey: process.env.NOVU_SECRET_KEY, subscriberId: 'user-123', }); const messages = [ { role: 'user', content: 'Send a welcome email to user-123' }, ]; const response = await openai.chat.completions.create({ model: 'gpt-4o', messages, tools: toolkit.tools, }); const assistantMessage = response.choices[0].message; messages.push(assistantMessage); for (const toolCall of response.choices[0].message.tool_calls ?? []) { const result = await toolkit.handleToolCall(toolCall); messages.push(result); } ``` -------------------------------- ### Install Python SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/recipes/managing-workflows.mdx Install the Novu API SDK for Python. This is a prerequisite for managing workflows using Python. ```bash pip install novu-py ``` -------------------------------- ### Install Novu SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/triggerdotdev.mdx Install the Novu SDK using npm. This package provides the necessary tools to interact with the Novu API. ```bash npm i @novu/api ``` -------------------------------- ### Start Kannel Service Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/integrations/sms/(providers)/kannel.mdx Command to start the Kannel bearerbox service. Ensure the path to your kannel.conf file is correct. ```bash bearerbox /path/to/kannel.conf ``` -------------------------------- ### Install Novu Node SDK Package Source: https://github.com/novuhq/docs/blob/main/content/docs/community/self-hosting-novu/deploy-with-docker.mdx Install the @novu/api package to enable your backend services to connect to your self-hosted Novu instance. ```bash npm install @novu/api ``` -------------------------------- ### Install Novu React Native SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/react-native/index.mdx Install the Novu React Native hooks SDK using npm. ```bash npm install @novu/react-native ``` -------------------------------- ### Start Novu Services on VPS Source: https://github.com/novuhq/docs/blob/main/content/docs/community/self-hosting-novu/deploy-with-docker.mdx After configuring the environment variables for a VPS deployment, use this command to start Novu services in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Install Novu Ruby Gem Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/server/ruby.mdx Install the Novu Ruby SDK using the gem command. This is the first step to integrate Novu into your Ruby application. ```bash gem install novu ``` -------------------------------- ### Install Novu Framework Packages Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/quickstart/nextjs.mdx Install the necessary packages for Novu Framework, React Email for templates, and Zod for type safety in your Next.js application. ```bash npm install @novu/framework @react-email/components react-email zod zod-to-json-schema ``` -------------------------------- ### Install Novu Skills CLI Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/build-with-ai/skills.mdx Install the Novu skills into your project using the 'skills' CLI. This command pulls the skills from the novuhq/skills GitHub repository. ```bash npx skills add novuhq/skills ``` -------------------------------- ### Configure Studio with CLI Flags Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/studio.mdx Example of running the Studio with a custom port and dashboard URL for a specific region. ```bash npx novu@latest dev --port 3002 --dashboard-url https://eu.dashboard.novu.co ``` -------------------------------- ### Install Novu in a Specific Directory Source: https://github.com/novuhq/docs/blob/main/content/docs/community/self-hosting-novu/deploy-with-docker.mdx Specify a custom directory for Novu installation by setting the NOVU_DIR environment variable before running the setup script. ```bash curl -fsSL https://raw.githubusercontent.com/novuhq/novu/next/docker/community/setup.sh | NOVU_DIR=~/novu bash ``` -------------------------------- ### Initialize React Project Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/quickstart/react.mdx Commands to scaffold a new React application using Vite. ```bash npm create vite@latest novu-inbox-react -- --template react-ts cd novu-inbox-react npm install npm run dev ``` -------------------------------- ### Start and Configure Svelte Application Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/quickstart/svelte.mdx Commands to launch the development server and connect the Novu Studio to the application port. ```tsx cd my-novu-app && npm run dev ``` ```tsx npx novu@latest dev --port ``` -------------------------------- ### Start Next.js Development Server Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/quickstart/nextjs.mdx Commands to launch the application and configure the Novu development environment. ```bash cd my-novu-app && npm run dev ``` ```bash npx novu@latest dev --port ``` -------------------------------- ### Install novu-py with PIP Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/server/python.mdx Use this command to install the Novu Python SDK using PIP, the default package installer for Python. ```bash pip install novu-py ``` -------------------------------- ### Run Novu Local Studio (VPS Deployment) Source: https://github.com/novuhq/docs/blob/main/content/docs/community/self-hosting-novu/deploy-with-docker.mdx Set up Novu Studio for a VPS deployment. This involves updating the bridge application's .env file with the VPS IP address and then starting Novu Studio with the correct dashboard and bridge application URLs. ```bash # update the bridge .env file with below variables NOVU_API_URL=http://:3000 # Start Novu Studio with your VPS dashboard URL and bridge application URL npx novu@latest dev -d http://:4000 ``` -------------------------------- ### Install Novu Go SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/server/go.mdx Use this command to add the Novu Go SDK to your project dependencies. ```go go get github.com/novuhq/novu-go ``` -------------------------------- ### Install Novu .NET SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/server/dotnet.mdx Use the dotnet CLI to add the Novu package to your project. ```csharp dotnet add package Novu ``` -------------------------------- ### Start Remix Application Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/quickstart/remix.mdx Run your Remix application using 'npm run dev'. Ensure Novu Studio is restarted and pointed to the correct port by using the command 'npx novu@latest dev --port '. ```bash cd my-novu-app && npm run dev ``` ```bash npx novu@latest dev --port ``` -------------------------------- ### Install Novu Typescript SDK using Yarn Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/server/typescript.mdx Use this command to add the Novu API package to your project with Yarn. Note that Yarn does not install peer dependencies automatically, so you must also install zod. ```bash yarn add @novu/api zod@^3 ``` -------------------------------- ### Basic Setup with @novu/react Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/inbox/migration-guide.mdx Initializes the Novu inbox with subscriber and application identifiers. Requires @novu/react. ```tsx import { Inbox, Notifications } from '@novu/react'; function Novu() { return ( ); } export default Novu; ``` -------------------------------- ### Install Svelte Email Components Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/content/svelte-email.mdx Install the necessary Svelte email components using npm. ```bash npm install svelte-email ``` -------------------------------- ### Install React Email Components Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/content/remix-react-email.mdx Install the necessary packages for React Email in your Remix project. ```bash npm i @react-email/components react-email ``` -------------------------------- ### Example HTML Notification Content Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/inbox/advanced-customization/html-in-notifications.mdx Example of notification content containing HTML tags and variables. ```html {{subscriber.firstName}}, A Good news! We've just launched the advanced analytics dashboard you asked for. Check it out here. ``` -------------------------------- ### Install Novu React Inbox Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/migrate-from-courier-to-novu.mdx Install the Novu React package to use the Inbox component in your application. ```bash npm install @novu/react ``` -------------------------------- ### Initialize Novu Instance Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/inngest.mdx Import the Novu SDK and initialize the client using your secret key from environment variables. ```typescript import { Novu } from "@novu/api"; const novu = new Novu({ secretKey: 'ApiKey ' + process.env['NOVU_SECRET_KEY'] }); ``` -------------------------------- ### Start Nuxt Application and Novu Dev Server Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/quickstart/nuxt.mdx Commands to launch the local development environment and the Novu bridge. ```bash cd my-novu-app && npm run dev ``` ```bash npx novu@latest dev --port ``` -------------------------------- ### Install Class Validator Packages Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/schema/class-validator.mdx Install the necessary dependencies to enable JSON schema generation from DTOs. ```bash npm install class-validator class-validator-jsonschema reflect-metadata ``` -------------------------------- ### Initialize Novu SDK and Fetch Environments Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/server/kotlin.mdx This Kotlin code initializes the Novu SDK with your API key and fetches environment details. Ensure you have the necessary imports. ```kotlin // without changing the backend URL import co.novu.Novu import co.novu.extentions.environments fun main() { val novu = Novu(apiKey = "NOVU_SECRET_KEY") val environment = novu.environments() println(environment) } ``` -------------------------------- ### Install Zod Package Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/schema/zod.mdx Install the Zod library using npm to enable schema validation in your project. ```bash npm install zod ``` -------------------------------- ### Install Vue Email components Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/content/vue-email.mdx Install the necessary Vue Email components package via npm. ```bash npm install @vue-email/components ``` -------------------------------- ### Novu Configuration File Example Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/workflow/add-and-configure-steps/code-steps.mdx Configure advanced Novu settings like output directory, API URL, and import aliases by creating a `novu.config.ts` file. ```typescript // novu.config.ts const config = { outDir: './novu', apiUrl: 'https://api.novu.co', aliases: { '@emails': './src/emails', }, }; export default config; ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/novuhq/docs/blob/main/content/docs/guides/webhooks/stripe.mdx Set up your .env.local file with essential API keys and secrets for Novu and Stripe. ```bash NOVU_SECRET_KEY=novu_secret_... STRIPE_SECRET_KEY=sk_test_... STRIPE_WEBHOOK_SECRET=whsec_... ``` -------------------------------- ### Install Novu JS SDK Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/build-with-ai/skills.mdx Installs the @novu/js package for client-side integration, typically for vanilla JavaScript applications. ```bash npm install @novu/js ``` -------------------------------- ### Example Usage Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/sdks/react/hooks/use-notifications.model.mdx Demonstrates basic usage of the `useNotifications` hook to fetch and display notifications. ```typescript import { useNotifications } from "@novu/react"; function NotificationsList() { const { notifications, hasMore, isLoading, error, fetchMore } = useNotifications(); if (isLoading) return
Loading...
; if (error) return
Error: {error.message}
; return (
{notifications?.map((notification) => (

{notification.subject}

{notification.body}

{new Date(notification.createdAt).toLocaleString()} {notification.isRead ? "Read" : "Unread"}
))} {hasMore && ( )}
); } ``` -------------------------------- ### Install Novu Next.js Inbox Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/build-with-ai/skills.mdx Installs the @novu/nextjs package for integrating the in-app notification center into a Next.js application. ```bash npm install @novu/nextjs ``` -------------------------------- ### Initialize Novu Framework Project Source: https://github.com/novuhq/docs/blob/main/content/docs/framework/index.mdx Use the npx novu init command to create a sample Bridge application with a built-in Bridge Endpoint. ```bash npx novu init ``` -------------------------------- ### Create an Angular application Source: https://github.com/novuhq/docs/blob/main/content/docs/platform/quickstart/angular.mdx Use the Angular CLI to scaffold a new project. ```bash ng new novu-inbox-angular cd novu-inbox-angular ```