Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions apps/dashboard/app/error-tracking/nextjs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import { marketingSiteOrigin } from "@/lib/marketing-json-ld";
import {
nextDocsCheckButton,
nextEnvLocal,
nextEnvLocalServer,
nextErrorBoundary,
nextInstall,
nextInstrumentation,
nextProviderSetup,
nextTestError,
nextTrackPageView,
Expand All @@ -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({
Expand Down Expand Up @@ -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",
Expand All @@ -80,7 +82,8 @@ export default function NextJsErrorTrackingPage() {
<code>@telemetry-tracker/next</code> wraps the core SDK for App Router apps: a provider
that calls <code>init()</code>, an error boundary for React render errors, and{" "}
<code>useTrackPage</code> for route changes. Uncaught browser errors and unhandled promise
rejections are reported after init.
rejections are reported after init. Optionally, <code>createOnRequestError</code> captures
server-side App Router errors.
</p>
}
>
Expand Down Expand Up @@ -143,6 +146,22 @@ export default function NextJsErrorTrackingPage() {
<CodeBlock code={nextTestError} lang="typescript" caption="trackError call" />
<CodeBlock code={nextErrorBoundary} lang="tsx" caption="Error boundary" />

<h2>Server errors (optional)</h2>
<p>
Skip this section for browser-only setup.{" "}
<code>@telemetry-tracker/next/server</code> (published with{" "}
<code>@telemetry-tracker/next@1.3.2</code>) exports <code>createOnRequestError</code> for{" "}
<code>instrumentation.ts</code>. Next.js calls it for uncaught App Router errors in Server
Components, Route Handlers, and Server Actions. Use <code>TELEMETRY_API_KEY</code> (server-only) —
do not expose a server-only secret via <code>NEXT_PUBLIC_*</code>. See the{" "}
<Link href="/docs/nextjs" className="text-brand hover:underline">
full Next.js docs
</Link>{" "}
for more details.
</p>
<CodeBlock code={nextEnvLocalServer} lang="bash" caption=".env.local (optional server)" />
<CodeBlock code={nextInstrumentation} lang="ts" caption="instrumentation.ts (optional)" />

<h2>What you will see</h2>
<p>
Open <strong>Issues</strong> in the dashboard. Matching stack traces are grouped into one
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/app/sentry-alternative/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ export default function SentryAlternativePage() {

<h2>Supported SDKs</h2>
<p>
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.
</p>
<ul>
<li>
Expand Down
Loading