Documentation

Everything you need to integrate Glitchgrab into your Next.js app.

This page is the SDK reference. For the Chrome extension, QA testers, call recording, the AI report assistant and MCP for Claude, see the step-by-step guides.

This page covers the SDK. Step-by-step guides for everything else — the Chrome extension, QA testers, call recording, the AI report assistant, MCP for Claude — are at glitchgrab.dev/guides.

How do I install Glitchgrab?

bash
npm install glitchgrab
# or
bun add glitchgrab

How do I get a token?

1. Sign in at glitchgrab.dev/login with GitHub. 2. Connect your GitHub org and install the Glitchgrab GitHub App on the repo that should receive issues. 3. Open API Tokens, pick the repo and create a token. It starts with gg_. 4. Put it in your environment as NEXT_PUBLIC_GLITCHGRAB_TOKEN.

With screenshots: Connect your GitHub org and Create an API token.

How do I get started?

Wrap your app with GlitchgrabProvider:

tsx
// app/layout.tsx
import { GlitchgrabProvider } from "glitchgrab";

export default function RootLayout({ children }) {
  return (
    <GlitchgrabProvider token={process.env.NEXT_PUBLIC_GLITCHGRAB_TOKEN!}>
      {children}
    </GlitchgrabProvider>
  );
}

How does user session tracking work?

Pass a session prop so bug reports include the reporter's identity. This lets you trace which user reported each bug.

tsx
import { GlitchgrabProvider, type GlitchgrabSession } from "glitchgrab";
import { useSession } from "next-auth/react"; // or your auth library

function Providers({ children }) {
  const { data: authSession } = useSession();

  // Map your auth session to GlitchgrabSession
  const session: GlitchgrabSession | null = authSession?.user
    ? {
        userId: authSession.user.id,     // required - your DB primary key
        name: authSession.user.name,     // required - display name
        email: authSession.user.email,   // optional
        phone: authSession.user.phone,   // optional
      }
    : null;

  return (
    <GlitchgrabProvider
      token={process.env.NEXT_PUBLIC_GLITCHGRAB_TOKEN!}
      session={session}
    >
      {children}
    </GlitchgrabProvider>
  );
}

GlitchgrabSession type

ts
interface GlitchgrabSession {
  userId: string;          // required - primary key from your database
  name: string;            // required - reporter's display name
  email?: string | null;   // optional
  phone?: string | null;   // optional
  signature?: string | null; // optional - signSession() from "glitchgrab/server"
  [key: string]: unknown;  // any extra fields
}

The userId is stored with every report. Use it to look up which user reported a bug in your own database.

How do I protect my token?

Your gg_ token ships in your app's JavaScript, so anyone can copy it. That is by design — it can only file reports into one repo — but the AI features (the assistant, AI enhance, voice input, "already reported?") cost money on every call. Three things stop a copied token being abused:

  • •Rate limits. Every token route is limited per token and per IP address. Nothing to configure.
  • •Allowed domains. On the Tokens page, list the sites allowed to use a token from a browser (https://app.example.com — subdomains are included). Requests from any other website are refused. Empty means any site. A server-side script can fake the Origin header, so this stops the token being pasted into another website, not a determined attacker. Report filing from glitchgrab/server, MCP and CI is never affected.
  • •Signed users. On the repo card, generate a signing secret and set Signed users to *Warn* or *Enforce*. Your server signs the logged-in user's id; the SDK sends that signature with its AI requests.
tsx
// app/layout.tsx — a server component
import { signSession } from "glitchgrab/server";
import { auth } from "@/lib/auth"; // your auth library
import { Providers } from "./providers";

export default async function RootLayout({ children }: { children: React.ReactNode }) {
  const user = (await auth())?.user;

  const session = user
    ? {
        userId: user.id,
        name: user.name ?? "User",
        email: user.email,
        // Reads GLITCHGRAB_SIGNING_SECRET. Server env only — never NEXT_PUBLIC_.
        signature: signSession({ userId: user.id }),
      }
    : null;

  return <Providers session={session}>{children}</Providers>;
}

// app/providers.tsx — "use client"
// <GlitchgrabProvider token={process.env.NEXT_PUBLIC_GLITCHGRAB_TOKEN!} session={session}>
ModeSigned userUnsigned or anonymous caller
Offeverything workseverything works
Warneverything workseverything works; the SDK logs a warning in development
Enforceeverything worksAI features are hidden — the plain report form still files
  • •A signature lasts 24 hours by default (signSession({ userId, ttlSeconds })). Build it per request so it refreshes.
  • •Rotating the secret breaks signatures already issued until your pages render again with the new one.
  • •signSession throws when the secret or userId is missing — it runs on your server, where that is a deploy mistake worth seeing. The rest of the SDK never throws.

What data does Glitchgrab collect about reporters?

Besides what the reporter types and the session you pass, every report records the IP address it came from, an approximate location (city, region, country) and the network (ISP / ASN). Only you, the repo owner, can see it in Glitchgrab — it is never written into the GitHub issue. The raw IP is deleted after 90 days; a one-way hash, the location and the network are kept so repeat reports from one address can still be grouped.

Reports sent from glitchgrab/server record your server's address, not an end user's.

If your users are in India or the EU, mention this in your privacy policy (DPDP Act / GDPR treat an IP address as personal data).

How do I add a report button?

Default floating button

tsx
import { ReportButton } from "glitchgrab";

// Floating button at bottom-right (default)
<ReportButton position="bottom-right" label="Report Bug" />

Custom trigger (headless)

Use the render prop to bring your own button UI:

tsx
import { ReportButton } from "glitchgrab";

<ReportButton>
  {({ onClick, capturing }) => (
    <button onClick={onClick} disabled={capturing}>
      {capturing ? "Capturing..." : "Report a Bug"}
    </button>
  )}
</ReportButton>

The modal handles screenshot capture, preview, upload, retake, and submission. Your custom button just triggers it.

How do I report bugs programmatically?

Use the useGlitchgrab hook to report bugs from code:

tsx
import { useGlitchgrab } from "glitchgrab";

function MyComponent() {
  const { reportBug, report, addBreadcrumb, openReportDialog } = useGlitchgrab();

  // Report a bug silently (no UI)
  await reportBug("Button not working on mobile");

  // Report with a specific type
  await report("FEATURE_REQUEST", "Add dark mode support");

  // Open the Report Bug modal (captures screenshot + shows dialog)
  openReportDialog();

  // Open with pre-filled description
  openReportDialog({ description: "Error on /settings: Something went wrong" });

  // Add custom breadcrumbs for debugging context
  addBreadcrumb("User clicked checkout", { cartSize: "3" });
}

Open report dialog on bad feedback

tsx
function FeedbackWidget() {
  const { openReportDialog } = useGlitchgrab();

  return (
    <div>
      <button onClick={() => alert("Thanks!")}>Good</button>
      <button onClick={() => openReportDialog()}>Bad — report a bug</button>
    </div>
  );
}

Note: openReportDialog() requires a to be mounted somewhere in the component tree. It triggers the same modal with screenshot capture.

How do I collect feedback about my app?

Reports are for bugs. Feedback is for how your users feel about your app — a 1–5 star rating with an optional message. Glitchgrab stores it, so you don't write a table, a route, or a migration. Feedback never becomes a GitHub issue.

Drop-in button

tsx
import { FeedbackButton } from "glitchgrab";

<FeedbackButton />                              // floating, bottom-left
<FeedbackButton position="bottom-right" label="Rate us" />

// Your own trigger
<FeedbackButton>
  {({ onClick }) => <button onClick={onClick}>How are we doing?</button>}
</FeedbackButton>

The dialog (stars + message) ships inside GlitchgrabProvider — the button is only the trigger. Open it from anywhere with openFeedbackDialog().

Your own UI

tsx
function RatingRow() {
  const { sendFeedback } = useGlitchgrab();

  return [1, 2, 3, 4, 5].map((stars) => (
    <button key={stars} onClick={() => sendFeedback(stars, "Loved the new export flow")}>
      {stars}★
    </button>
  ));
}

sendFeedback(rating, message?, metadata?) never throws — it returns null on failure. The reporter is taken from the session prop on GlitchgrabProvider, so pass a session if you want to know who rated you.

Reading it back

Every entry shows up on your Glitchgrab Feedback page, where you press publish on the ones you want to reuse. Published entries are the only ones returned with approvedOnly — so a testimonials wall can never leak an unvetted complaint:

tsx
import { useGlitchgrabFeedback } from "glitchgrab";

function Testimonials() {
  const { feedback, isLoading } = useGlitchgrabFeedback({
    token: process.env.NEXT_PUBLIC_GLITCHGRAB_TOKEN!,
    approvedOnly: true,
    minRating: 4,
  });

  if (isLoading) return null;

  return feedback.map((f) => (
    <blockquote key={f.id}>
      {f.message} — {f.reporterName} ({f.rating}★)
    </blockquote>
  ));
}

Pass userId instead to show one user their own past ratings. fetchGlitchgrabFeedback(...) is the standalone fetcher for TanStack Query. Neither response includes email or phone, so both are safe to render on a public page.

REST

bash
# Submit
curl -X POST https://glitchgrab.dev/api/v1/sdk/feedback \
  -H "Authorization: Bearer gg_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"rating":5,"message":"Fast and simple","metadata":{"sessionUserId":"user_123","sessionUserName":"Asha"}}'

# Read published entries
curl "https://glitchgrab.dev/api/v1/sdk/feedback?approved=true&minRating=4&limit=20" \
  -H "Authorization: Bearer gg_xxxxx"

The repo is always derived from the token — there is no repoId to pass. Rate limit: 30 submissions per token per hour.

How do I save a lead without filing an issue?

A demo form or contact page asks a prospect for their details. Those are a lead, not a bug — submitLead() stores them in Glitchgrab and never creates a GitHub issue:

tsx
const { submitLead } = useGlitchgrab();

const result = await submitLead({
  name: "Asha Mehta",
  phone: "+91 98765 43210",
  source: "demo",               // which form — filter on it later
  email: "asha@firm.in",        // optional
  company: "Mehta & Co",        // optional
  address: "Pune",              // optional
  metadata: { practice: "CA", language: "Hindi" }, // optional, flat values
});
// { success: true, id: "…", created: true } — or null on failure. Never throws.

One lead per phone number per project: the same visitor submitting twice updates their lead (created: false) instead of adding a second row. Leads show under Calls → Leads in Glitchgrab, next to any demo the same phone or email went on to book. The owner can switch on a WhatsApp alert for each new lead there.

Read them in your own admin with the project's ggc_ server key — the same key as listBookings():

ts
import { listLeads } from "glitchgrab/server";

const leads = await listLeads({ source: "demo", since: "2026-09-01" }); // GLITCHGRAB_CALLS_KEY=ggc_…

What keyboard shortcuts are available?

Once GlitchgrabProvider is mounted, these shortcuts work globally:

ShortcutAction
Cmd+Shift+G / Ctrl+Shift+GOpen the report dialog
Cmd+V / Ctrl+V (dialog open)Paste a screenshot from clipboard
EscapeClose the dialog

No configuration needed — shortcuts are active as long as the provider is in the tree.

Showing the shortcut in your own UI

The report dialog shows the shortcut on its first step. To advertise it elsewhere — a support menu, a sidebar hint — read shortcutLabel instead of hardcoding the string. It resolves to ⌘⇧G on Mac and Ctrl+Shift+G everywhere else, and stays in sync with the handler:

tsx
function SupportHint() {
  const { shortcutLabel } = useGlitchgrab();
  return <p>Found a bug? Press {shortcutLabel} anywhere to report it.</p>;
}

It is SSR-safe: it renders Ctrl+Shift+G on the server and corrects to the platform label after mount.

How do I fetch reports by user?

tsx
import { useGlitchgrabReports } from "glitchgrab";

function MyReports() {
  const { reports, isLoading, error, refetch } = useGlitchgrabReports({
    token: process.env.NEXT_PUBLIC_GLITCHGRAB_TOKEN!,
    userId: session.user.id,        // your DB primary key
    limit: 20,                       // optional, default 100
  });

  if (isLoading) return <p>Loading...</p>;
  if (error) return <p>Error: {error}</p>;

  return (
    <ul>
      {reports.map((r) => (
        <li key={r.id}>
          {r.issue?.title ?? r.rawInput} — {r.issue?.githubState ?? r.status}
        </li>
      ))}
    </ul>
  );
}

With TanStack Query

tsx
import { fetchGlitchgrabReports } from "glitchgrab";
import { useQuery } from "@tanstack/react-query";

const { data: reports, isLoading } = useQuery({
  queryKey: ["glitchgrab-reports", session.user.id],
  queryFn: () => fetchGlitchgrabReports({
    token: process.env.NEXT_PUBLIC_GLITCHGRAB_TOKEN!,
    userId: session.user.id,
    limit: 50,
  }),
});

REST API

Use the REST API directly to fetch reports:

bash
# Fetch all reports
curl -H "Authorization: Bearer gg_your_token" \
  https://glitchgrab.dev/api/v1/sdk/reports

# Fetch reports by a specific user
curl -H "Authorization: Bearer gg_your_token" \
  "https://glitchgrab.dev/api/v1/sdk/reports?reporterPrimaryKey=user_123"

# Filter by status
curl -H "Authorization: Bearer gg_your_token" \
  "https://glitchgrab.dev/api/v1/sdk/reports?status=CREATED&limit=20"

Response

json
{
  "success": true,
  "data": [
    {
      "id": "cmn7abc123",
      "source": "SDK_USER_REPORT",
      "status": "CREATED",
      "rawInput": "Button not working",
      "reporterPrimaryKey": "user_123",
      "reporterName": "John Doe",
      "reporterEmail": "john@example.com",
      "reporterPhone": null,
      "pageUrl": "/dashboard/settings",
      "createdAt": "2026-03-26T12:00:00.000Z",
      "issue": {
        "githubNumber": 42,
        "githubUrl": "https://github.com/your/repo/issues/42",
        "title": "Button not working",
        "labels": ["bug"],
        "severity": "medium",
        "githubState": "open"
      }
    }
  ]
}

Response fields

FieldDescription
idReport ID — use this for managing issues
sourceSDK_AUTO (crash) or SDK_USER_REPORT (user clicked report)
statusPENDING, PROCESSING, CREATED, FAILED
reporterPrimaryKeyThe userId you passed in the session prop
reporterNameReporter's display name
issue.githubStateLive GitHub issue state: open, closed, or null if deleted
issue.labelsLabels on the GitHub issue (e.g., ["bug", "approved"])
issue.severityAI-assigned severity

## How do I approve, reject, or close issues?

### React hook

import { useGlitchgrabActions } from "glitchgrab";

function ReportActions({ reportId }: { reportId: string }) { const { approve, reject, close, isPending, error } = useGlitchgrabActions({ token: process.env.NEXT_PUBLIC_GLITCHGRAB_TOKEN!, onSuccess: () => refetch(), // refresh your reports list onError: (err) => alert(err.message), });

return (

{error &&

{error}

}
); }


### Dashboard

Go to **Reports > Product Issues**. Each open report shows:
- **Approve** — adds `approved` label to GitHub issue
- **Reject** — adds `rejected` label to GitHub issue
- **Close** — closes the GitHub issue

### REST API

`POST /api/v1/reports/{reportId}/actions`

Auth: `Bearer gg_` token or dashboard session.

#### Approve a report

curl -X POST \ -H "Authorization: Bearer gg_your_token" \ -H "Content-Type: application/json" \ -d '{"action": "label", "label": "approved"}' \ https://glitchgrab.dev/api/v1/reports/REPORT_ID/actions


#### Reject a report

curl -X POST \ -H "Authorization: Bearer gg_your_token" \ -H "Content-Type: application/json" \ -d '{"action": "label", "label": "rejected"}' \ https://glitchgrab.dev/api/v1/reports/REPORT_ID/actions


#### Close an issue

curl -X POST \ -H "Authorization: Bearer gg_your_token" \ -H "Content-Type: application/json" \ -d '{"action": "close"}' \ https://glitchgrab.dev/api/v1/reports/REPORT_ID/actions


#### Reopen an issue

curl -X POST \ -H "Authorization: Bearer gg_your_token" \ -H "Content-Type: application/json" \ -d '{"action": "reopen"}' \ https://glitchgrab.dev/api/v1/reports/REPORT_ID/actions


#### Remove a label

curl -X POST \ -H "Authorization: Bearer gg_your_token" \ -H "Content-Type: application/json" \ -d '{"action": "unlabel", "label": "rejected"}' \ https://glitchgrab.dev/api/v1/reports/REPORT_ID/actions


#### Add any custom label

curl -X POST \ -H "Authorization: Bearer gg_your_token" \ -H "Content-Type: application/json" \ -d '{"action": "label", "label": "high-priority"}' \ https://glitchgrab.dev/api/v1/reports/REPORT_ID/actions


### How to get the report ID

Use the [Fetching Reports API](#how-do-i-fetch-reports-by-user) to list reports. Each report has an `id` field — use that as `REPORT_ID`.

### How it works

1. End-user reports a bug via SDK -> GitHub issue created
2. You fetch reports via API or view on dashboard
3. Approve/reject/close via API or dashboard buttons
4. Labels and state sync directly to GitHub — GitHub is the source of truth

## How do I add comments to a report?

Each report has a conversation thread powered by GitHub issue comments. No extra database — comments live on GitHub.

### View a report with comments

curl -H "Authorization: Bearer gg_your_token" \ https://glitchgrab.dev/api/v1/sdk/reports/REPORT_ID


Returns the full issue body + all comments:

{ "success": true, "data": { "id": "cmn7abc123", "issue": { "title": "Button not working", "body": "## Description\n\nThe submit button...", "githubState": "open", "labels": ["bug"] }, "comments": [ { "author": "WebNaresh", "body": "Can you share your browser version?", "createdAt": "2026-03-27T10:00:00Z" }, { "author": "WebNaresh", "body": "It's Chrome 120 on Windows\n\n---\n> Commented by: Vivek (vivek@example.com)", "createdAt": "2026-03-27T10:05:00Z" } ] } }


### Reply to a report

curl -X POST \ -H "Authorization: Bearer gg_your_token" \ -H "Content-Type: application/json" \ -d '{"message": "I can reproduce this, fixing now", "reporterName": "Vivek", "reporterEmail": "vivek@example.com"}' \ https://glitchgrab.dev/api/v1/sdk/reports/REPORT_ID/comments


The comment is posted to the GitHub issue with attribution: "Commented by: **Vivek** (vivek@example.com)".

### Dashboard

Click any report on the Reports page to see the full conversation thread. Reply directly from the dashboard — comments sync to GitHub.

## How do I add an error boundary?

Wrap components to auto-capture React errors:

import { GlitchgrabErrorBoundary } from "glitchgrab";

Something went wrong

}>


⚠️ **This does not cover the Next.js App Router.** If your app has an `app/error.tsx`, Next's own boundary sits closer to the crashing component and catches first — `GlitchgrabErrorBoundary` never runs, and the crash is never reported. See [How do I capture App Router crashes?](#how-do-i-capture-app-router-crashes) below.

## How do I capture App Router crashes?

**Read this if you use `app/error.tsx` or `app/global-error.tsx` — otherwise your render crashes are silently lost.**

A React error that a boundary *handles* never reaches `window.onerror`, so provider auto-capture cannot see it. In an App Router app, Next's `error.tsx` is that boundary. The user sees the fallback screen, and the message and stack are gone.

Report it yourself with `captureError`:

// app/error.tsx "use client";

import { useEffect } from "react"; import { useGlitchgrab } from "glitchgrab";

export default function Error({ error, reset, }: { error: Error & { digest?: string }; reset: () => void; }) { const { captureError } = useGlitchgrab();

useEffect(() => { captureError(error, { digest: error.digest, boundary: "next-app-router" }); }, [error, captureError]);

return (

Something went wrong

); }


`global-error.tsx` replaces the root layout, so it renders **outside** the provider tree and `useGlitchgrab()` would throw. Use the standalone export there — it reads the token from the last mounted provider:

// app/global-error.tsx "use client";

import { useEffect } from "react"; import { captureError } from "glitchgrab";

export default function GlobalError({ error, }: { error: Error & { digest?: string }; }) { useEffect(() => { captureError(error, { digest: error.digest, boundary: "next-global-error" }); }, [error]);

return (

Something went wrong

); }


The same applies to React Router `errorElement`, Remix `ErrorBoundary`, and any hand-rolled `componentDidCatch` — call `captureError` from each.

### Catching every boundary error in one place (React 19)

React 19 lets you intercept *all* boundary-caught errors at the root, so you don't have to wire each boundary by hand:

// app/instrumentation-client.ts (or your custom hydrateRoot call) import { captureError } from "glitchgrab";

hydrateRoot(document, , { onCaughtError: (error, errorInfo) => { captureError(error, { componentStack: errorInfo.componentStack ?? undefined, boundary: "react-onCaughtError", }); }, });


Next.js does not expose `hydrateRoot` options, so App Router apps should use the `error.tsx` snippets above.

### captureError options

captureError(error: unknown, options?: { componentStack?: string; // from componentDidCatch / onCaughtError digest?: string; // Next.js error digest — also feeds dedup boundary?: string; // which boundary caught it, stored as metadata metadata?: Record; })


- Sends `source: "SDK_AUTO"`, `type: "BUG"` with the message, stack, component stack, breadcrumbs, device info, page URL and session identity — same shape as auto-capture.
- **Deduped.** An identical error repeating within 5 minutes files one issue, not N — a crash loop won't spam your repo.
- Honours the provider's `ignoreErrors`.
- Fire-and-forget. Never throws, never blocks your fallback UI from rendering.
- Runs in development too (unlike passive auto-capture), so you can verify the wiring the moment you add it.
- Pass `digest` whenever you have it. In production Next replaces server-boundary error messages with one generic string — without the digest, every distinct server crash on a page collapses into a single deduped issue.
- No-ops if no `GlitchgrabProvider` has rendered yet.

## How do I catch errors on the server (cron jobs, API routes, workers)?

Everything above is browser-side — it hooks `window.onerror` and needs a
rendered provider. A cron job at 3am has neither, so a nightly digest that
throws, an SMTP timeout, or a payment webhook a provider rejects is invisible
to it. `glitchgrab/server` is the same pipeline for code with no tab open.

GLITCHGRAB_TOKEN=gg_your_token

// app/api/cron/daily-digest/route.ts import { reportServerError } from "glitchgrab/server";

export async function GET() { try { await sendDigest(); return Response.json({ ok: true }); } catch (error) { await reportServerError(error, { context: "cron/daily-digest" }); throw error; } }


That is a GitHub issue with the message, the stack, the Node version and the
region — no browser, no screenshot, no provider.

**Await it.** On a serverless platform your function can be frozen the instant
the handler returns; a floating promise dies with it and the report never
leaves the machine.

### Reporting a failure that isn't a thrown error

The useful failures are often values, not exceptions — a provider that answers
`{ ok: false }`, a send the API rejects. Report those the same way:

const result = await sendWhatsApp(payload); if (!result.success) { await reportServerError(result.error, { context: "whatsapp/task-reminder", description: Template ${payload.template} rejected for ${payload.to}, severity: "high", }); }


### Attach the logs that led up to it

A stack says where a job broke; the lines it printed before that usually say
why. Pass them as `logs` — an array of lines or one string:

const lines: string[] = []; const log = (line: string) => { lines.push(line); console.log(line); };

try { log([filing] starting return ${returnId}); await submitReturn(returnId); } catch (error) { await reportServerError(error, { context: "worker/filing", logs: lines }); throw error; }


They arrive on the issue as a `.log` file named after `context`: the start is
previewed in the issue body, the whole file is kept for download. Only the last
200,000 characters are sent. Logs are not part of the grouping key — the same
error with different logs still lands on one issue.

### Set the token once

// instrumentation.ts import { configureServerReporter, captureServerErrors } from "glitchgrab/server";

export function register() { configureServerReporter({ token: process.env.GLITCHGRAB_TOKEN, metadata: { service: "web" }, });

// Optional: report every uncaught exception and unhandled rejection. captureServerErrors(); }


`captureServerErrors()` listens on `uncaughtExceptionMonitor`, which observes
without taking over — your process still crashes exactly as it would have. A
reporter that keeps a broken process alive is worse than no reporter.

### `context` is the grouping key

It is sent as the report's `pageUrl` (as `server://<context>`), and `pageUrl`
feeds the dedup signature. Two different jobs throwing the same `"Timeout"`
therefore stay two issues instead of collapsing into one. Give every call site
its own context.

### Options

reportServerError(error: unknown, options?: { token?: string; // default: process.env.GLITCHGRAB_TOKEN baseUrl?: string; // default: process.env.GLITCHGRAB_BASE_URL context?: string; // "cron/daily-digest" — the grouping key description?: string; // what the job was doing type?: ReportType; // default "BUG"

severity?: ReportSeverity; // "low" | "medium" | "high" | "critical" — becomes a severity: label

// anything else is rejected 400 by the API pageUrl?: string; // a real request URL, when there is one metadata?: Record;

logs?: string | string[]; // attached as .log — last 200,000 chars

reporter?: { id?: string; name?: string; email?: string; phone?: string }; enableInDevelopment?: boolean; })


- **Deduped server-side**: one issue per signature per 24h, and nothing new for
  7 days while an issue for it is open. A job failing hourly files one issue,
  not twenty-four.
- **Silent in development** unless `enableInDevelopment: true`. The browser SDK
  is stopped by the API's localhost check; a server sends no `Origin` header, so
  this flag is the only thing standing between a refactor and real issues.
- **Never throws.** Returns `null` when nothing was filed — no token,
  development, or the API refused it.
- No React, no DOM, no `"use client"`. Safe in any Node runtime.

## How do I show my guides on my own site?

Write guides in Glitchgrab (the Guides page, or an agent with `save_guide`), then
render them on your site from server components. Uses the same `GLITCHGRAB_TOKEN`
(or `NEXT_PUBLIC_GLITCHGRAB_TOKEN`) as the rest of the SDK, and reads published
guides only.

// app/guides/page.tsx import { listGuides } from "glitchgrab/server";

export default async function GuidesPage() { const guides = await listGuides(); return (

); }

// app/guides/[slug]/page.tsx import { notFound } from "next/navigation"; import { escapeJsonForScript, getGuide } from "glitchgrab/server";

export default async function GuidePage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const guide = await getGuide(slug); if (!guide) notFound();

const jsonLd = { "@context": "https://schema.org", "@type": "HowTo", name: guide.title, description: guide.summary };

return (