[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DPY68RXTNERMPA67STTCRJ":3,"skill-same:01M7DPY68RXTNERMPA67STTCRJ":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":46},"01M7DPY68RXTNERMPA67STTCRJ","sentry-cloudflare-sdk",null,"Full Sentry SDK setup for Cloudflare Workers and Pages. Use when asked to \"add Sentry to Cloudflare Workers\", \"install @sentry\u002Fcloudflare\", or configure error monitoring, tracing, logging, crons, or AI monitoring for Cloudflare Workers, Pages, Durable Objects, Queues, Workflows, or Hono on Cloudflare.","Hazek-dc\u002FPresensiGuru_FaceNet_EMAR","Hazek-dc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75208960?v=4","01M7DEQV5B4YGS86A81DYH81DR","Hazek","01M7DEQV5XP4TM0C6NTHXCXCHR",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsentry-cloudflare-sdk\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sentry-cloudflare-sdk\ndescription: Full Sentry SDK setup for Cloudflare Workers and Pages. Use when asked to \"add Sentry to Cloudflare Workers\", \"install @sentry\u002Fcloudflare\", or configure error monitoring, tracing, logging, crons, or AI monitoring for Cloudflare Workers, Pages, Durable Objects, Queues, Workflows, or Hono on Cloudflare.\nlicense: Apache-2.0\ncategory: sdk-setup\nparent: sentry-sdk-setup\ndisable-model-invocation: true\n---\n\n> [All Skills](..\u002F..\u002FSKILL_TREE.md) > [SDK Setup](..\u002Fsentry-sdk-setup\u002FSKILL.md) > Cloudflare SDK\n\n# Sentry Cloudflare SDK\n\nOpinionated wizard that scans your Cloudflare project and guides you through complete Sentry setup for Workers, Pages, Durable Objects, Queues, Workflows, and Hono.\n\n## Invoke This Skill When\n\n- User asks to \"add Sentry to Cloudflare Workers\" or \"set up Sentry\" in a Cloudflare project\n- User wants to install or configure `@sentry\u002Fcloudflare`\n- User wants error monitoring, tracing, logging, crons, or AI monitoring for Cloudflare Workers or Pages\n- User asks about `withSentry`, `sentryPagesPlugin`, `instrumentDurableObjectWithSentry`, or `instrumentD1WithSentry`\n- User wants to monitor Durable Objects, Queues, Workflows, Scheduled handlers, or Email handlers on Cloudflare\n\n> **Note:** SDK versions and APIs below reflect current Sentry docs at time of writing (`@sentry\u002Fcloudflare` v10.61.0).\n> Always verify against [docs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002F) before implementing.\n\n---\n\n## Phase 1: Detect\n\nRun these commands to understand the project before making any recommendations:\n\n```bash\n# Detect Cloudflare project\nls wrangler.toml wrangler.jsonc wrangler.json 2>\u002Fdev\u002Fnull\n\n# Detect existing Sentry\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"@sentry\u002F'\n\n# Detect project type (Workers vs Pages)\nls functions\u002F functions\u002F_middleware.js functions\u002F_middleware.ts 2>\u002Fdev\u002Fnull && echo \"Pages detected\"\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -E 'main|pages_build_output_dir'\n\n# Detect framework\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"hono\"|\"remix\"|\"astro\"|\"svelte\"'\n\n# Detect Durable Objects\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'durable_objects'\n\n# Detect D1 databases\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'd1_databases'\n\n# Detect Queues\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'queues'\n\n# Detect Workflows\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'workflows'\n\n# Detect Scheduled handlers (cron triggers)\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'crons\\|triggers'\n\n# Detect compatibility flags\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'compatibility_flags'\ncat wrangler.jsonc 2>\u002Fdev\u002Fnull | grep -i 'compatibility_flags'\n\n# Detect AI\u002FLLM libraries\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"openai\"|\"@anthropic-ai\"|\"ai\"|\"@google\u002Fgenerative-ai\"|\"@langchain\"'\n\n# Detect logging libraries\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"pino\"|\"winston\"'\n\n# Check for companion frontend\nls frontend\u002F web\u002F client\u002F 2>\u002Fdev\u002Fnull\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"react\"|\"vue\"|\"svelte\"|\"next\"'\n```\n\n**What to determine:**\n\n| Question | Impact |\n|----------|--------|\n| Workers or Pages? | Determines wrapper: `withSentry` vs `sentryPagesPlugin` |\n| Hono framework? | Recommend standalone `@sentry\u002Fhono` package (v10.55.0+) for cleaner integration |\n| `@sentry\u002Fcloudflare` already installed? | Skip install, go to feature config |\n| Durable Objects configured? | Recommend `instrumentDurableObjectWithSentry` |\n| D1 databases bound? | `withSentry` auto-instruments D1 bindings (v10.57.0+); no manual wrapping needed |\n| Queues configured? | `withSentry` auto-instruments queue handlers |\n| Workflows configured? | Recommend `instrumentWorkflowWithSentry` |\n| Cron triggers configured? | `withSentry` auto-instruments scheduled handlers; recommend Crons monitoring |\n| `nodejs_als` or `nodejs_compat` flag set? | **Required** — SDK needs `AsyncLocalStorage` |\n| AI\u002FLLM libraries? | Recommend AI Monitoring integrations |\n| Companion frontend? | Trigger Phase 4 cross-link |\n\n---\n\n## Phase 2: Recommend\n\nPresent a concrete recommendation based on what you found. Don't ask open-ended questions — lead with a proposal:\n\n**Recommended (core coverage):**\n- ✅ **Error Monitoring** — always; captures unhandled exceptions in fetch, scheduled, queue, email, and Durable Object handlers\n- ✅ **Tracing** — automatic HTTP request spans, outbound fetch tracing, D1 query spans\n\n**Optional (enhanced observability):**\n- ⚡ **Logging** — structured logs via `Sentry.logger.*`; recommend when log search is needed\n- ⚡ **Crons** — detect missed\u002Ffailed scheduled jobs; recommend when cron triggers are configured\n- ⚡ **D1 Instrumentation** — automatic query spans and breadcrumbs; recommend when D1 is bound\n- ⚡ **Durable Objects** — automatic error capture and spans for DO methods; recommend when DOs are configured\n- ⚡ **Workflows** — automatic span creation for workflow steps; recommend when Workflows are configured\n- ⚡ **AI Monitoring** — Vercel AI SDK, OpenAI, Anthropic, LangChain; recommend when AI libraries detected\n\n**Recommendation logic:**\n\n| Feature | Recommend when... |\n|---------|------------------|\n| Error Monitoring | **Always** — non-negotiable baseline |\n| Tracing | **Always** — HTTP request tracing and outbound fetch are high-value |\n| Logging | App needs structured log search or log-to-trace correlation |\n| Crons | Cron triggers configured in `wrangler.toml` |\n| D1 Instrumentation | D1 database bindings present |\n| Durable Objects | Durable Object bindings configured |\n| Workflows | Workflow bindings configured |\n| AI Monitoring | App uses Vercel AI SDK, OpenAI, Anthropic, or LangChain |\n| Metrics | App needs custom counters, gauges, or distributions |\n\nPropose: *\"I recommend setting up Error Monitoring + Tracing. Want me to also add D1 instrumentation and Crons monitoring?\"*\n\n---\n\n## Phase 3: Guide\n\n### Option 1: Source Maps Wizard\n\n> **You need to run this yourself** — the wizard opens a browser for login and requires interactive input that the agent can't handle. Copy-paste into your terminal:\n>\n> ```\n> npx @sentry\u002Fwizard@latest -i sourcemaps\n> ```\n>\n> This sets up source map uploading so your production stack traces show readable code. It does **not** set up the SDK initialization — you still need to follow Option 2 below for the actual SDK setup.\n>\n> **Once it finishes, continue with Option 2 for SDK setup.**\n\n> **Note:** Unlike framework SDKs (Next.js, SvelteKit), there is no Cloudflare-specific wizard integration. The `sourcemaps` wizard only handles source map upload configuration.\n\n---\n\n### Option 2: Manual Setup\n\n#### Prerequisites: Compatibility Flags\n\nThe SDK requires `AsyncLocalStorage`. Add **one** of these flags to your Wrangler config:\n\n**wrangler.toml:**\n```toml\ncompatibility_flags = [\"nodejs_als\"]\n# or: compatibility_flags = [\"nodejs_compat\"]\n```\n\n**wrangler.jsonc:**\n```jsonc\n{\n  \"compatibility_flags\": [\"nodejs_als\"]\n}\n```\n\n> `nodejs_als` is lighter — it only enables `AsyncLocalStorage`. Use `nodejs_compat` if your code also needs other Node.js APIs.\n\n#### Install\n\n```bash\nnpm install @sentry\u002Fcloudflare\n```\n\n#### Workers Setup\n\nWrap your handler with `withSentry`. This automatically instruments `fetch`, `scheduled`, `queue`, `email`, and `tail` handlers:\n\n```typescript\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport default Sentry.withSentry(\n  (env: Env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n    enableLogs: true,\n    dataCollection: {\n      \u002F\u002F To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:\n      \u002F\u002F https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002Fconfiguration\u002Foptions\u002F#dataCollection\n      \u002F\u002F userInfo: false,\n      \u002F\u002F httpBodies: [],\n    },\n  }),\n  {\n    async fetch(request, env, ctx) {\n      return new Response(\"Hello World!\");\n    },\n  } satisfies ExportedHandler\u003CEnv>,\n);\n```\n\n**Key points:**\n- The first argument is a callback that receives `env` — use this to read secrets like `SENTRY_DSN`\n- The SDK reads DSN, environment, release, debug, tunnel, and traces sample rate from `env` automatically (see [Environment Variables](#environment-variables))\n- `withSentry` wraps all exported handlers — you do not need separate wrappers for `scheduled`, `queue`, etc.\n\n#### Pages Setup\n\nUse `sentryPagesPlugin` as middleware:\n\n```typescript\n\u002F\u002F functions\u002F_middleware.ts\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport const onRequest = Sentry.sentryPagesPlugin((context) => ({\n  dsn: context.env.SENTRY_DSN,\n  tracesSampleRate: 1.0,\n  enableLogs: true,\n  dataCollection: {\n    \u002F\u002F To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:\n    \u002F\u002F https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002Fconfiguration\u002Foptions\u002F#dataCollection\n    \u002F\u002F userInfo: false,\n    \u002F\u002F httpBodies: [],\n  },\n}));\n```\n\n**Chaining multiple middlewares:**\n\n```typescript\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport const onRequest = [\n  \u002F\u002F Sentry must be first\n  Sentry.sentryPagesPlugin((context) => ({\n    dsn: context.env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  })),\n  \u002F\u002F Add more middlewares here\n];\n```\n\n**Using `wrapRequestHandler` directly** (for frameworks like SvelteKit on Cloudflare Pages):\n\n```typescript\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport const handle = ({ event, resolve }) => {\n  return Sentry.wrapRequestHandler(\n    {\n      options: {\n        dsn: event.platform.env.SENTRY_DSN,\n        tracesSampleRate: 1.0,\n      },\n      request: event.request,\n      context: event.platform.ctx,\n    },\n    () => resolve(event),\n  );\n};\n```\n\n#### Hono on Cloudflare Workers\n\n**Recommended (v10.55.0+):** Use the standalone `@sentry\u002Fhono` package for Hono apps:\n\n```bash\nnpm install @sentry\u002Fhono @sentry\u002Fcloudflare\n```\n\nThe `@sentry\u002Fcloudflare` package is a peer dependency and must stay in sync with `@sentry\u002Fhono`.\n\n```typescript\nimport { Hono } from \"hono\";\nimport { sentry } from \"@sentry\u002Fhono\u002Fcloudflare\";\n\ntype Bindings = { SENTRY_DSN: string };\n\nconst app = new Hono\u003C{ Bindings: Bindings }>();\n\n\u002F\u002F Initialize Sentry middleware as early as possible\napp.use(\n  sentry(app, (env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  })),\n);\n\napp.get(\"\u002F\", (ctx) => ctx.json({ message: \"Hello\" }));\n\napp.get(\"\u002Ferror\", () => {\n  throw new Error(\"Test error\");\n});\n\nexport default app;\n```\n\nThe `sentry()` middleware automatically captures errors and creates transaction spans with route patterns.\n\n**Legacy approach (deprecated):** Using `@sentry\u002Fcloudflare` with `withSentry` still works, but `honoIntegration` is deprecated:\n\n```typescript\nimport { Hono } from \"hono\";\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nconst app = new Hono();\n\napp.get(\"\u002F\", (ctx) => ctx.json({ message: \"Hello\" }));\n\nexport default Sentry.withSentry(\n  (env: Env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  }),\n  app,\n);\n```\n\n#### Set Up the SENTRY_DSN Secret\n\nStore your DSN as a Cloudflare secret — do not hardcode it:\n\n```bash\n# Local development: add to .dev.vars\necho 'SENTRY_DSN=\"https:\u002F\u002FexamplePublicKey@o0.ingest.sentry.io\u002F0\"' >> .dev.vars\n\n# Production: set as a secret\nnpx wrangler secret put SENTRY_DSN\n```\n\nAdd the binding to your `Env` type:\n\n```typescript\ninterface Env {\n  SENTRY_DSN: string;\n  \u002F\u002F ... other bindings\n}\n```\n\n#### Source Maps Setup\n\nSource maps make production stack traces readable. Most Cloudflare projects build with Vite via Wrangler — wire the Sentry Vite plugin so maps upload on build:\n\n```bash\nnpm install @sentry\u002Fvite-plugin --save-dev\n```\n\n```typescript\nimport { defineConfig } from \"vite\";\nimport { sentryVitePlugin } from \"@sentry\u002Fvite-plugin\";\n\nexport default defineConfig({\n  build: {\n    sourcemap: true,\n  },\n  plugins: [\n    sentryVitePlugin({\n      org: \"___ORG_SLUG___\",\n      project: \"___PROJECT_SLUG___\",\n      authToken: process.env.SENTRY_AUTH_TOKEN,\n    }),\n  ],\n});\n```\n\n`SENTRY_AUTH_TOKEN` is a build-time secret. For creating the token and wiring it into CI, see [`sentry-source-maps`](..\u002Fsentry-source-maps\u002FSKILL.md). The `npx @sentry\u002Fwizard@latest -i sourcemaps` shortcut noted above automates this setup.\n\n---\n\n### Automatic Release Detection\n\nThe SDK can automatically detect the release version via Cloudflare's version metadata binding:\n\n**wrangler.toml:**\n```toml\n[version_metadata]\nbinding = \"CF_VERSION_METADATA\"\n```\n\nRelease priority (highest to lowest):\n1. `release` option passed to `Sentry.init()`\n2. `SENTRY_RELEASE` environment variable\n3. `CF_VERSION_METADATA.id` binding\n\n---\n\n### For Each Agreed Feature\n\nLoad the corresponding reference file and follow its steps:\n\n| Feature | Reference file | Load when... |\n|---------|---------------|-------------|\n| Error Monitoring | `references\u002Ferror-monitoring.md` | Always (baseline) — unhandled exceptions, manual capture, scopes, enrichment |\n| Tracing | `references\u002Ftracing.md` | HTTP request tracing, outbound fetch spans, D1 query spans, distributed tracing |\n| Logging | `references\u002Flogging.md` | Structured logs via `Sentry.logger.*`, log-to-trace correlation |\n| Crons | `references\u002Fcrons.md` | Scheduled handler monitoring, `withMonitor`, check-in API |\n| Durable Objects | `references\u002Fdurable-objects.md` | Instrument Durable Object classes for error capture and spans |\n\nFor each feature: read the reference file, follow its steps exactly, and verify before moving on.\n\n---\n\n## Configuration Reference\n\n### `Sentry.init()` Options\n\n| Option | Type | Default | Notes |\n|--------|------|---------|-------|\n| `dsn` | `string` | — | Required. Read from `env.SENTRY_DSN` automatically if not set |\n| `tracesSampleRate` | `number` | — | 0–1; 1.0 in dev, lower in prod recommended |\n| `tracesSampler` | `function` | — | Dynamic sampling function; mutually exclusive with `tracesSampleRate` |\n| `dataCollection` | `object` | conservative unless set | Controls what data the SDK captures (`userInfo`, `httpBodies`, etc.). When omitted, falls back to `sendDefaultPii` (default `false`); passing the object — even `{}` — enables permissive defaults. See [Data Collection Reference](#data-collection-reference) |\n| `sendDefaultPii` | `boolean` | `false` | Legacy. Prefer `dataCollection` for control over captured data |\n| `enableLogs` | `boolean` | `false` | Enable Sentry Logs product |\n| `environment` | `string` | auto | Read from `env.SENTRY_ENVIRONMENT` if not set |\n| `release` | `string` | auto | Detected from `CF_VERSION_METADATA.id` or `SENTRY_RELEASE` |\n| `debug` | `boolean` | `false` | Read from `env.SENTRY_DEBUG` if not set. Log SDK activity to console |\n| `tunnel` | `string` | — | Read from `env.SENTRY_TUNNEL` if not set |\n| `beforeSend` | `function` | — | Filter\u002Fmodify error events before sending |\n| `beforeSendTransaction` | `function` | — | Filter\u002Fmodify transaction events before sending |\n| `beforeSendLog` | `function` | — | Filter\u002Fmodify log entries before sending |\n| `tracePropagationTargets` | `(string\\|RegExp)[]` | all URLs | Control which outbound requests get trace headers |\n| `skipOpenTelemetrySetup` | `boolean` | `false` | Opt-out of OpenTelemetry compatibility tracer |\n| `instrumentPrototypeMethods` | `boolean \\| string[]` | `false` | Durable Object: instrument prototype methods for RPC spans |\n\n### Data Collection Reference\n\n```typescript\ndataCollection: {\n  \u002F\u002F To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:\n  \u002F\u002F https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fconfiguration\u002Foptions\u002F#dataCollection\n  \u002F\u002F userInfo: false,\n  \u002F\u002F httpBodies: [],\n},\n```\n\n### Environment Variables (Read from `env`)\n\nThe SDK reads these from the Cloudflare `env` object automatically:\n\n| Variable | Purpose |\n|----------|---------|\n| `SENTRY_DSN` | DSN for Sentry init |\n| `SENTRY_RELEASE` | Release version string |\n| `SENTRY_ENVIRONMENT` | Environment name (`production`, `staging`) |\n| `SENTRY_TRACES_SAMPLE_RATE` | Traces sample rate (parsed as float) |\n| `SENTRY_DEBUG` | Enable debug mode (`\"true\"` \u002F `\"1\"`) |\n| `SENTRY_TUNNEL` | Tunnel URL for event proxying |\n| `CF_VERSION_METADATA` | Cloudflare version metadata binding (auto-detected release) |\n\n### Default Integrations\n\nThese are registered automatically by `getDefaultIntegrations()`:\n\n| Integration | Purpose |\n|-------------|---------|\n| `dedupeIntegration` | Prevent duplicate events (disabled for Workflows) |\n| `inboundFiltersIntegration` | Filter events by type, message, URL |\n| `functionToStringIntegration` | Preserve original function names |\n| `linkedErrorsIntegration` | Follow `cause` chains in errors |\n| `fetchIntegration` | Trace outbound `fetch()` calls, create breadcrumbs |\n| `honoIntegration` | **Deprecated in v10.55.0** — use `@sentry\u002Fhono` package instead. Auto-capture Hono `onError` exceptions |\n| `requestDataIntegration` | Attach request data to events |\n| `consoleIntegration` | Capture `console.*` calls as breadcrumbs |\n\n---\n\n## Verification\n\nAfter setup, verify Sentry is working:\n\n```typescript\n\u002F\u002F Add temporarily to your fetch handler, then remove\nexport default Sentry.withSentry(\n  (env: Env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  }),\n  {\n    async fetch(request, env, ctx) {\n      throw new Error(\"Sentry test error — delete me\");\n    },\n  } satisfies ExportedHandler\u003CEnv>,\n);\n```\n\nDeploy and trigger the route, then check your [Sentry Issues dashboard](https:\u002F\u002Fsentry.io\u002Fissues\u002F) — the error should appear within ~30 seconds.\n\n**Verification checklist:**\n\n| Check | How |\n|-------|-----|\n| Errors captured | Throw in a fetch handler, verify in Sentry |\n| Tracing working | Check Performance tab for HTTP spans |\n| Source maps working | Check stack trace shows readable file\u002Fline names |\n| D1 spans (if configured) | Run a D1 query, check for `db.query` spans |\n| Scheduled monitoring (if configured) | Trigger a cron, check Crons dashboard |\n\n---\n\n## Phase 4: Cross-Link\n\nAfter completing Cloudflare setup, check for companion services:\n\n```bash\n# Check for companion frontend\nls frontend\u002F web\u002F client\u002F ui\u002F 2>\u002Fdev\u002Fnull\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"react\"|\"vue\"|\"svelte\"|\"next\"|\"astro\"'\n\n# Check for companion backend in adjacent directories\nls ..\u002Fbackend ..\u002Fserver ..\u002Fapi 2>\u002Fdev\u002Fnull\ncat ..\u002Fgo.mod ..\u002Frequirements.txt ..\u002FGemfile 2>\u002Fdev\u002Fnull | head -3\n```\n\nIf a frontend is found, suggest the matching SDK skill:\n\n| Frontend detected | Suggest skill |\n|------------------|--------------|\n| React | `sentry-react-sdk` |\n| Next.js | `sentry-nextjs-sdk` |\n| Svelte\u002FSvelteKit | `sentry-svelte-sdk` |\n| Vue\u002FNuxt | See [docs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F) |\n\nIf a backend is found in a different directory:\n\n| Backend detected | Suggest skill |\n|-----------------|--------------|\n| Go (`go.mod`) | `sentry-go-sdk` |\n| Python (`requirements.txt`, `pyproject.toml`) | `sentry-python-sdk` |\n| Ruby (`Gemfile`) | `sentry-ruby-sdk` |\n| Node.js (Express, Fastify) | `sentry-node-sdk` |\n\nConnecting frontend and backend with linked Sentry projects enables **distributed tracing** — stack traces that span your browser, Cloudflare Worker, and backend API in a single trace view.\n\n---\n\n## Troubleshooting\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Events not appearing | DSN not set or `debug: false` hiding errors | Set `debug: true` temporarily in init options; verify `SENTRY_DSN` secret is set with `wrangler secret list` |\n| `AsyncLocalStorage is not defined` | Missing compatibility flag | Add `nodejs_als` or `nodejs_compat` to `compatibility_flags` in `wrangler.toml` |\n| Stack traces show minified code | Source maps not uploaded | Configure `@sentry\u002Fvite-plugin` or run `npx @sentry\u002Fwizard -i sourcemaps`; verify `SENTRY_AUTH_TOKEN` in CI |\n| Events lost on short-lived requests | SDK not flushing before worker terminates | Ensure `withSentry` or `sentryPagesPlugin` wraps your handler — they use `ctx.waitUntil()` to flush |\n| Hono errors not captured | Hono app not instrumented | Use `@sentry\u002Fhono\u002Fcloudflare` — import `sentry` middleware and call `app.use(sentry(app, options))` |\n| Durable Object errors missing | DO class not instrumented | Wrap class with `Sentry.instrumentDurableObjectWithSentry()` — see `references\u002Fdurable-objects.md` |\n| D1 queries not creating spans | Handler not wrapped with `withSentry`, or querying a non-`env` binding | D1 bindings on `env` are auto-instrumented by `withSentry` (v10.57.0+) — no manual wrapping needed (`instrumentD1WithSentry` is deprecated). All query methods (`prepare`, `batch`, `exec`, `withSession`) are traced in v10.61.0+ |\n| Scheduled handler not monitored | `withSentry` not wrapping the handler | Ensure `export default Sentry.withSentry(...)` wraps your entire exported handler object |\n| Release not auto-detected | `CF_VERSION_METADATA` binding not configured | Add `[version_metadata]` with `binding = \"CF_VERSION_METADATA\"` to `wrangler.toml` |\n| Duplicate events in Workflows | Dedupe integration filtering step failures | SDK automatically disables dedupe for Workflows; verify you use `instrumentWorkflowWithSentry` |\n","> [All Skills](..\u002F..\u002FSKILL_TREE.md) > [SDK Setup](..\u002Fsentry-sdk-setup\u002FSKILL.md) > Cloudflare SDK\n\n# Sentry Cloudflare SDK\n\nOpinionated wizard that scans your Cloudflare project and guides you through complete Sentry setup for Workers, Pages, Durable Objects, Queues, Workflows, and Hono.\n\n## Invoke This Skill When\n\n- User asks to \"add Sentry to Cloudflare Workers\" or \"set up Sentry\" in a Cloudflare project\n- User wants to install or configure `@sentry\u002Fcloudflare`\n- User wants error monitoring, tracing, logging, crons, or AI monitoring for Cloudflare Workers or Pages\n- User asks about `withSentry`, `sentryPagesPlugin`, `instrumentDurableObjectWithSentry`, or `instrumentD1WithSentry`\n- User wants to monitor Durable Objects, Queues, Workflows, Scheduled handlers, or Email handlers on Cloudflare\n\n> **Note:** SDK versions and APIs below reflect current Sentry docs at time of writing (`@sentry\u002Fcloudflare` v10.61.0).\n> Always verify against [docs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002F) before implementing.\n\n---\n\n## Phase 1: Detect\n\nRun these commands to understand the project before making any recommendations:\n\n```bash\n# Detect Cloudflare project\nls wrangler.toml wrangler.jsonc wrangler.json 2>\u002Fdev\u002Fnull\n\n# Detect existing Sentry\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"@sentry\u002F'\n\n# Detect project type (Workers vs Pages)\nls functions\u002F functions\u002F_middleware.js functions\u002F_middleware.ts 2>\u002Fdev\u002Fnull && echo \"Pages detected\"\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -E 'main|pages_build_output_dir'\n\n# Detect framework\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"hono\"|\"remix\"|\"astro\"|\"svelte\"'\n\n# Detect Durable Objects\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'durable_objects'\n\n# Detect D1 databases\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'd1_databases'\n\n# Detect Queues\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'queues'\n\n# Detect Workflows\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'workflows'\n\n# Detect Scheduled handlers (cron triggers)\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'crons\\|triggers'\n\n# Detect compatibility flags\ncat wrangler.toml 2>\u002Fdev\u002Fnull | grep -i 'compatibility_flags'\ncat wrangler.jsonc 2>\u002Fdev\u002Fnull | grep -i 'compatibility_flags'\n\n# Detect AI\u002FLLM libraries\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"openai\"|\"@anthropic-ai\"|\"ai\"|\"@google\u002Fgenerative-ai\"|\"@langchain\"'\n\n# Detect logging libraries\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"pino\"|\"winston\"'\n\n# Check for companion frontend\nls frontend\u002F web\u002F client\u002F 2>\u002Fdev\u002Fnull\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"react\"|\"vue\"|\"svelte\"|\"next\"'\n```\n\n**What to determine:**\n\n| Question | Impact |\n|----------|--------|\n| Workers or Pages? | Determines wrapper: `withSentry` vs `sentryPagesPlugin` |\n| Hono framework? | Recommend standalone `@sentry\u002Fhono` package (v10.55.0+) for cleaner integration |\n| `@sentry\u002Fcloudflare` already installed? | Skip install, go to feature config |\n| Durable Objects configured? | Recommend `instrumentDurableObjectWithSentry` |\n| D1 databases bound? | `withSentry` auto-instruments D1 bindings (v10.57.0+); no manual wrapping needed |\n| Queues configured? | `withSentry` auto-instruments queue handlers |\n| Workflows configured? | Recommend `instrumentWorkflowWithSentry` |\n| Cron triggers configured? | `withSentry` auto-instruments scheduled handlers; recommend Crons monitoring |\n| `nodejs_als` or `nodejs_compat` flag set? | **Required** — SDK needs `AsyncLocalStorage` |\n| AI\u002FLLM libraries? | Recommend AI Monitoring integrations |\n| Companion frontend? | Trigger Phase 4 cross-link |\n\n---\n\n## Phase 2: Recommend\n\nPresent a concrete recommendation based on what you found. Don't ask open-ended questions — lead with a proposal:\n\n**Recommended (core coverage):**\n- ✅ **Error Monitoring** — always; captures unhandled exceptions in fetch, scheduled, queue, email, and Durable Object handlers\n- ✅ **Tracing** — automatic HTTP request spans, outbound fetch tracing, D1 query spans\n\n**Optional (enhanced observability):**\n- ⚡ **Logging** — structured logs via `Sentry.logger.*`; recommend when log search is needed\n- ⚡ **Crons** — detect missed\u002Ffailed scheduled jobs; recommend when cron triggers are configured\n- ⚡ **D1 Instrumentation** — automatic query spans and breadcrumbs; recommend when D1 is bound\n- ⚡ **Durable Objects** — automatic error capture and spans for DO methods; recommend when DOs are configured\n- ⚡ **Workflows** — automatic span creation for workflow steps; recommend when Workflows are configured\n- ⚡ **AI Monitoring** — Vercel AI SDK, OpenAI, Anthropic, LangChain; recommend when AI libraries detected\n\n**Recommendation logic:**\n\n| Feature | Recommend when... |\n|---------|------------------|\n| Error Monitoring | **Always** — non-negotiable baseline |\n| Tracing | **Always** — HTTP request tracing and outbound fetch are high-value |\n| Logging | App needs structured log search or log-to-trace correlation |\n| Crons | Cron triggers configured in `wrangler.toml` |\n| D1 Instrumentation | D1 database bindings present |\n| Durable Objects | Durable Object bindings configured |\n| Workflows | Workflow bindings configured |\n| AI Monitoring | App uses Vercel AI SDK, OpenAI, Anthropic, or LangChain |\n| Metrics | App needs custom counters, gauges, or distributions |\n\nPropose: *\"I recommend setting up Error Monitoring + Tracing. Want me to also add D1 instrumentation and Crons monitoring?\"*\n\n---\n\n## Phase 3: Guide\n\n### Option 1: Source Maps Wizard\n\n> **You need to run this yourself** — the wizard opens a browser for login and requires interactive input that the agent can't handle. Copy-paste into your terminal:\n>\n> ```\n> npx @sentry\u002Fwizard@latest -i sourcemaps\n> ```\n>\n> This sets up source map uploading so your production stack traces show readable code. It does **not** set up the SDK initialization — you still need to follow Option 2 below for the actual SDK setup.\n>\n> **Once it finishes, continue with Option 2 for SDK setup.**\n\n> **Note:** Unlike framework SDKs (Next.js, SvelteKit), there is no Cloudflare-specific wizard integration. The `sourcemaps` wizard only handles source map upload configuration.\n\n---\n\n### Option 2: Manual Setup\n\n#### Prerequisites: Compatibility Flags\n\nThe SDK requires `AsyncLocalStorage`. Add **one** of these flags to your Wrangler config:\n\n**wrangler.toml:**\n```toml\ncompatibility_flags = [\"nodejs_als\"]\n# or: compatibility_flags = [\"nodejs_compat\"]\n```\n\n**wrangler.jsonc:**\n```jsonc\n{\n  \"compatibility_flags\": [\"nodejs_als\"]\n}\n```\n\n> `nodejs_als` is lighter — it only enables `AsyncLocalStorage`. Use `nodejs_compat` if your code also needs other Node.js APIs.\n\n#### Install\n\n```bash\nnpm install @sentry\u002Fcloudflare\n```\n\n#### Workers Setup\n\nWrap your handler with `withSentry`. This automatically instruments `fetch`, `scheduled`, `queue`, `email`, and `tail` handlers:\n\n```typescript\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport default Sentry.withSentry(\n  (env: Env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n    enableLogs: true,\n    dataCollection: {\n      \u002F\u002F To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:\n      \u002F\u002F https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002Fconfiguration\u002Foptions\u002F#dataCollection\n      \u002F\u002F userInfo: false,\n      \u002F\u002F httpBodies: [],\n    },\n  }),\n  {\n    async fetch(request, env, ctx) {\n      return new Response(\"Hello World!\");\n    },\n  } satisfies ExportedHandler\u003CEnv>,\n);\n```\n\n**Key points:**\n- The first argument is a callback that receives `env` — use this to read secrets like `SENTRY_DSN`\n- The SDK reads DSN, environment, release, debug, tunnel, and traces sample rate from `env` automatically (see [Environment Variables](#environment-variables))\n- `withSentry` wraps all exported handlers — you do not need separate wrappers for `scheduled`, `queue`, etc.\n\n#### Pages Setup\n\nUse `sentryPagesPlugin` as middleware:\n\n```typescript\n\u002F\u002F functions\u002F_middleware.ts\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport const onRequest = Sentry.sentryPagesPlugin((context) => ({\n  dsn: context.env.SENTRY_DSN,\n  tracesSampleRate: 1.0,\n  enableLogs: true,\n  dataCollection: {\n    \u002F\u002F To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:\n    \u002F\u002F https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fcloudflare\u002Fconfiguration\u002Foptions\u002F#dataCollection\n    \u002F\u002F userInfo: false,\n    \u002F\u002F httpBodies: [],\n  },\n}));\n```\n\n**Chaining multiple middlewares:**\n\n```typescript\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport const onRequest = [\n  \u002F\u002F Sentry must be first\n  Sentry.sentryPagesPlugin((context) => ({\n    dsn: context.env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  })),\n  \u002F\u002F Add more middlewares here\n];\n```\n\n**Using `wrapRequestHandler` directly** (for frameworks like SvelteKit on Cloudflare Pages):\n\n```typescript\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nexport const handle = ({ event, resolve }) => {\n  return Sentry.wrapRequestHandler(\n    {\n      options: {\n        dsn: event.platform.env.SENTRY_DSN,\n        tracesSampleRate: 1.0,\n      },\n      request: event.request,\n      context: event.platform.ctx,\n    },\n    () => resolve(event),\n  );\n};\n```\n\n#### Hono on Cloudflare Workers\n\n**Recommended (v10.55.0+):** Use the standalone `@sentry\u002Fhono` package for Hono apps:\n\n```bash\nnpm install @sentry\u002Fhono @sentry\u002Fcloudflare\n```\n\nThe `@sentry\u002Fcloudflare` package is a peer dependency and must stay in sync with `@sentry\u002Fhono`.\n\n```typescript\nimport { Hono } from \"hono\";\nimport { sentry } from \"@sentry\u002Fhono\u002Fcloudflare\";\n\ntype Bindings = { SENTRY_DSN: string };\n\nconst app = new Hono\u003C{ Bindings: Bindings }>();\n\n\u002F\u002F Initialize Sentry middleware as early as possible\napp.use(\n  sentry(app, (env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  })),\n);\n\napp.get(\"\u002F\", (ctx) => ctx.json({ message: \"Hello\" }));\n\napp.get(\"\u002Ferror\", () => {\n  throw new Error(\"Test error\");\n});\n\nexport default app;\n```\n\nThe `sentry()` middleware automatically captures errors and creates transaction spans with route patterns.\n\n**Legacy approach (deprecated):** Using `@sentry\u002Fcloudflare` with `withSentry` still works, but `honoIntegration` is deprecated:\n\n```typescript\nimport { Hono } from \"hono\";\nimport * as Sentry from \"@sentry\u002Fcloudflare\";\n\nconst app = new Hono();\n\napp.get(\"\u002F\", (ctx) => ctx.json({ message: \"Hello\" }));\n\nexport default Sentry.withSentry(\n  (env: Env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  }),\n  app,\n);\n```\n\n#### Set Up the SENTRY_DSN Secret\n\nStore your DSN as a Cloudflare secret — do not hardcode it:\n\n```bash\n# Local development: add to .dev.vars\necho 'SENTRY_DSN=\"https:\u002F\u002FexamplePublicKey@o0.ingest.sentry.io\u002F0\"' >> .dev.vars\n\n# Production: set as a secret\nnpx wrangler secret put SENTRY_DSN\n```\n\nAdd the binding to your `Env` type:\n\n```typescript\ninterface Env {\n  SENTRY_DSN: string;\n  \u002F\u002F ... other bindings\n}\n```\n\n#### Source Maps Setup\n\nSource maps make production stack traces readable. Most Cloudflare projects build with Vite via Wrangler — wire the Sentry Vite plugin so maps upload on build:\n\n```bash\nnpm install @sentry\u002Fvite-plugin --save-dev\n```\n\n```typescript\nimport { defineConfig } from \"vite\";\nimport { sentryVitePlugin } from \"@sentry\u002Fvite-plugin\";\n\nexport default defineConfig({\n  build: {\n    sourcemap: true,\n  },\n  plugins: [\n    sentryVitePlugin({\n      org: \"___ORG_SLUG___\",\n      project: \"___PROJECT_SLUG___\",\n      authToken: process.env.SENTRY_AUTH_TOKEN,\n    }),\n  ],\n});\n```\n\n`SENTRY_AUTH_TOKEN` is a build-time secret. For creating the token and wiring it into CI, see [`sentry-source-maps`](..\u002Fsentry-source-maps\u002FSKILL.md). The `npx @sentry\u002Fwizard@latest -i sourcemaps` shortcut noted above automates this setup.\n\n---\n\n### Automatic Release Detection\n\nThe SDK can automatically detect the release version via Cloudflare's version metadata binding:\n\n**wrangler.toml:**\n```toml\n[version_metadata]\nbinding = \"CF_VERSION_METADATA\"\n```\n\nRelease priority (highest to lowest):\n1. `release` option passed to `Sentry.init()`\n2. `SENTRY_RELEASE` environment variable\n3. `CF_VERSION_METADATA.id` binding\n\n---\n\n### For Each Agreed Feature\n\nLoad the corresponding reference file and follow its steps:\n\n| Feature | Reference file | Load when... |\n|---------|---------------|-------------|\n| Error Monitoring | `references\u002Ferror-monitoring.md` | Always (baseline) — unhandled exceptions, manual capture, scopes, enrichment |\n| Tracing | `references\u002Ftracing.md` | HTTP request tracing, outbound fetch spans, D1 query spans, distributed tracing |\n| Logging | `references\u002Flogging.md` | Structured logs via `Sentry.logger.*`, log-to-trace correlation |\n| Crons | `references\u002Fcrons.md` | Scheduled handler monitoring, `withMonitor`, check-in API |\n| Durable Objects | `references\u002Fdurable-objects.md` | Instrument Durable Object classes for error capture and spans |\n\nFor each feature: read the reference file, follow its steps exactly, and verify before moving on.\n\n---\n\n## Configuration Reference\n\n### `Sentry.init()` Options\n\n| Option | Type | Default | Notes |\n|--------|------|---------|-------|\n| `dsn` | `string` | — | Required. Read from `env.SENTRY_DSN` automatically if not set |\n| `tracesSampleRate` | `number` | — | 0–1; 1.0 in dev, lower in prod recommended |\n| `tracesSampler` | `function` | — | Dynamic sampling function; mutually exclusive with `tracesSampleRate` |\n| `dataCollection` | `object` | conservative unless set | Controls what data the SDK captures (`userInfo`, `httpBodies`, etc.). When omitted, falls back to `sendDefaultPii` (default `false`); passing the object — even `{}` — enables permissive defaults. See [Data Collection Reference](#data-collection-reference) |\n| `sendDefaultPii` | `boolean` | `false` | Legacy. Prefer `dataCollection` for control over captured data |\n| `enableLogs` | `boolean` | `false` | Enable Sentry Logs product |\n| `environment` | `string` | auto | Read from `env.SENTRY_ENVIRONMENT` if not set |\n| `release` | `string` | auto | Detected from `CF_VERSION_METADATA.id` or `SENTRY_RELEASE` |\n| `debug` | `boolean` | `false` | Read from `env.SENTRY_DEBUG` if not set. Log SDK activity to console |\n| `tunnel` | `string` | — | Read from `env.SENTRY_TUNNEL` if not set |\n| `beforeSend` | `function` | — | Filter\u002Fmodify error events before sending |\n| `beforeSendTransaction` | `function` | — | Filter\u002Fmodify transaction events before sending |\n| `beforeSendLog` | `function` | — | Filter\u002Fmodify log entries before sending |\n| `tracePropagationTargets` | `(string\\|RegExp)[]` | all URLs | Control which outbound requests get trace headers |\n| `skipOpenTelemetrySetup` | `boolean` | `false` | Opt-out of OpenTelemetry compatibility tracer |\n| `instrumentPrototypeMethods` | `boolean \\| string[]` | `false` | Durable Object: instrument prototype methods for RPC spans |\n\n### Data Collection Reference\n\n```typescript\ndataCollection: {\n  \u002F\u002F To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:\n  \u002F\u002F https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fconfiguration\u002Foptions\u002F#dataCollection\n  \u002F\u002F userInfo: false,\n  \u002F\u002F httpBodies: [],\n},\n```\n\n### Environment Variables (Read from `env`)\n\nThe SDK reads these from the Cloudflare `env` object automatically:\n\n| Variable | Purpose |\n|----------|---------|\n| `SENTRY_DSN` | DSN for Sentry init |\n| `SENTRY_RELEASE` | Release version string |\n| `SENTRY_ENVIRONMENT` | Environment name (`production`, `staging`) |\n| `SENTRY_TRACES_SAMPLE_RATE` | Traces sample rate (parsed as float) |\n| `SENTRY_DEBUG` | Enable debug mode (`\"true\"` \u002F `\"1\"`) |\n| `SENTRY_TUNNEL` | Tunnel URL for event proxying |\n| `CF_VERSION_METADATA` | Cloudflare version metadata binding (auto-detected release) |\n\n### Default Integrations\n\nThese are registered automatically by `getDefaultIntegrations()`:\n\n| Integration | Purpose |\n|-------------|---------|\n| `dedupeIntegration` | Prevent duplicate events (disabled for Workflows) |\n| `inboundFiltersIntegration` | Filter events by type, message, URL |\n| `functionToStringIntegration` | Preserve original function names |\n| `linkedErrorsIntegration` | Follow `cause` chains in errors |\n| `fetchIntegration` | Trace outbound `fetch()` calls, create breadcrumbs |\n| `honoIntegration` | **Deprecated in v10.55.0** — use `@sentry\u002Fhono` package instead. Auto-capture Hono `onError` exceptions |\n| `requestDataIntegration` | Attach request data to events |\n| `consoleIntegration` | Capture `console.*` calls as breadcrumbs |\n\n---\n\n## Verification\n\nAfter setup, verify Sentry is working:\n\n```typescript\n\u002F\u002F Add temporarily to your fetch handler, then remove\nexport default Sentry.withSentry(\n  (env: Env) => ({\n    dsn: env.SENTRY_DSN,\n    tracesSampleRate: 1.0,\n  }),\n  {\n    async fetch(request, env, ctx) {\n      throw new Error(\"Sentry test error — delete me\");\n    },\n  } satisfies ExportedHandler\u003CEnv>,\n);\n```\n\nDeploy and trigger the route, then check your [Sentry Issues dashboard](https:\u002F\u002Fsentry.io\u002Fissues\u002F) — the error should appear within ~30 seconds.\n\n**Verification checklist:**\n\n| Check | How |\n|-------|-----|\n| Errors captured | Throw in a fetch handler, verify in Sentry |\n| Tracing working | Check Performance tab for HTTP spans |\n| Source maps working | Check stack trace shows readable file\u002Fline names |\n| D1 spans (if configured) | Run a D1 query, check for `db.query` spans |\n| Scheduled monitoring (if configured) | Trigger a cron, check Crons dashboard |\n\n---\n\n## Phase 4: Cross-Link\n\nAfter completing Cloudflare setup, check for companion services:\n\n```bash\n# Check for companion frontend\nls frontend\u002F web\u002F client\u002F ui\u002F 2>\u002Fdev\u002Fnull\ncat package.json 2>\u002Fdev\u002Fnull | grep -E '\"react\"|\"vue\"|\"svelte\"|\"next\"|\"astro\"'\n\n# Check for companion backend in adjacent directories\nls ..\u002Fbackend ..\u002Fserver ..\u002Fapi 2>\u002Fdev\u002Fnull\ncat ..\u002Fgo.mod ..\u002Frequirements.txt ..\u002FGemfile 2>\u002Fdev\u002Fnull | head -3\n```\n\nIf a frontend is found, suggest the matching SDK skill:\n\n| Frontend detected | Suggest skill |\n|------------------|--------------|\n| React | `sentry-react-sdk` |\n| Next.js | `sentry-nextjs-sdk` |\n| Svelte\u002FSvelteKit | `sentry-svelte-sdk` |\n| Vue\u002FNuxt | See [docs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F](https:\u002F\u002Fdocs.sentry.io\u002Fplatforms\u002Fjavascript\u002Fguides\u002Fvue\u002F) |\n\nIf a backend is found in a different directory:\n\n| Backend detected | Suggest skill |\n|-----------------|--------------|\n| Go (`go.mod`) | `sentry-go-sdk` |\n| Python (`requirements.txt`, `pyproject.toml`) | `sentry-python-sdk` |\n| Ruby (`Gemfile`) | `sentry-ruby-sdk` |\n| Node.js (Express, Fastify) | `sentry-node-sdk` |\n\nConnecting frontend and backend with linked Sentry projects enables **distributed tracing** — stack traces that span your browser, Cloudflare Worker, and backend API in a single trace view.\n\n---\n\n## Troubleshooting\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Events not appearing | DSN not set or `debug: false` hiding errors | Set `debug: true` temporarily in init options; verify `SENTRY_DSN` secret is set with `wrangler secret list` |\n| `AsyncLocalStorage is not defined` | Missing compatibility flag | Add `nodejs_als` or `nodejs_compat` to `compatibility_flags` in `wrangler.toml` |\n| Stack traces show minified code | Source maps not uploaded | Configure `@sentry\u002Fvite-plugin` or run `npx @sentry\u002Fwizard -i sourcemaps`; verify `SENTRY_AUTH_TOKEN` in CI |\n| Events lost on short-lived requests | SDK not flushing before worker terminates | Ensure `withSentry` or `sentryPagesPlugin` wraps your handler — they use `ctx.waitUntil()` to flush |\n| Hono errors not captured | Hono app not instrumented | Use `@sentry\u002Fhono\u002Fcloudflare` — import `sentry` middleware and call `app.use(sentry(app, options))` |\n| Durable Object errors missing | DO class not instrumented | Wrap class with `Sentry.instrumentDurableObjectWithSentry()` — see `references\u002Fdurable-objects.md` |\n| D1 queries not creating spans | Handler not wrapped with `withSentry`, or querying a non-`env` binding | D1 bindings on `env` are auto-instrumented by `withSentry` (v10.57.0+) — no manual wrapping needed (`instrumentD1WithSentry` is deprecated). All query methods (`prepare`, `batch`, `exec`, `withSession`) are traced in v10.61.0+ |\n| Scheduled handler not monitored | `withSentry` not wrapping the handler | Ensure `export default Sentry.withSentry(...)` wraps your entire exported handler object |\n| Release not auto-detected | `CF_VERSION_METADATA` binding not configured | Add `[version_metadata]` with `binding = \"CF_VERSION_METADATA\"` to `wrangler.toml` |\n| Duplicate events in Workflows | Dedupe integration filtering step failures | SDK automatically disables dedupe for Workflows; verify you use `instrumentWorkflowWithSentry` |\n",{"name":5,"parent":24,"license":15,"category":25,"description":7,"disable-model-invocation":26},"sentry-sdk-setup","sdk-setup",true,"main","b1e4ffadb4f933bbbcaa03a83f8b9929171ac28b",".agents\u002Fskills\u002Fsentry-cloudflare-sdk",0,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR","https:\u002F\u002Fgithub.com\u002FHazek-dc","2026-10-22 08:36:44",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":26},[36,39,42],{"tool":37,"command":38},"npx","npx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill sentry-cloudflare-sdk",{"tool":40,"command":41},"bunx","bunx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill sentry-cloudflare-sdk",{"tool":43,"command":44},"pnpm","pnpm dlx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill sentry-cloudflare-sdk","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsentry-cloudflare-sdk\u002FSKILL.md",[47,53,57,61,65],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fcrons.md","REFERENCE","参考文档",6121,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsentry-cloudflare-sdk\u002Freferences\u002Fcrons.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fdurable-objects.md",13390,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsentry-cloudflare-sdk\u002Freferences\u002Fdurable-objects.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Ferror-monitoring.md",8818,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsentry-cloudflare-sdk\u002Freferences\u002Ferror-monitoring.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Flogging.md",5249,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsentry-cloudflare-sdk\u002Freferences\u002Flogging.md",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Ftracing.md",9521,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fsentry-cloudflare-sdk\u002Freferences\u002Ftracing.md",[70,78,85,92,99,106],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7DS6GGYRZAYD33PFPS8Z2T3","testing-best-practices","Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.","MIT","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftesting-best-practices\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7DS6BC3AW7HTPRHE2TTVKWM","tailwindcss-development","Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex\u002Fgrid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3\u002Fv4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML\u002FCSS component, CSS file audits, build tool configuration, and vanilla CSS.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftailwindcss-development\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7DS66GE6B11MYJDVC74HXM4","laravel-best-practices","Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Flaravel-best-practices\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7DS5ZW717DMS6P1E90AQCKV","infer-conventions","Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai\u002Frules`, resolve mixed or conflicting patterns (e.g. \"are we using Form Requests or inline validation?\"), or onboard agents and teammates to \"how we do things here\". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai\u002Frules` files by hand.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finfer-conventions\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7DS5W12RGCVJTFQJ1N0GB8E","inertia-react-development","Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using \u003CLink>, \u003CForm>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finertia-react-development\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":74,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7DS5PVDPMPCWSK2RXPDC9BB","deploying-to-cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Fdeploying-to-cloud\u002FSKILL.md",[],[]]