Browser SDK

Error monitoring for Deno

A native Deno module — import from JSR, no build step. It hooks global errors and unhandled rejections and reads its config from the environment.

Frameworks Deno runtimeRequires Deno 1.40+Package @errorgap/denoSource ↗Package ↗Agent guide ↗
Install

Install

Import directly from JSR, or add it to your import map:

sh
deno add jsr:@errorgap/deno
Configure

Configure

ts
import { Errorgap } from "@errorgap/deno";

Errorgap.init({
  endpoint:    Deno.env.get("ERRORGAP_ENDPOINT")!,
  projectSlug: Deno.env.get("ERRORGAP_PROJECT_SLUG")!,
  apiKey:      Deno.env.get("ERRORGAP_API_KEY"),
});

init hooks globalThis.error and globalThis.unhandledrejection. Run with --allow-net=<errorgap-host> and --allow-env.

Keep the key in an environment variable (or your framework's secret store) — never commit it to source control.
Trigger a test error

Trigger a test error

ts
throw new Error("Errorgap test error");
Verify

Verify the connection

Confirm your key and endpoint reach errorgap before wiring anything else — send one event straight to the ingestion API:

bash
curl -sS -X POST "$ERRORGAP_ENDPOINT/api/projects/$ERRORGAP_PROJECT_SLUG/notices" \
  -H "content-type: application/json" \
  -H "x-errorgap-project-key: $ERRORGAP_API_KEY" \
  -d '{"errors":[{"type":"ErrorgapInstallTest","message":"Errorgap install verification"}]}'

A 201 with a group_id means ingestion works (202 = received but sampled; 401 = wrong key). Then trigger the test error above through the SDK. Your onboarding screen's Verify step checks the stack off automatically once the first event lands — it polls every three seconds.

Next: the full ingestion API, or browse every SDK.