@sendoracloud/sdk-react-native 1.10.0 → 1.12.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/dist/index.cjs CHANGED
@@ -223,7 +223,7 @@ async function request(opts, method, path, body, extraHeaders, reqOpts) {
223
223
  // package.json
224
224
  var package_default = {
225
225
  name: "@sendoracloud/sdk-react-native",
226
- version: "1.10.0",
226
+ version: "1.12.0",
227
227
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
228
228
  type: "module",
229
229
  main: "./dist/index.cjs",
@@ -2052,8 +2052,24 @@ function buildDeviceContext(appVersion) {
2052
2052
  return void 0;
2053
2053
  }
2054
2054
  }
2055
+ function expoNativeAppVersion() {
2056
+ try {
2057
+ const nm = import_react_native4.NativeModules;
2058
+ const c = nm?.ExponentConstants ?? nm?.ExpoConstants;
2059
+ if (!c) return "";
2060
+ if (typeof c.nativeAppVersion === "string" && c.nativeAppVersion) return c.nativeAppVersion;
2061
+ const raw = c.expoConfig ?? c.manifest ?? c.manifest2;
2062
+ const m = typeof raw === "string" ? JSON.parse(raw) : raw;
2063
+ const v = m?.version ?? m?.extra?.expoClient?.version;
2064
+ return typeof v === "string" ? v : "";
2065
+ } catch {
2066
+ return "";
2067
+ }
2068
+ }
2055
2069
  function resolveAppVersion(configAppVersion) {
2056
2070
  if (configAppVersion) return configAppVersion;
2071
+ const native = expoNativeAppVersion();
2072
+ if (native) return native;
2057
2073
  try {
2058
2074
  const env = process.env.EXPO_PUBLIC_APP_VERSION;
2059
2075
  if (env) return env;
@@ -2875,6 +2891,10 @@ var SendoraSDK = class {
2875
2891
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2876
2892
  ...this.userId ? { userId: this.userId } : {},
2877
2893
  anonymousId: this.anonId,
2894
+ // Top-level sessionId so backend `events.session_id` populates (powers
2895
+ // the Audience "Sessions & engagement" metrics). Set by auto-track;
2896
+ // blank until the first auto event of the launch → omitted when empty.
2897
+ ...this.sessionId ? { sessionId: this.sessionId } : {},
2878
2898
  properties: payload.properties ?? {},
2879
2899
  context: {
2880
2900
  platform: "react-native",
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/index.ts
2
2
  import "react-native-get-random-values";
3
- import { Platform } from "react-native";
3
+ import { Platform, NativeModules } from "react-native";
4
4
 
5
5
  // src/storage.ts
6
6
  var PREFIX = "sendora_";
@@ -180,7 +180,7 @@ async function request(opts, method, path, body, extraHeaders, reqOpts) {
180
180
  // package.json
181
181
  var package_default = {
182
182
  name: "@sendoracloud/sdk-react-native",
183
- version: "1.10.0",
183
+ version: "1.12.0",
184
184
  description: "Sendora Cloud React Native + Expo SDK \u2014 analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
185
185
  type: "module",
186
186
  main: "./dist/index.cjs",
@@ -2014,8 +2014,24 @@ function buildDeviceContext(appVersion) {
2014
2014
  return void 0;
2015
2015
  }
2016
2016
  }
2017
+ function expoNativeAppVersion() {
2018
+ try {
2019
+ const nm = NativeModules;
2020
+ const c = nm?.ExponentConstants ?? nm?.ExpoConstants;
2021
+ if (!c) return "";
2022
+ if (typeof c.nativeAppVersion === "string" && c.nativeAppVersion) return c.nativeAppVersion;
2023
+ const raw = c.expoConfig ?? c.manifest ?? c.manifest2;
2024
+ const m = typeof raw === "string" ? JSON.parse(raw) : raw;
2025
+ const v = m?.version ?? m?.extra?.expoClient?.version;
2026
+ return typeof v === "string" ? v : "";
2027
+ } catch {
2028
+ return "";
2029
+ }
2030
+ }
2017
2031
  function resolveAppVersion(configAppVersion) {
2018
2032
  if (configAppVersion) return configAppVersion;
2033
+ const native = expoNativeAppVersion();
2034
+ if (native) return native;
2019
2035
  try {
2020
2036
  const env = process.env.EXPO_PUBLIC_APP_VERSION;
2021
2037
  if (env) return env;
@@ -2837,6 +2853,10 @@ var SendoraSDK = class {
2837
2853
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
2838
2854
  ...this.userId ? { userId: this.userId } : {},
2839
2855
  anonymousId: this.anonId,
2856
+ // Top-level sessionId so backend `events.session_id` populates (powers
2857
+ // the Audience "Sessions & engagement" metrics). Set by auto-track;
2858
+ // blank until the first auto event of the launch → omitted when empty.
2859
+ ...this.sessionId ? { sessionId: this.sessionId } : {},
2840
2860
  properties: payload.properties ?? {},
2841
2861
  context: {
2842
2862
  platform: "react-native",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendoracloud/sdk-react-native",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "description": "Sendora Cloud React Native + Expo SDK — analytics, identity, push-token registration, auth, deep links (Branch / Firebase Dynamic Links parity). Auth + analytics + deep links work in Expo Go; push token registration requires a Dev Client (EAS Build or `npx expo prebuild`).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",