Quick Start

Get up and running with GoodLogs in under 2 minutes. No infrastructure to set up — just install the SDK and start tracking.

1. Install the SDK

bash
npm install @aj-2000-test/goodlogs-sdk

2. Initialize

typescript
import { GoodLogs } from "@aj-2000-test/goodlogs-sdk"

const gl = new GoodLogs({
  apiKey: "gl_pk_your_key_here",
  // Opt into the unified APM pipeline (errors, traces, web vitals).
  useEnvelope: true,
})

Get your API key from Dashboard → Settings → API Keys.

With useEnvelope: true the browser SDK automatically:

  • wraps every fetch() call as a span (op:http.client) and injects a W3C traceparent header,
  • collects Core Web Vitals (LCP / INP / CLS / FCP / TTFB) via PerformanceObserver,
  • captures window.onerror, unhandled rejections, and console errors as Issues.

3. Track Events

typescript
gl.track("signup", { plan: "pro", source: "landing_page" })

4. Send Logs

typescript
gl.error("Payment failed", {
  orderId: "ord_123",
  error: "card_declined",
  service: "billing",
})

5. Capture Exceptions

typescript
try {
  await chargeCard()
} catch (e) {
  gl.captureException(e, { tags: { feature: "checkout" } })
}

Errors are fingerprinted and grouped into Issues in the dashboard. Duplicates bump the event count instead of creating new issues. If you resolve an issue and the same error appears on a later release, it's automatically flipped to regressed.

6. Trace a slow flow

typescript
const tx = gl.startTransaction({ name: "/checkout", op: "ui.action" })
const span = tx.startChild({ op: "http.client", description: "POST /pay" })
await fetch("/api/pay", { method: "POST" })
span.finish()
tx.finish()

Open Dashboard → Performance for endpoint latency (p50/p95/p99) and slow traces. Click a trace to see the waterfall.

7. View in Dashboard

PageWhat you'll see
IssuesGrouped exceptions with stack traces, breadcrumbs, and trace links
PerformanceEndpoints sorted by p95, Core Web Vitals tiles, recent slow traces
Trace (/dashboard/traces/<id>)Span waterfall with attributes and events
Web VitalsLCP / INP / CLS rating distributions, slowest pages per metric
Session ReplayDOM recordings of user sessions with linked console/network/errors
ProfilingCPU flamegraph, top functions by self-time, profile chunk list
ExplorerAd-hoc GQL across logs, events, errors, spans, web_vitals
AI DebugPlain-English questions answered with GQL

Tip: The SDK auto-batches and flushes every 5 seconds. On page close, it uses navigator.sendBeacon to ensure no data is lost.

Zero-config path: Even without captureException / startTransaction calls in your code, GoodLogs background workers automatically:

  • synthesise Issues from any log at severity:error or severity:fatal,
  • synthesise traces from logs that share a request_id / correlation_id property — useful when migrating from plain logging.