npm package: @prisma/extension-pulse
Description: Prisma Client extension for Pulse
Latest version: 1.2.2
Deprecated: As part of our ongoing efforts to enhance our products and focus on delivering the best possible solutions, we have decided to temporarily pause Pulse. We received valuable feedback which is guiding us to revisit and redesign Pulse to better meet our user’s needs.

# Pulse Prisma Client extension

This is the package for the [Prisma Client extension](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions?utm_source=github&utm_medium=pulse-readme) that enables usage of [Prisma Pulse](https://www.prisma.io/data-platform/pulse?utm_source=github&utm_medium=pulse-readme).

## What is Prisma Pulse?

[Prisma Pulse](https://www.prisma.io/data-platform/pulse?utm_source=github&utm_medium=pulse-readme) is a managed Change Data Capture (CDC) service that makes it easy to react to changes in your databases with type-safe model streams.

It enables developers to build real-time apps by streaming database changes into their application in a type-safe way — with just a few lines of code:

```ts
// 1. Subscribe to all changes on the `User` table
const stream = await prisma.user.stream();

// 2. Wait for changes to happen in the DB so that new events arrive
for await (let event of stream) {
  // 3. Do something with an event, e.g. log the its details to the terminal
  console.log(`Something happened in the database: `, event);
}
```

Here is an overview of the main features Prisma Pulse provides:

- Type-safe reactions to database changes
- Delivery guarantees for events: "at least once" and in the "right order"
- Resumable event streams in case your server goes down
- Unidirectional data flow via Change Data Capture (CDC)
- Great DX integrated with usage of Prisma ORM (easy setup, development and maintenance)
- Compatibility with your existing database
- Insights dashboard, so you can view and understand all database events captured by Pulse

## Get started

[**Get started with Prisma Pulse**](https://www.prisma.io/docs/data-platform/pulse/getting-started?utm_source=github&utm_medium=pulse-readme) by following the instructions in the docs.

If you want to learn more about Pulse, you can also check out these resoures:

- [Documentation](https://www.prisma.io/docs/data-platform/pulse/what-is-pulse?utm_source=github&utm_medium=pulse-readme)
- [Console](https://console.prisma.io/login?utm_source=github&utm_medium=pulse-readme)
- Examples
  - [Starter project](https://github.com/prisma/pulse-starter)
  - [Server that sends onboarding emails with Resend](https://github.com/prisma/pulse-chat-mono)
  - Simple chat app (Coming soon)
  - Fullstack leaderboard app (Coming soon)

## Important

### Using [`"moduleResolution": "bundler"`](https://www.typescriptlang.org/docs/handbook/modules/reference.html#bundler)

The Prisma Pulse extension offers separate implementations tailored for various runtimes, such as Node.js and Cloudflare Workers. If you're using [bundler moduleResolution](https://www.typescriptlang.org/docs/handbook/modules/reference.html#bundler) in your TSConfig, you must also explicitly set [customConditions](https://www.typescriptlang.org/tsconfig#customConditions) to either `node` or `workerd` depending on your target runtime. This will instruct TypeScript to match the correct type definitions of the Prisma Pulse extension, as well as any other packages that expose multiple entrypoints.

```js
// tsconfig.json
{
  "compilerOptions": {
    // ...other options
    "target": "es2022",
    "moduleResolution": "bundler",
    "customConditions": ["workerd"] // or "node"
  }
}
```

## Resources

- [Pulse examples](https://pris.ly/pulse-examples)
- [Pulse documentation](https://pris.ly/pulse-docs)
- [Prisma Discord](https://pris.ly/discord)