Pantree Documentation

Pantree helps engineering teams catch exceptions early, group related errors automatically, and ship fixes with confidence. This guide walks you through installing the SDK, configuring your DSN, and reviewing the HTTP ingest API.

Quick start

  1. 1Create a free account and set up your first project.
  2. 2Copy your project's DSN from the project settings page.
  3. 3Install the SDK for your platform (JavaScript, PHP, or Laravel) and initialise it with your DSN.
  4. 4Deploy and trigger a test error — it will appear in your Issues feed within seconds.

SDK Installation

Choose your platform to see the matching install and configuration steps.

1. Install the package

terminal
npm install @pantree/js --save

2. Initialise the SDK

Initialise Pantree as early as possible in your application's lifecycle. Replace YOUR_DSN_HERE with the DSN from your project settings.

TypeScript
instrument.ts
import Pantree from "@pantree/js";

Pantree.init({
  dsn: "YOUR_DSN_HERE",
  environment: "production",
});
TypeScript
main.ts
import "./instrument"; // must be first

import { NestFactory } from "@nestjs/core";
import { AppModule } from "./app.module";

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  await app.listen(3000);
}
bootstrap();
Note: Import instrument.ts at the very top of your entry file before any other imports so the SDK can register global error handlers.

API Reference

You can send events directly over HTTP if you prefer to build a custom integration.

POST/api/health-report

Ingest an error report. Requests must be authenticated with your project's DSN passed in the X-Pantree-DSN header.

Request headers

HeaderRequiredDescription
X-Pantree-DSNYesYour project DSN from settings
Content-TypeYesapplication/json

Request body

FieldTypeDescription
messagestringShort error title or exception message
stackstringFull stack trace (optional but recommended)
environmentstringe.g. "production", "staging"
releasestringApp version or git SHA (optional)
userobject{ id, email } identifying the affected user (optional)
extraobjectArbitrary key/value context (optional)

Example request

Shell
curl
curl -X POST https://your-app.com/api/health-report \
  -H "Content-Type: application/json" \
  -H "X-Pantree-DSN: YOUR_DSN_HERE" \
  -d '{
    "message": "TypeError: Cannot read properties of undefined",
    "stack": "TypeError: Cannot read properties of undefined\n    at processOrder (/app/orders.js:42:12)",
    "environment": "production",
    "release": "v2.4.1",
    "user": { "id": "user_7821", "email": "alice@example.com" }
  }'

Response

JSON
{ "ok": true, "issueId": "iss_abc123" }

Core Concepts

DSN (Data Source Name)

A unique URL that identifies your project and authenticates SDK requests. Find yours under Dashboard → Settings → Projects → your project.

Issue

A grouped set of related error events. Pantree fingerprints incoming events by message and stack frame so repeated crashes merge into a single issue rather than flooding your feed.

Environment

A label attached to each event (e.g. "production", "staging"). You can filter the Issues feed by environment to avoid production noise from dev or staging releases.

Release

An optional version string or git SHA. Attaching a release to events lets you see which deploy introduced a regression.

Issue status

Issues move between three states: Unresolved (new or recurring), Resolved (fixed), and Ignored (acknowledged but snoozed). Only users with the required role can update status.

Health Report

The raw ingest payload sent by an SDK or direct HTTP call. Each health report is verified with an HMAC signature derived from your DSN secret before being stored.

Ready to connect your first project?

Create a free account and have your first error report arriving in minutes.

Pantree | Error Monitoring