@metarouter/react-native-sdk 0.1.20 → 0.1.21

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.
@@ -46,9 +46,6 @@ export declare class MetaRouterAnalyticsClient {
46
46
  groupId: string | undefined;
47
47
  };
48
48
  flush(): Promise<{
49
- anonymousId: string;
50
- writeKey: string;
51
- messageId: string;
52
49
  sentAt: string;
53
50
  type: import("./types").EventType;
54
51
  event?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"MetaRouterAnalyticsClient.d.ts","sourceRoot":"","sources":["../../src/analytics/MetaRouterAnalyticsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAE,MAAM,SAAS,CAAC;AAQrE,qBAAa,yBAAyB;IACpC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAyC;IACzD,OAAO,CAAC,oBAAoB,CAAwC;IACpE,OAAO,CAAC,eAAe,CAAkB;gBAE7B,OAAO,EAAE,WAAW;YAalB,IAAI;IA4BZ,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,GAAG;IAIX,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,oBAAoB,CAK1B;IAGF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMrD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOrD,IAAI,CAAC,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AM,EAAE,GAAG,CAAC;IAMrD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOrD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMnD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAOnD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMrD;;;MAGE;IAEF,KAAK,CAAC,SAAS,EAAE,MAAM;IAOvB;;OAEG;IACH,kBAAkB;IAKlB;;OAEG;IACH,YAAY;;;;;;;;;;IAaN,KAAK;;;;;;;;;;IA6DX,KAAK;IAML,OAAO;CAQR"}
@@ -1,6 +1,6 @@
1
1
  import { AppState } from 'react-native';
2
2
  import { retryWithBackoff } from "./utils/retry";
3
- import { log, setDebugLogging, warn } from "./utils/logger";
3
+ import { error, log, setDebugLogging, warn } from "./utils/logger";
4
4
  import { IdentityManager } from "./IdentityManager";
5
5
  import { enrichEvent } from "./enrichEvent";
6
6
  export class MetaRouterAnalyticsClient {
@@ -141,11 +141,9 @@ export class MetaRouterAnalyticsClient {
141
141
  }
142
142
  const batch = this.queue.map((event) => ({
143
143
  ...event,
144
- anonymousId: anonId,
145
- writeKey: this.writeKey,
146
- messageId: `${Date.now()}-${Math.random().toString(36).substring(2, 10)}`,
147
144
  sentAt: new Date().toISOString(),
148
145
  }));
146
+ console.log('batch', batch);
149
147
  this.queue = [];
150
148
  log(`Flushing ${batch.length} events to ${this.endpoint}/v1/batch`);
151
149
  try {
@@ -159,6 +157,7 @@ export class MetaRouterAnalyticsClient {
159
157
  body: JSON.stringify({ batch }),
160
158
  });
161
159
  if (!response.ok) {
160
+ error('HTTP error', response);
162
161
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
163
162
  }
164
163
  log('API call successful, status:', response.status);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/react-native-sdk",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "exports": {