@watchtowerobservability/next 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2 (2026-11-18)
4
+
5
+ - `@watchtowerobservability/next` is now the documented entry point: the README leads with it, `withWatchtower()` (from `/config`; `output: 'standalone'` is handled) and `npx wt-next-doctor` after `next build`. `@watchtowerobservability/node/next` and `/next-build` are deprecated in the node SDK 0.8.1 (still working), and `/config` now wraps `withWatchtower` / `uploadSourcemaps` instead of re-exporting them, so the node SDK's deprecation tags do not show on this package's exports. Works with node 0.7.9 or later; 0.8.1 adds the "loaded too late" warning, the startup status line and `WT_DEBUG`. `register`, `onRequestError` and the edge no-op are unchanged.
6
+
7
+ ## 0.1.1 (2026-11-16)
8
+
9
+ - Needs `@watchtowerobservability/node` 0.7.9 or later: `withWatchtower` standalone builds work under pnpm and in monorepos (each OpenTelemetry peer is traced with its own dependencies), and `wt-next-doctor` checks that each peer loads. See the node SDK changelog.
10
+
3
11
  ## 0.1.0 (2026-11-15)
4
12
 
5
13
  - First release. `register()` / `onRequestError` for `instrumentation.ts` that are safe in the edge compile (export conditions `edge-light`, `worker`, `browser` resolve a no-op entry; the node SDK is imported only behind `NEXT_RUNTIME === 'nodejs'`); `/config` (`withWatchtower`: standalone tracing, externals, release, source map upload); `/tunnel` (`tunnelHandler` with Origin forwarding and `allowKey`); `/rum` (`<WatchtowerRUM>` with Cookie Munch consent and app router tracking).
package/README.md CHANGED
@@ -4,9 +4,15 @@ Watchtower for Next.js (app router, `output: 'standalone'`). Peers: `@watchtower
4
4
 
5
5
  ```ts
6
6
  // instrumentation.ts: safe in the edge compile; the node SDK loads only on the Node.js runtime (WT_INGEST_KEY)
7
+ // One file, no `instrumentation.node.ts` split: the edge-light/worker export conditions resolve a no-op there.
7
8
  export { register, onRequestError } from '@watchtowerobservability/next';
9
+ // with options instead of the line above:
10
+ // import { register as wt } from '@watchtowerobservability/next';
11
+ // export const register = () => wt({ redact: 'pii' });
8
12
  ```
9
13
 
14
+ This is the preferred entry point; `@watchtowerobservability/node/next` and `/next-build` are deprecated and still work. After `next build`, run `npx wt-next-doctor`: it checks that `.next/standalone` can load the SDK and each OpenTelemetry package, and exits 1 naming any that fail. `output: 'standalone'` is handled by `withWatchtower` (no `outputFileTracingIncludes` or `serverExternalPackages` of your own; npm, pnpm and monorepos).
15
+
10
16
  ```js
11
17
  // next.config.mjs: standalone works with no other config (node SDK + OpenTelemetry peers traced and externalized)
12
18
  import { withWatchtower } from '@watchtowerobservability/next/config';
@@ -19,7 +25,7 @@ export default withWatchtower(nextConfig, { sourcemaps: { upload: true, deleteAf
19
25
  import { WatchtowerRUM } from '@watchtowerobservability/next/rum';
20
26
  <WatchtowerRUM rumKey={process.env.NEXT_PUBLIC_WT_KEY!} /> // consent="cookiemunch" (default) | "pending" | "granted"
21
27
  ```
22
- It starts the browser SDK once (endpoint `/api/wt`, the tunnel), follows Cookie Munch consent and reports app router route patterns.
28
+ It starts the browser SDK once (endpoint `/api/wt`, the tunnel; `release` defaults to `NEXT_PUBLIC_WT_RELEASE`, which `withWatchtower` sets from `WT_RELEASE` or the CI git sha), follows Cookie Munch consent and reports app router route patterns.
23
29
 
24
30
  ```ts
25
31
  // app/api/wt/[...path]/route.ts
package/dist/config.d.ts CHANGED
@@ -1,2 +1,6 @@
1
- export { withWatchtower, uploadSourcemaps } from "@watchtowerobservability/node/next-build";
1
+ import { uploadSourcemaps as upload, withWatchtower as wrap } from "@watchtowerobservability/node/next-build";
2
+ /** Next config wrapper: standalone tracing (`output: 'standalone'` works), externals, release, optional source map upload. */
3
+ export declare const withWatchtower: typeof wrap;
4
+ /** Upload `.next/static/**\/*.map`; the `wt-next-sourcemaps` bin does the same after `next build`. */
5
+ export declare const uploadSourcemaps: typeof upload;
2
6
  export type { WatchtowerNextOptions, SourcemapOptions } from "@watchtowerobservability/node/next-build";
package/dist/config.js CHANGED
@@ -1,2 +1,7 @@
1
1
  // next.config.mjs: import { withWatchtower } from '@watchtowerobservability/next/config';
2
- export { withWatchtower, uploadSourcemaps } from "@watchtowerobservability/node/next-build";
2
+ // Wrapped (not re-exported) so the node SDK's deprecation of its own /next-build entry does not show on these.
3
+ import { uploadSourcemaps as upload, withWatchtower as wrap } from "@watchtowerobservability/node/next-build";
4
+ /** Next config wrapper: standalone tracing (`output: 'standalone'` works), externals, release, optional source map upload. */
5
+ export const withWatchtower = (config, opts) => wrap(config, opts);
6
+ /** Upload `.next/static/**\/*.map`; the `wt-next-sourcemaps` bin does the same after `next build`. */
7
+ export const uploadSourcemaps = (o) => upload(o);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@watchtowerobservability/next",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/watchtowerobservability/watchtower-next.git"
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@watchtowerobservability/browser": ">=0.5.5",
43
- "@watchtowerobservability/node": ">=0.7.5",
43
+ "@watchtowerobservability/node": ">=0.7.9",
44
44
  "next": ">=14",
45
45
  "react": ">=18"
46
46
  },
@@ -71,6 +71,8 @@
71
71
  "@types/react": "18.3.12",
72
72
  "@types/react-dom": "^18.3.1",
73
73
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
74
+ "@watchtowerobservability/browser": "0.5.8",
75
+ "@watchtowerobservability/node": "0.7.9",
74
76
  "happy-dom": "21.0.4",
75
77
  "next": "15.5.6",
76
78
  "react": "18.3.1",