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
- 1Create a free account and set up your first project.
- 2Copy your project's DSN from the project settings page.
- 3Install the SDK for your platform (JavaScript, PHP, or Laravel) and initialise it with your DSN.
- 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
npm install @pantree/js --save2. 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.
import Pantree from "@pantree/js";
Pantree.init({
dsn: "YOUR_DSN_HERE",
environment: "production",
});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();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.
/api/health-reportIngest an error report. Requests must be authenticated with your project's DSN passed in the X-Pantree-DSN header.
Request headers
| Header | Required | Description |
|---|---|---|
| X-Pantree-DSN | Yes | Your project DSN from settings |
| Content-Type | Yes | application/json |
Request body
| Field | Type | Description |
|---|---|---|
| message | string | Short error title or exception message |
| stack | string | Full stack trace (optional but recommended) |
| environment | string | e.g. "production", "staging" |
| release | string | App version or git SHA (optional) |
| user | object | { id, email } identifying the affected user (optional) |
| extra | object | Arbitrary key/value context (optional) |
Example request
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
{ "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.
