@baukit/analytics-core 0.5.1 → 0.6.0

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
@@ -93,8 +93,9 @@ analytics.setConsent('denied'); // persist withdrawal and discard every unsent c
93
93
  `setConsent` is not itself an analytics event. Consent is read synchronously during construction,
94
94
  before the first capture is possible. `InMemoryAnalyticsStorage` is the dependency-free default;
95
95
  products should inject a small synchronous `AnalyticsStorage` backed by device storage. If the
96
- platform's native storage API is asynchronous, hydrate a synchronous application-owned cache
97
- before constructing the client. Storage failures fail privacy-safe: unreadable consent becomes
96
+ platform's native storage API is asynchronous, hydrate a synchronous cache before constructing
97
+ the client. On React Native, `HydratedAnalyticsStorage` from
98
+ `@baukit/analytics-posthog-native/storage` is that cache; this package does not ship one. Storage failures fail privacy-safe: unreadable consent becomes
98
99
  `unknown`, and analytics methods do not throw because persistence diagnostics fail.
99
100
 
100
101
  Withdrawal clears commands that have not been handed to the transport. A batch already in flight
@@ -1,7 +1,7 @@
1
1
  import type { AnalyticsEnvelope, AnalyticsEvent, Transport } from './types.js';
2
2
  /** A production-safe transport that intentionally discards every command. */
3
3
  export declare class NoopTransport<E extends AnalyticsEvent = AnalyticsEvent> implements Transport<E> {
4
- send(envelopes: readonly AnalyticsEnvelope<E>[]): void;
4
+ send(_envelopes: readonly AnalyticsEnvelope<E>[]): void;
5
5
  }
6
6
  /** An inspectable transport intended for unit tests and local development. */
7
7
  export declare class InMemoryTransport<E extends AnalyticsEvent = AnalyticsEvent> implements Transport<E> {
@@ -1 +1 @@
1
- {"version":3,"file":"transports.d.ts","sourceRoot":"","sources":["../src/transports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/E,6EAA6E;AAC7E,qBAAa,aAAa,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IACpF,IAAI,CAAC,SAAS,EAAE,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI;CAG9D;AAED,8EAA8E;AAC9E,qBAAa,iBAAiB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;;IAG/F,IAAW,SAAS,IAAI,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAEtD;IAEM,IAAI,CAAC,SAAS,EAAE,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI;IAItD,KAAK,IAAI,IAAI;CAGrB"}
1
+ {"version":3,"file":"transports.d.ts","sourceRoot":"","sources":["../src/transports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/E,6EAA6E;AAC7E,qBAAa,aAAa,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IACpF,IAAI,CAAC,UAAU,EAAE,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI;CAG/D;AAED,8EAA8E;AAC9E,qBAAa,iBAAiB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;;IAG/F,IAAW,SAAS,IAAI,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAEtD;IAEM,IAAI,CAAC,SAAS,EAAE,SAAS,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI;IAItD,KAAK,IAAI,IAAI;CAGrB"}
@@ -1,7 +1,7 @@
1
1
  /** A production-safe transport that intentionally discards every command. */
2
2
  export class NoopTransport {
3
- send(envelopes) {
4
- void envelopes;
3
+ send(_envelopes) {
4
+ // Discards every envelope.
5
5
  }
6
6
  }
7
7
  /** An inspectable transport intended for unit tests and local development. */
@@ -1 +1 @@
1
- {"version":3,"file":"transports.js","sourceRoot":"","sources":["../src/transports.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,OAAO,aAAa;IACjB,IAAI,CAAC,SAA0C;QACpD,KAAK,SAAS,CAAC;IACjB,CAAC;CACF;AAED,8EAA8E;AAC9E,MAAM,OAAO,iBAAiB;IACnB,UAAU,GAA2B,EAAE,CAAC;IAEjD,IAAW,SAAS;QAClB,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IAEM,IAAI,CAAC,SAA0C;QACpD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IACrC,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF"}
1
+ {"version":3,"file":"transports.js","sourceRoot":"","sources":["../src/transports.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,MAAM,OAAO,aAAa;IACjB,IAAI,CAAC,UAA2C;QACrD,2BAA2B;IAC7B,CAAC;CACF;AAED,8EAA8E;AAC9E,MAAM,OAAO,iBAAiB;IACnB,UAAU,GAA2B,EAAE,CAAC;IAEjD,IAAW,SAAS;QAClB,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9B,CAAC;IAEM,IAAI,CAAC,SAA0C;QACpD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IACrC,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baukit/analytics-core",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Provider-neutral, privacy-first product analytics port and safety policy.",
5
5
  "license": "MIT",
6
6
  "author": "Patrick Koss",