Skip to content

Commit 9fca9e1

Browse files
Cleanup for the quickstart guides (#884)
1 parent 4a14ede commit 9fca9e1

File tree

6 files changed

+357
-212
lines changed

6 files changed

+357
-212
lines changed

content/docs/platform/quickstart/angular.mdx

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
Library,
1111
Workflow
1212
} from 'lucide-react';
13+
import { CodeTemplateBlock } from '@/components/quickstart/inbox-code';
14+
1315

1416
This guide walks you through integrating Novu’s Inbox into your Angular application for real time in-app notifications, from setup to triggering your first notification. By the end, you'll have a working notification inbox.
1517

@@ -20,27 +22,24 @@ This guide walks you through integrating Novu’s Inbox into your Angular applic
2022
<Steps>
2123
<Step>
2224
### Create a Novu account
23-
[Create a Novu account](https://dashboard-v2.novu.co/auth/sign-up) or [sign in](https://dashboard-v2.novu.co/auth/sign-in) to an existing account.
25+
<a href="https://dashboard.novu.co/auth/sign-up" target="_blank" rel="noopener noreferrer">Create a Novu account</a> or <a href="https://dashboard.novu.co/auth/sign-in" target="_blank" rel="noopener noreferrer">sign in</a> to access the Novu dashboard.
2426
</Step>
2527

2628
<Step>
27-
### Create an Angular application
28-
Create a new Angular app with [angular cli](https://angular.dev/tools/cli) using the command below. Skip this step if you already have an existing project:
29+
### Create an Angular application
30+
Run the following command to create a new Angular app using <a href="https://angular.dev/tools/cli/setup-local#install-the-angular-cli" target="_blank" rel="noopener noreferrer">angular cli</a>:
2931

3032
```bash
3133
ng new novu-inbox-angular
32-
```
33-
34-
Navigate to the newly created project:
35-
36-
```bash
3734
cd novu-inbox-angular
3835
```
3936
</Step>
4037

4138
<Step>
42-
### Install the required package
43-
Run the command below to install [Novu Javascript SDK](/platform/sdks/javascript), which provides required component for Inbox UI:
39+
### Install `@novu/js`
40+
The [Novu JavaScript SDK](/platform/sdks/javascript) gives you access to the Inbox component.
41+
42+
Run the following command to install the SDK:
4443

4544
```package-install
4645
npm install @novu/js
@@ -50,45 +49,11 @@ This guide walks you through integrating Novu’s Inbox into your Angular applic
5049

5150
<Step>
5251
### Add the Inbox component
53-
Update the `src/app/app.component.ts` file to add the Inbox component passing :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."}:
54-
55-
```ts title="src/app/app.component.ts"
56-
import { Component, ViewChild, ElementRef, AfterViewInit } from '@angular/core';
57-
import { RouterOutlet } from '@angular/router';
58-
import { NovuUI } from '@novu/js/ui';
59-
60-
@Component({
61-
selector: 'app-root',
62-
standalone: true,
63-
imports: [RouterOutlet],
64-
templateUrl: './app.component.html',
65-
styleUrl: './app.component.css',
66-
})
67-
export class AppComponent implements AfterViewInit {
68-
@ViewChild('novuInbox') novuInbox!: ElementRef<HTMLElement>;
69-
title = 'inbox-angular';
70-
71-
ngAfterViewInit() {
72-
const novu = new NovuUI({
73-
options: {
74-
applicationIdentifier: 'YOUR_APPLICATION_IDENTIFIER',
75-
subscriberId: 'YOUR_SUBSCRIBER_ID',
76-
},
77-
});
78-
79-
novu.mountComponent({
80-
name: 'Inbox',
81-
props: {},
82-
element: this.novuInbox.nativeElement,
83-
});
84-
}
85-
}
86-
```
87-
<div className="text-sm text-gray-500 text-center mt-[-12px]">
88-
[Sign in](https://dashboard-v2.novu.co/auth/sign-up) to get your own API keys
89-
</div>
90-
91-
If you’re signed in to your Novu account, then the :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."} are automatically entered in the code sample above. Otherwise, you can manually retrieve them:
52+
Update the `src/app/app.ts` file to add the Inbox component. You'll need to provide your :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."}:
53+
54+
<CodeTemplateBlock templateId="angular-inbox" />
55+
56+
If you’re signed in to your Novu account, then the :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."} are automatically entered in the code sample above. Otherwise, you can manually retrieve them:
9257
* `applicationIdentifier` - In the Novu dashboard, click API Keys, and then locate your unique Application Identifier.
9358
* `subscriberId` - This represents a user in your system (typically the user's ID in your database). For quick start purposes, an auto-generated subscriberId is provided for your Dashboard user.
9459

@@ -100,20 +65,22 @@ export class AppComponent implements AfterViewInit {
10065

10166
<Step>
10267
### Add the Inbox component to your application
103-
Add a `#novuInbox` reference to your application in the starting of the `src/app/app.component.html` file:
68+
Add a `#novuInbox` reference to your application in the starting of the `src/app/app.html` file:
10469

105-
```html title="src/app/app.component.html"
70+
```html title="src/app/app.html"
10671
<div #novuInbox></div>
10772
```
10873
</Step>
10974

11075
<Step>
76+
11177
### Run Your Application
11278
Start your development server:
11379

11480
```package-install
11581
npm run start
11682
```
83+
11784
Once the application is running, a bell icon will appear on the top left side of the screen. Clicking it opens the notification inbox UI.
11885

11986
Currently, there are no notifications. Let’s trigger one!

content/docs/platform/quickstart/nextjs.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,21 @@ Learn how to integrate Novu’s Inbox for real-time in-app notifications in your
2929
<Steps>
3030
<Step>
3131
### Create a Novu account
32-
[Create a Novu account](https://dashboard.novu.co/auth/sign-up) or [sign in](https://dashboard.novu.co/auth/sign-in) to access the Novu dashboard.
32+
<a href="https://dashboard.novu.co/auth/sign-up" target="_blank" rel="noopener noreferrer">Create a Novu account</a> or <a href="https://dashboard.novu.co/auth/sign-in" target="_blank" rel="noopener noreferrer">sign in</a> to access the Novu dashboard.
3333
</Step>
3434

35+
<Step>
36+
### Create a new Next.js application
37+
Run the following command to <a href="https://nextjs.org/docs/app/getting-started/installation" target="_blank">create a new Next.js application</a>:
38+
39+
```package-install
40+
npm create next-app@latest
41+
```
42+
</Step>
43+
3544
<Step>
3645
### Install `@novu/nextjs`
37-
In your Next.js project, run the following command to install the Novu Inbox SDK:
46+
Run the following command to install the Next.js Novu SDK:
3847

3948
```package-install
4049
npm install @novu/nextjs

content/docs/platform/quickstart/react.mdx

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,34 @@ import {
2121
Palette,
2222
Workflow
2323
} from 'lucide-react';
24+
import { CodeTemplateBlock } from '@/components/quickstart/inbox-code';
2425

2526
This guide walks you through integrating Novu’s Inbox into your React application for in-app notifications in real-time, from setup to triggering your first notification. By the end, you'll have a working notification inbox.
2627

2728
<Steps>
2829
<Step>
2930
### Create a Novu account
30-
[Create a Novu account](https://dashboard.novu.co/auth/sign-up) or [sign in](https://dashboard.novu.co/auth/sign-in) to an existing account.
31+
<a href="https://dashboard.novu.co/auth/sign-up" target="_blank" rel="noopener noreferrer">Create a Novu account</a> or <a href="https://dashboard.novu.co/auth/sign-in" target="_blank" rel="noopener noreferrer">sign in</a> to access the Novu dashboard.
3132
</Step>
3233

3334
<Step>
34-
### Create a React application
35-
Create a new React app with [Vite](https://vite.dev/guide/#scaffolding-your-first-vite-project) using the command below. Skip this step if you already have an existing project:
35+
### Create a React app using Vite
36+
Run the following command to create a new React app using [Vite](https://vite.dev/guide/#scaffolding-your-first-vite-project):
3637

3738
```package-install
38-
npm create vite@latest my-app -- --template react-ts
39+
npm create vite@latest novu-inbox-react -- --template react-ts
40+
cd novu-inbox-react
41+
npm install
42+
npm run dev
3943
```
4044

4145
</Step>
4246

4347
<Step>
44-
### Install the required packages
45-
Run the command below to install [Novu React SDK](/platform/sdks/react), which provides React components for building notification UIs and React Router Dom:
48+
### Install `@novu/react`
49+
The [Novu React SDK](/platform/sdks/react) gives you access to the Inbox component.
50+
51+
Run the following command to install the SDK and React Router Dom:
4652

4753
```package-install
4854
npm install @novu/react react-router-dom
@@ -54,29 +60,9 @@ This guide walks you through integrating Novu’s Inbox into your React applicat
5460
### Create the Inbox component
5561
In the `src` directory, create a `components/notification-center.tsx` file and use the <Method href="/platform/inbox/react/components/inbox">{`<Inbox />`}</Method> component, passing :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."}:
5662

57-
```tsx title="src/components/notification-center.tsx"
58-
import React from 'react';
59-
import { Inbox } from '@novu/react';
60-
import { useNavigate } from 'react-router';
61-
62-
export function NotificationCenter() {
63-
const navigate = useNavigate();
64-
65-
return (
66-
<Inbox
67-
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
68-
subscriber="YOUR_SUBSCRIBER_ID"
69-
routerPush={(path: string) => navigate(path)}
70-
/>
71-
);
72-
}
73-
```
74-
75-
<div className="text-sm text-gray-500 text-center mt-[-12px]">
76-
[Sign in](https://dashboard.novu.co/auth/sign-up) to get your own API keys
77-
</div>
63+
<CodeTemplateBlock templateId="react-inbox" />
7864

79-
If you’re signed in to your Novu account, then the :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."} are automatically entered in the code sample above. Otherwise, you can manually retrieve them:
65+
If you’re signed in to your Novu account, then the :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."} are automatically entered in the code sample above. Otherwise, you can manually retrieve them:
8066
* `applicationIdentifier` – In the Novu dashboard, click API Keys, and then locate your unique Application Identifier.
8167
* `subscriberId` – This represents a user in your system (typically the user's ID in your database). For quick start purposes, an auto-generated subscriberId is provided for your Dashboard user.
8268

content/docs/platform/quickstart/remix.mdx

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,19 @@ import {
2121
Palette,
2222
Workflow
2323
} from 'lucide-react';
24+
import { CodeTemplateBlock } from '@/components/quickstart/inbox-code';
2425

2526
This guide walks you through integrating Novu’s Inbox into your Remix application for in-app notifications in real-time, from setup to triggering your first notification. By the end, you'll have a working notification inbox.
2627

2728
<Steps>
2829
<Step>
2930
### Create a Novu account
30-
[Create a Novu account](https://dashboard.novu.co/auth/sign-up) or [sign in](https://dashboard.novu.co/auth/sign-in) to an existing account
31+
<a href="https://dashboard.novu.co/auth/sign-up" target="_blank" rel="noopener noreferrer">Create a Novu account</a> or <a href="https://dashboard.novu.co/auth/sign-in" target="_blank" rel="noopener noreferrer">sign in</a> to access the Novu dashboard.
3132
</Step>
3233

3334
<Step>
3435
### Create a Remix application
35-
Create a new Remix app using the command below. Skip this step if you already have an existing project:
36+
Run the following command to create a new Remix app:
3637

3738
```package-install
3839
npx create-remix@latest
@@ -41,7 +42,11 @@ This guide walks you through integrating Novu’s Inbox into your Remix applicat
4142
</Step>
4243

4344
<Step>
44-
### Install Novu’s inbox package
45+
### Install `@novu/react`
46+
The [Novu React SDK](/platform/sdks/react) gives you access to the Inbox component.
47+
48+
Run the following command to install the SDK:
49+
4550
```package-install
4651
npm install @novu/react
4752
```
@@ -51,27 +56,7 @@ This guide walks you through integrating Novu’s Inbox into your Remix applicat
5156
### Create an Inbox component
5257
In the `app` directory, create a `components/notification-center.tsx` file and use the <Method href="/platform/inbox/react/components/inbox">{`<Inbox />`}</Method> component, passing :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."}:
5358

54-
```tsx title="app/components/notification-center.tsx"
55-
import React from 'react';
56-
import { Inbox } from '@novu/react';
57-
import { useNavigate } from '@remix-run/react';
58-
59-
export function NotificationCenter() {
60-
const navigate = useNavigate();
61-
62-
return (
63-
<Inbox
64-
applicationIdentifier="YOUR_APPLICATION_IDENTIFIER"
65-
subscriber="YOUR_SUBSCRIBER_ID"
66-
routerPush={(path: string) => navigate(path)}
67-
/>
68-
);
69-
}
70-
```
71-
72-
<div className="text-sm text-gray-500 text-center mt-[-12px]">
73-
[Sign in](https://dashboard.novu.co/auth/sign-up) to get your own API keys
74-
</div>
59+
<CodeTemplateBlock templateId="remix-inbox" />
7560

7661
If you’re signed in to your Novu account, then the :tooltip[applicationIdentifier]{label="The application identifier is a unique identifier for your application. You can find it in the Novu Dashboard under the API keys page."} and :tooltip[subscriberId]{label="The subscriber ID is the unique identifier for the user in your application, typically the user's id in your database."} are automatically entered in the code sample above. Otherwise, you can manually retrieve them:
7762
* `applicationIdentifier` – In the Novu dashboard, click API Keys, and then locate your unique Application Identifier.

0 commit comments

Comments
 (0)