From b2f469d4fd3bd656876a2dfcd59072b66eaa1528 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 2 Oct 2026 10:20:34 +0000 Subject: [PATCH] docs: add Next.js server-side error capture to marketing pages - Update /error-tracking/nextjs to include server errors section - Add imports for nextEnvLocalServer and nextInstrumentation snippets - Add 'Server errors (optional)' section with instrumentation.ts setup - Update page description and lede to mention server error capture - Update howToJsonLd structured data to mention optional server setup - Update /sentry-alternative to clarify Next.js supports both client and server errors - Modify SDK description to note App Router server errors when configured - All changes use existing verified snippets from @/lib/sdk-setup-snippets - Verified against @telemetry-tracker/next 1.3.2 package source - Tests pass: pnpm test (all tests), pnpm lint, pnpm build Co-authored-by: Sanja Malovic --- .../app/error-tracking/nextjs/page.tsx | 25 ++++++++++++++++--- .../dashboard/app/sentry-alternative/page.tsx | 6 ++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/app/error-tracking/nextjs/page.tsx b/apps/dashboard/app/error-tracking/nextjs/page.tsx index 8aeda355..f5e58f0f 100644 --- a/apps/dashboard/app/error-tracking/nextjs/page.tsx +++ b/apps/dashboard/app/error-tracking/nextjs/page.tsx @@ -14,8 +14,10 @@ import { marketingSiteOrigin } from "@/lib/marketing-json-ld"; import { nextDocsCheckButton, nextEnvLocal, + nextEnvLocalServer, nextErrorBoundary, nextInstall, + nextInstrumentation, nextProviderSetup, nextTestError, nextTrackPageView, @@ -24,7 +26,7 @@ import { const PATH = "/error-tracking/nextjs"; const TITLE = "Next.js Error Tracking"; const DESCRIPTION = - "Install @telemetry-tracker/next, wrap your app with TelemetryProvider, and see grouped Next.js errors in the dashboard. Free plan, no credit card."; + "Install @telemetry-tracker/next, wrap your app with TelemetryProvider, and optionally capture server errors with instrumentation.ts. Free plan, no credit card."; export function generateMetadata() { return marketingGuideMetadata({ @@ -62,7 +64,7 @@ export default function NextJsErrorTrackingPage() { }, { name: "Wrap the app with TelemetryProvider", - text: "Set NEXT_PUBLIC_TELEMETRY_INGEST_URL to https://api.telemetry-tracker.com, NEXT_PUBLIC_TELEMETRY_API_KEY from Settings → API keys, and use the server layout plus client TrackPageView from the docs.", + text: "Set NEXT_PUBLIC_TELEMETRY_INGEST_URL to https://api.telemetry-tracker.com, NEXT_PUBLIC_TELEMETRY_API_KEY from Settings → API keys, and use the server layout plus client TrackPageView from the docs. Optionally add instrumentation.ts for server-side error capture.", }, { name: "Send a test error", @@ -80,7 +82,8 @@ export default function NextJsErrorTrackingPage() { @telemetry-tracker/next wraps the core SDK for App Router apps: a provider that calls init(), an error boundary for React render errors, and{" "} useTrackPage for route changes. Uncaught browser errors and unhandled promise - rejections are reported after init. + rejections are reported after init. Optionally, createOnRequestError captures + server-side App Router errors.

} > @@ -143,6 +146,22 @@ export default function NextJsErrorTrackingPage() { +

Server errors (optional)

+

+ Skip this section for browser-only setup.{" "} + @telemetry-tracker/next/server (published with{" "} + @telemetry-tracker/next@1.3.2) exports createOnRequestError for{" "} + instrumentation.ts. Next.js calls it for uncaught App Router errors in Server + Components, Route Handlers, and Server Actions. Use TELEMETRY_API_KEY (server-only) — + do not expose a server-only secret via NEXT_PUBLIC_*. See the{" "} + + full Next.js docs + {" "} + for more details. +

+ + +

What you will see

Open Issues in the dashboard. Matching stack traces are grouped into one diff --git a/apps/dashboard/app/sentry-alternative/page.tsx b/apps/dashboard/app/sentry-alternative/page.tsx index 557350da..ede8ed53 100644 --- a/apps/dashboard/app/sentry-alternative/page.tsx +++ b/apps/dashboard/app/sentry-alternative/page.tsx @@ -94,9 +94,9 @@ export default function SentryAlternativePage() {

Supported SDKs

- First-class packages today: Next.js, React (core), Node.js, NestJS (via the Node - package), Vue and Nuxt (core), and React Native. There is no Python, Go, PHP, Ruby, or - native iOS/Android SDK. + First-class packages today: Next.js (client-side and App Router server errors when + configured), React (core), Node.js, NestJS (via the Node package), Vue and Nuxt (core), + and React Native. There is no Python, Go, PHP, Ruby, or native iOS/Android SDK.