> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alerty.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Node

> Track and monitor your Node application with Alerty

Alerty SDK is a powerful monitoring tool designed, built, and priced for the needs of developers and founders. It helps you monitor your applications, track errors, and ensure your software runs smoothly.

## Features

* **Error Monitoring:** Automatically captures errors and their stack traces.
* **Service Monitoring:** Monitors the health and performance of your services.
* **Customizable Alerts:** Set up alerts to notify you when something goes wrong.
* **Lightweight and Fast:** Designed to be efficient with minimal overhead.

## Tutorial Video

[![Monitoring for Javascript](https://img.youtube.com/vi/zExRVM85REs/0.jpg)](https://youtu.be/zExRVM85REs)

## Getting Started

You can install the [Alerty SDK](https://www.npmjs.com/package/@alerty/node) via npm:

```sh theme={null}
npm install @alerty/node
```

To start using Alerty SDK, initialize it in your project:

```javascript theme={null}
import * as Alerty from "@alerty/node";

Alerty.configure({
  dsn: "__YOUR_DSN__",
});
```

### Database Monitoring

If you also want to monitor your database, Alerty integrates with the following ORM libraries:

#### Prisma

First, in the generator block of your `schema.prisma` file, enable the `tracing` feature flag:

```javascript theme={null}
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["tracing"]
}
```

Install the instrumentation dependency:

```sh theme={null}
npm install @prisma/instrumentation@latest --save
```

Add `PrismaInstrumentation` to the `instrumentations` option and capture the `error` events:

```javascript theme={null}
import { PrismaInstrumentation } from '@prisma/instrumentation'

// ...

Alerty.configure({
  dsn: "__YOUR_DSN__",
  instrumentations: [new PrismaInstrumentation()],
});

export const prisma = new PrismaClient({
  log: [
    {
      emit: "event",
      level: "error"
    }
  ]
});

prisma.$on("error", (e) => {
  Alerty.captureError(
    new PrismaClientUnknownRequestError(e.message, {
      clientVersion: Prisma.prismaVersion.client,
    }),
  );
});
```

Data should be flowing now!
