@logbrew/next 0.1.11 → 0.1.12
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/README.md +20 -2
- package/client.cjs +1 -1
- package/client.js +1 -1
- package/edge.cjs +1 -1
- package/examples/client-route-spans.mjs +1 -1
- package/examples/readme-example.mjs +1 -1
- package/examples/real-user-smoke.mjs +1 -1
- package/index.cjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,6 +75,24 @@ rm -f "$HOME/.logbrew/next-service.ingest"
|
|
|
75
75
|
unset LOGBREW_PROJECT_ID
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
## Read Events Back
|
|
79
|
+
|
|
80
|
+
A successful send shows that LogBrew accepted the request. It does not show
|
|
81
|
+
that you can read the event. After your app sends one event, read it
|
|
82
|
+
back with a project read key:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
logbrew projects keys create "<project_id>" --kind read \
|
|
86
|
+
--ingest-key-file "$HOME/.logbrew/setup-check.read" --json
|
|
87
|
+
export LOGBREW_TOKEN="$(< "$HOME/.logbrew/setup-check.read")"
|
|
88
|
+
logbrew read logs --since 1h --json
|
|
89
|
+
logbrew issues --since 1h --json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
A read key reads 1 project and cannot send telemetry. Run `unset LOGBREW_TOKEN`
|
|
93
|
+
when you finish. [Read your events back](https://docs.logbrew.co/guides/verify-setup)
|
|
94
|
+
covers key kinds, empty results, and how to revoke the key.
|
|
95
|
+
|
|
78
96
|
## Release Artifacts
|
|
79
97
|
|
|
80
98
|
For production Next.js builds, wrap `next.config.mjs` with the build-time release-artifact helper. It enables `productionBrowserSourceMaps` only when your config has not chosen a value, runs after the production compile, injects matching Debug IDs, strips embedded source text by default, writes a privacy-bounded manifest next to `.next`, and can upload the prepared artifacts before the build completes:
|
|
@@ -245,7 +263,7 @@ import {
|
|
|
245
263
|
const client = createLogBrewNextBrowserClient({
|
|
246
264
|
clientKey: "LOGBREW_CLIENT_KEY",
|
|
247
265
|
sdkName: "my-next-app",
|
|
248
|
-
sdkVersion: "0.1.
|
|
266
|
+
sdkVersion: "0.1.12"
|
|
249
267
|
});
|
|
250
268
|
|
|
251
269
|
const routePatterns = [
|
|
@@ -322,7 +340,7 @@ import { createLogBrewNextClient } from "@logbrew/next";
|
|
|
322
340
|
const client = createLogBrewNextClient({
|
|
323
341
|
serverApiKey: "LOGBREW_SERVER_API_KEY",
|
|
324
342
|
sdkName: "my-next-app",
|
|
325
|
-
sdkVersion: "0.1.
|
|
343
|
+
sdkVersion: "0.1.12"
|
|
326
344
|
});
|
|
327
345
|
```
|
|
328
346
|
|
package/client.cjs
CHANGED
package/client.js
CHANGED
package/edge.cjs
CHANGED
|
@@ -25,7 +25,7 @@ function createLogBrewNextEdgeRequestErrorHandler(options = {}) {
|
|
|
25
25
|
apiKey: authKey,
|
|
26
26
|
context: deploymentContext,
|
|
27
27
|
sdkName: options.sdkName ?? "logbrew-next",
|
|
28
|
-
sdkVersion: options.sdkVersion ?? "0.1.
|
|
28
|
+
sdkVersion: options.sdkVersion ?? "0.1.12",
|
|
29
29
|
maxRetries: options.maxRetries ?? 2
|
|
30
30
|
});
|
|
31
31
|
const event = typeof options.errorEvent === "function"
|
|
@@ -24,7 +24,7 @@ const event = captureNextNavigation(client, {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const payload = JSON.parse(client.previewJson());
|
|
27
|
-
if (!event || event.attributes.metadata.routeTemplate !== "/projects/[projectId]/settings" || event.attributes.metadata.operation !== "browser.navigation" || payload.sdk.version !== "0.1.
|
|
27
|
+
if (!event || event.attributes.metadata.routeTemplate !== "/projects/[projectId]/settings" || event.attributes.metadata.operation !== "browser.navigation" || payload.sdk.version !== "0.1.12") {
|
|
28
28
|
throw new Error(`unexpected Next client route span: ${JSON.stringify(event)}`);
|
|
29
29
|
}
|
|
30
30
|
|
package/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ function createLogBrewNextClient({
|
|
|
23
23
|
serverApiKey,
|
|
24
24
|
context,
|
|
25
25
|
sdkName = "logbrew-next",
|
|
26
|
-
sdkVersion = "0.1.
|
|
26
|
+
sdkVersion = "0.1.12",
|
|
27
27
|
maxRetries = 2
|
|
28
28
|
} = {}) {
|
|
29
29
|
const authKey = serverApiKey ?? apiKey ?? readEnvServerApiKey() ?? readEnvApiKey();
|