Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/tutorials/webhooks/liveblocks-get-secret-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/pages/get-started/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ collaboration to your JavaScript application using the APIs from the

Every package should use the same version.

```bash
```bash trackEvent="install_liveblocks"
npm install @liveblocks/client
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
meta:
title: "Get started with AI Copilots using Liveblocks and Next.js"
title: "Get started with an AI chat using Liveblocks and Next.js"
parentTitle: "Quickstart"
description:
"Learn how to get started with AI Copilots using Liveblocks and Next.js"
"Learn how to get started with an AI chat using Liveblocks and Next.js"
---

Liveblocks is a realtime collaboration infrastructure for building performant
Expand All @@ -22,7 +22,7 @@ components from

Every package should use the same version.

```bash
```bash trackEvent="install_liveblocks"
npm install @liveblocks/client @liveblocks/react @liveblocks/react-ui @liveblocks/node
```

Expand Down
7 changes: 4 additions & 3 deletions docs/pages/get-started/nextjs-blocknote.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
meta:
title: "Get started with Liveblocks, BlockNote, and Next.js"
title: "Get started with a BlockNote text editor using Liveblocks and Next.js"
parentTitle: "Quickstart"
description:
"Learn how to get started with Liveblocks, BlockNote, and Next.js."
"Learn how to get started with a BlockNote text editor using Liveblocks and
Next.js."
---

Liveblocks is a realtime collaboration infrastructure for building performant
Expand All @@ -21,7 +22,7 @@ package.

Every Liveblocks package should use the same version.

```bash
```bash trackEvent="install_liveblocks"
npm install @liveblocks/client @liveblocks/react @liveblocks/react-ui @liveblocks/react-blocknote @blocknote/core @blocknote/react @blocknote/mantine
```

Expand Down
6 changes: 3 additions & 3 deletions docs/pages/get-started/nextjs-comments.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
meta:
title: "Get started with Comments using Liveblocks and Next.js"
title: "Get started with commenting using Liveblocks and Next.js"
parentTitle: "Quickstart"
description:
"Learn how to get started with Comments using Liveblocks and Next.js"
"Learn how to get started with commenting using Liveblocks and Next.js"
---

Liveblocks is a realtime collaboration infrastructure for building performant
Expand All @@ -22,7 +22,7 @@ components from

Every package should use the same version.

```bash
```bash trackEvent="install_liveblocks"
npm install @liveblocks/client @liveblocks/react @liveblocks/react-ui
```

Expand Down
8 changes: 5 additions & 3 deletions docs/pages/get-started/nextjs-lexical.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
meta:
title: "Get started with Liveblocks, Lexical, and Next.js"
title: "Get started with a Lexical text editor using Liveblocks and Next.js"
parentTitle: "Quickstart"
description: "Learn how to get started with Liveblocks, Lexical, and Next.js"
description:
"Learn how to get started with a Lexical text editor using Liveblocks and
Next.js"
---

Liveblocks is a realtime collaboration infrastructure for building performant
Expand All @@ -20,7 +22,7 @@ package.

Every Liveblocks package should use the same version.

```bash
```bash trackEvent="install_liveblocks"
npm install @liveblocks/client @liveblocks/react @liveblocks/react-ui @liveblocks/react-lexical lexical @lexical/react
```

Expand Down
139 changes: 139 additions & 0 deletions docs/pages/get-started/nextjs-notifications-custom-email.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
meta:
title:
"Get started with emailing custom notifications using Liveblocks and Next.js"
parentTitle: "Quickstart"
description:
"Learn how to email custom notifications using using Liveblocks Liveblocks
and Next.js"
---

Liveblocks is a realtime collaboration infrastructure for building performant
collaborative experiences. Follow this guide to send
[custom notifications](/docs/ready-made-features/notifications/concepts#Custom-notifications)
to email using methods from
[`@liveblocks/node`](/docs/api-reference/liveblocks-node).

## Quickstart

<Steps>
<Step>
<StepTitle>Install Liveblocks Node</StepTitle>
<StepContent>

Every Liveblocks package should use the same version.

```bash trackEvent="install_liveblocks"
npm install @liveblocks/node
```

</StepContent>

</Step>

<Step>
<StepTitle>Trigger a custom notification</StepTitle>
<StepContent>

Trigger a custom notification using
[`triggerInboxNotification`](/docs/api-reference/liveblocks-node#post-inbox-notifications-trigger)
from a server action or route handler. In this example, a custom `$fileUploaded` notification is sent.

```ts
"use server";

import { Liveblocks } from "@liveblocks/node";

const liveblocks = new Liveblocks({
secret: "{{SECRET_KEY}}",
});

// Call this in your app to create a custom notification
export async function triggerCustomNotification() {
// +++
await liveblocks.triggerInboxNotification({
// The user that will receive the notification
userId: "steven@example.com",
kind: "$fileUploaded",
subjectId: "my-file",

// Custom data for this notification
activityData: {
file: "https://example.com/my-file.zip",
status: "pending",
},
});
// +++
}
```
</StepContent>

</Step>

<Step lastStep>
<StepTitle>Follow our guide</StepTitle>
<StepContent>

Follow our step-by-step guide to learn set up email notifications.

<Button asChild className="not-markdown">
<a href="/docs/guides/how-to-notify-users-about-unread-custom-notifications-outside-of-your-app">
How to notify users with email
</a>
</Button>

</StepContent>

</Step>
</Steps>

## What to read next

Congratulations! You've set up Email notifications in your Next.js application.

- [Webhooks API reference](/docs/platform/webhooks)
- [Node.js API reference](/docs/api-reference/liveblocks-node)
- [How to test webhooks on localhost](/docs/guides/how-to-test-webhooks-on-localhost)

---

## Examples using Notifications

<ListGrid columns={2}>
<ExampleCard
example={{
title: "Custom notifications",
slug: "notifications-custom/nextjs-notifications-custom",
image: "/images/examples/thumbnails/custom-notifications.png",
}}
technologies={["nextjs", "react"]}
openInNewWindow
/>
<ExampleCard
example={{
title: "Notification settings",
slug: "notification-settings/nextjs-notification-settings",
image: "/images/examples/thumbnails/notification-settings.png",
}}
technologies={["nextjs", "react"]}
openInNewWindow
/>
<ExampleCard
example={{
title: "Notion-like AI Editor",
slug: "notion-like-ai-editor/nextjs-notion-like-ai-editor",
image: "/images/examples/thumbnails/notion-like-ai-editor.png",
}}
technologies={["nextjs", "react"]}
openInNewWindow
/>
<ExampleCard
example={{
title: "Comments notifications",
slug: "https://liveblocks.io/examples/comments-emails",
image: "/images/examples/thumbnails/comments-notifications.png",
}}
technologies={["nextjs", "react"]}
openInNewWindow
/>
</ListGrid>
Loading
Loading