@logbrew/next 0.1.14 → 0.1.15

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 CHANGED
@@ -270,7 +270,7 @@ import {
270
270
  const client = createLogBrewNextBrowserClient({
271
271
  clientKey: "LOGBREW_CLIENT_KEY",
272
272
  sdkName: "my-next-app",
273
- sdkVersion: "0.1.14"
273
+ sdkVersion: "0.1.15"
274
274
  });
275
275
 
276
276
  const routePatterns = [
@@ -301,8 +301,8 @@ Use `captureNextNavigation(client, input)` when you want to emit a route span fr
301
301
 
302
302
  ## Client Errors
303
303
 
304
- `createLogBrewNextBrowserClient()` sends events on its own with `fetch` (5
305
- seconds after the first queued event, to save battery). Pass a `transport` to
304
+ `createLogBrewNextBrowserClient()` sends events on its own with `fetch` (1
305
+ second after the first queued event). Pass a `transport` to
306
306
  replace it, or `transport: null` to keep the client manual. Browser events
307
307
  carry the release and environment from `NEXT_PUBLIC_LOGBREW_RELEASE` and
308
308
  `NEXT_PUBLIC_LOGBREW_ENVIRONMENT`, or from `NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA`
@@ -347,7 +347,7 @@ import { createLogBrewNextClient } from "@logbrew/next";
347
347
  const client = createLogBrewNextClient({
348
348
  serverApiKey: "LOGBREW_SERVER_API_KEY",
349
349
  sdkName: "my-next-app",
350
- sdkVersion: "0.1.14"
350
+ sdkVersion: "0.1.15"
351
351
  });
352
352
  ```
353
353
 
package/client.cjs CHANGED
@@ -10,8 +10,8 @@ const {
10
10
  } = require("@logbrew/sdk");
11
11
 
12
12
  const DEFAULT_ENDPOINT = "https://api.logbrew.co/v1/events";
13
- // Browsers keep a 5-second interval to save battery and radio; pagehide flushes the rest.
14
- const DEFAULT_BROWSER_DELIVERY_INTERVAL_MS = 5000;
13
+ // Send 1 second after the first queued event; pagehide flushes the rest when the page closes.
14
+ const DEFAULT_BROWSER_DELIVERY_INTERVAL_MS = 1000;
15
15
  const clientEndpoints = new WeakMap();
16
16
 
17
17
  function createLogBrewNextBrowserClient({
@@ -22,7 +22,7 @@ function createLogBrewNextBrowserClient({
22
22
  endpoint = DEFAULT_ENDPOINT,
23
23
  eventFilter,
24
24
  sdkName = "logbrew-next-client",
25
- sdkVersion = "0.1.14",
25
+ sdkVersion = "0.1.15",
26
26
  maxQueueSize,
27
27
  maxRetries = 2,
28
28
  onEventDropped,
package/client.d.cts CHANGED
@@ -19,7 +19,7 @@ export type CreateLogBrewNextBrowserClientConfig = {
19
19
  eventFilter?: EventFilter;
20
20
  maxQueueSize?: number;
21
21
  onEventDropped?: (drop: DroppedEvent) => void;
22
- /** Delivery interval after the first queued event. Defaults to 5000 ms to save battery. */
22
+ /** Delivery interval after the first queued event. Defaults to 1000 ms. */
23
23
  deliveryIntervalMs?: number;
24
24
  /** Ingest endpoint for the built-in fetch transport. */
25
25
  endpoint?: string;
package/client.d.ts CHANGED
@@ -19,7 +19,7 @@ export type CreateLogBrewNextBrowserClientConfig = {
19
19
  eventFilter?: EventFilter;
20
20
  maxQueueSize?: number;
21
21
  onEventDropped?: (drop: DroppedEvent) => void;
22
- /** Delivery interval after the first queued event. Defaults to 5000 ms to save battery. */
22
+ /** Delivery interval after the first queued event. Defaults to 1000 ms. */
23
23
  deliveryIntervalMs?: number;
24
24
  /** Ingest endpoint for the built-in fetch transport. */
25
25
  endpoint?: string;
package/client.js CHANGED
@@ -10,8 +10,8 @@ import {
10
10
  } from "@logbrew/sdk";
11
11
 
12
12
  const DEFAULT_ENDPOINT = "https://api.logbrew.co/v1/events";
13
- // Browsers keep a 5-second interval to save battery and radio; pagehide flushes the rest.
14
- const DEFAULT_BROWSER_DELIVERY_INTERVAL_MS = 5000;
13
+ // Send 1 second after the first queued event; pagehide flushes the rest when the page closes.
14
+ const DEFAULT_BROWSER_DELIVERY_INTERVAL_MS = 1000;
15
15
  const clientEndpoints = new WeakMap();
16
16
 
17
17
  export function createLogBrewNextBrowserClient({
@@ -22,7 +22,7 @@ export function createLogBrewNextBrowserClient({
22
22
  endpoint = DEFAULT_ENDPOINT,
23
23
  eventFilter,
24
24
  sdkName = "logbrew-next-client",
25
- sdkVersion = "0.1.14",
25
+ sdkVersion = "0.1.15",
26
26
  maxQueueSize,
27
27
  maxRetries = 2,
28
28
  onEventDropped,
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.14",
28
+ sdkVersion: options.sdkVersion ?? "0.1.15",
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.14") {
27
+ if (!event || event.attributes.metadata.routeTemplate !== "/projects/[projectId]/settings" || event.attributes.metadata.operation !== "browser.navigation" || payload.sdk.version !== "0.1.15") {
28
28
  throw new Error(`unexpected Next client route span: ${JSON.stringify(event)}`);
29
29
  }
30
30
 
@@ -12,7 +12,7 @@ const POST = withLogBrewRouteHandler(
12
12
  serverApiKey: "LOGBREW_SERVER_API_KEY",
13
13
  captureRequests: false,
14
14
  sdkName: "logbrew-next-readme-example",
15
- sdkVersion: "0.1.14",
15
+ sdkVersion: "0.1.15",
16
16
  transport
17
17
  }
18
18
  );
@@ -12,7 +12,7 @@ const POST = withLogBrewRouteHandler(
12
12
  serverApiKey: "LOGBREW_SERVER_API_KEY",
13
13
  captureRequests: false,
14
14
  sdkName: "logbrew-next-real-user-smoke",
15
- sdkVersion: "0.1.14",
15
+ sdkVersion: "0.1.15",
16
16
  maxRetries: 1,
17
17
  transport
18
18
  }
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.14",
26
+ sdkVersion = "0.1.15",
27
27
  maxRetries = 2
28
28
  } = {}) {
29
29
  const authKey = serverApiKey ?? apiKey ?? readEnvServerApiKey() ?? readEnvApiKey();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logbrew/next",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Next.js App Router helpers for the public LogBrew JavaScript SDK.",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",