posthog-react-native 4.78.4 → 4.78.5

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveOptionalPlugin=exports.OptionalReactNativePluginVersion=exports.OptionalReactNativePlugin=void 0;var _reactNative=require("react-native");var resolveOptionalPlugin=exports.resolveOptionalPlugin=function resolveOptionalPlugin(platformOS,loaders){var _a;var plugin;var version;if(platformOS!=='web'){try{plugin=loaders?loaders.loadPrimary():require('@posthog/react-native-plugin');try{version=loaders?loaders.loadPrimaryVersion():(_a=require('@posthog/react-native-plugin/package.json'))===null||_a===void 0?void 0:_a.version;}catch(_b){}}catch(_c){}if(!plugin&&platformOS!=='macos'){try{plugin=loaders?loaders.loadLegacy():require('posthog-react-native-session-replay');}catch(_d){}}}return{plugin:plugin,version:version};};var optionalPlugin=resolveOptionalPlugin(_reactNative.Platform.OS);var OptionalReactNativePlugin=exports.OptionalReactNativePlugin=optionalPlugin.plugin;var OptionalReactNativePluginVersion=exports.OptionalReactNativePluginVersion=optionalPlugin.version;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveOptionalPlugin=exports.OptionalReactNativePluginVersion=exports.OptionalReactNativePlugin=void 0;var _reactNative=require("react-native");var legacyPluginWarned=false;var resolveOptionalPlugin=exports.resolveOptionalPlugin=function resolveOptionalPlugin(platformOS,loaders){var _a;var plugin;var version;if(platformOS!=='web'){try{plugin=loaders?loaders.loadPrimary():require('@posthog/react-native-plugin');try{version=loaders?loaders.loadPrimaryVersion():(_a=require('@posthog/react-native-plugin/package.json'))===null||_a===void 0?void 0:_a.version;}catch(_b){}}catch(_c){}if(!plugin&&platformOS!=='macos'){try{plugin=loaders?loaders.loadLegacy():require('posthog-react-native-session-replay');}catch(_d){}if(plugin&&!legacyPluginWarned){legacyPluginWarned=true;console.warn('[PostHog] posthog-react-native-session-replay is deprecated and no longer receives native SDK updates. '+'Replace it with @posthog/react-native-plugin.');}}}return{plugin:plugin,version:version};};var optionalPlugin=resolveOptionalPlugin(_reactNative.Platform.OS);var OptionalReactNativePlugin=exports.OptionalReactNativePlugin=optionalPlugin.plugin;var OptionalReactNativePluginVersion=exports.OptionalReactNativePluginVersion=optionalPlugin.version;
2
2
  //# sourceMappingURL=OptionalPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OptionalPlugin.js","names":["_reactNative","require","resolveOptionalPlugin","exports","platformOS","loaders","plugin","version","loadPrimary","loadPrimaryVersion","_a","loadLegacy","optionalPlugin","Platform","OS","OptionalReactNativePlugin","OptionalReactNativePluginVersion"],"sources":["../../src/optional/OptionalPlugin.ts"],"sourcesContent":["import { Platform } from 'react-native'\n\n// Optional native dependency; resolved at runtime via require()/try-catch below.\nimport type PostHogReactNativePlugin from '@posthog/react-native-plugin'\nimport type { PostHogPushIdentityProvider } from '../types'\n\n/**\n * `@posthog/react-native-plugin` is the primary native plugin; we fall back to\n * `posthog-react-native-session-replay` (same surface minus the newer methods)\n * when only the legacy package is installed. Optional methods are absent on\n * older plugins, so callers check availability at runtime.\n *\n * `captureFatalException` is part of `PostHogReactNativePlugin` since the version that\n * moved fatal JavaScript exceptions onto the native SDK's own queue. Older plugins do not\n * expose it, so callers check existence before use and fall back to the JS event queue.\n */\nexport type PostHogReactNativePluginExtended = typeof PostHogReactNativePlugin & {\n setup?: (sessionId: string, sdkOptions: { [key: string]: any }, pluginConfig: { [key: string]: any }) => Promise<void>\n startRecording?: (resumeCurrent: boolean) => Promise<void>\n stopRecording?: () => Promise<void>\n addExceptionStep?: (message: string, properties?: { [key: string]: any }) => Promise<void>\n registerPushNotificationToken?: (deviceToken: string, appId: string | null) => Promise<void>\n unregisterPushNotificationToken?: () => Promise<void>\n setOptOut?: (optOut: boolean) => Promise<void>\n capturePushNotificationOpened?: (properties: { [key: string]: any }) => Promise<void>\n setPushIdentityProvider?: (provider: PostHogPushIdentityProvider) => void\n reset?: (distinctId: string, anonymousId: string) => Promise<void>\n captureFatalException?: (distinctId: string, timestamp: string, properties: { [key: string]: any }) => Promise<void>\n}\n\nexport type OptionalPluginLoaders = {\n loadPrimary: () => PostHogReactNativePluginExtended\n loadPrimaryVersion: () => string | undefined\n loadLegacy: () => PostHogReactNativePluginExtended\n}\n\nexport const resolveOptionalPlugin = (\n platformOS: string,\n loaders?: OptionalPluginLoaders\n): { plugin: PostHogReactNativePluginExtended | undefined; version: string | undefined } => {\n let plugin: PostHogReactNativePluginExtended | undefined\n let version: string | undefined\n\n if (platformOS !== 'web') {\n try {\n plugin = loaders ? loaders.loadPrimary() : require('@posthog/react-native-plugin')\n try {\n version = loaders ? loaders.loadPrimaryVersion() : require('@posthog/react-native-plugin/package.json')?.version\n } catch {\n // Strict resolvers can reject this unexported subpath on older plugin versions.\n // Metro falls back to file-based resolution, so version logging only degrades to unknown where needed.\n }\n } catch {}\n\n // The legacy fallback is session-replay only and has no macOS support, so it's skipped on macOS.\n if (!plugin && platformOS !== 'macos') {\n try {\n plugin = loaders ? loaders.loadLegacy() : require('posthog-react-native-session-replay')\n } catch {}\n }\n }\n\n return { plugin, version }\n}\n\nconst optionalPlugin = resolveOptionalPlugin(Platform.OS)\n\nexport const OptionalReactNativePlugin = optionalPlugin.plugin\n\n// Resolved version of the loaded native plugin. It is logged next to the replay\n// config so a stale plugin, which silently ignores newer options such as sampleRate,\n// is visible in a debug log.\nexport const OptionalReactNativePluginVersion = optionalPlugin.version\n"],"mappings":"sLAAA,IAAAA,YAAA,CAAAC,OAAA,iBAoCO,GAAM,CAAAC,qBAAqB,CAAAC,OAAA,CAAAD,qBAAA,CAAG,QAAxB,CAAAA,qBAAqBA,CAChCE,UAAkB,CAClBC,OAA+B,CAC0D,C,OACzF,GAAI,CAAAC,MAAoD,CACxD,GAAI,CAAAC,OAA2B,CAE/B,GAAIH,UAAU,GAAK,KAAK,CAAE,CACxB,GAAI,CACFE,MAAM,CAAGD,OAAO,CAAGA,OAAO,CAACG,WAAW,EAAE,CAAGP,OAAO,CAAC,8BAA8B,CAAC,CAClF,GAAI,CACFM,OAAO,CAAGF,OAAO,CAAGA,OAAO,CAACI,kBAAkB,EAAE,CAAG,CAAAC,EAAA,CAAAT,OAAO,CAAC,2CAA2C,CAAC,UAAAS,EAAA,iBAAAA,EAAA,CAAEH,OAAO,CAClH,C,SAAQ,CAGR,CACF,C,SAAQ,CAAC,CAGT,GAAI,CAACD,MAAM,EAAIF,UAAU,GAAK,OAAO,CAAE,CACrC,GAAI,CACFE,MAAM,CAAGD,OAAO,CAAGA,OAAO,CAACM,UAAU,EAAE,CAAGV,OAAO,CAAC,qCAAqC,CAAC,CAC1F,C,SAAQ,CAAC,CACX,CACF,CAEA,MAAO,CAAEK,MAAM,CAANA,MAAM,CAAEC,OAAO,CAAPA,OAAO,CAAE,CAC5B,CAAC,CAED,GAAM,CAAAK,cAAc,CAAGV,qBAAqB,CAACW,qBAAQ,CAACC,EAAE,CAAC,CAElD,GAAM,CAAAC,yBAAyB,CAAAZ,OAAA,CAAAY,yBAAA,CAAGH,cAAc,CAACN,MAAM,CAKvD,GAAM,CAAAU,gCAAgC,CAAAb,OAAA,CAAAa,gCAAA,CAAGJ,cAAc,CAACL,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"OptionalPlugin.js","names":["_reactNative","require","legacyPluginWarned","resolveOptionalPlugin","exports","platformOS","loaders","plugin","version","loadPrimary","loadPrimaryVersion","_a","loadLegacy","console","warn","optionalPlugin","Platform","OS","OptionalReactNativePlugin","OptionalReactNativePluginVersion"],"sources":["../../src/optional/OptionalPlugin.ts"],"sourcesContent":["import { Platform } from 'react-native'\n\n// Optional native dependency; resolved at runtime via require()/try-catch below.\nimport type PostHogReactNativePlugin from '@posthog/react-native-plugin'\nimport type { PostHogPushIdentityProvider } from '../types'\n\n/**\n * `@posthog/react-native-plugin` is the primary native plugin; we fall back to\n * `posthog-react-native-session-replay` (same surface minus the newer methods)\n * when only the legacy package is installed. Optional methods are absent on\n * older plugins, so callers check availability at runtime.\n *\n * `captureFatalException` is part of `PostHogReactNativePlugin` since the version that\n * moved fatal JavaScript exceptions onto the native SDK's own queue. Older plugins do not\n * expose it, so callers check existence before use and fall back to the JS event queue.\n */\nexport type PostHogReactNativePluginExtended = typeof PostHogReactNativePlugin & {\n setup?: (sessionId: string, sdkOptions: { [key: string]: any }, pluginConfig: { [key: string]: any }) => Promise<void>\n startRecording?: (resumeCurrent: boolean) => Promise<void>\n stopRecording?: () => Promise<void>\n addExceptionStep?: (message: string, properties?: { [key: string]: any }) => Promise<void>\n registerPushNotificationToken?: (deviceToken: string, appId: string | null) => Promise<void>\n unregisterPushNotificationToken?: () => Promise<void>\n setOptOut?: (optOut: boolean) => Promise<void>\n capturePushNotificationOpened?: (properties: { [key: string]: any }) => Promise<void>\n setPushIdentityProvider?: (provider: PostHogPushIdentityProvider) => void\n reset?: (distinctId: string, anonymousId: string) => Promise<void>\n captureFatalException?: (distinctId: string, timestamp: string, properties: { [key: string]: any }) => Promise<void>\n}\n\nexport type OptionalPluginLoaders = {\n loadPrimary: () => PostHogReactNativePluginExtended\n loadPrimaryVersion: () => string | undefined\n loadLegacy: () => PostHogReactNativePluginExtended\n}\n\nlet legacyPluginWarned = false\n\nexport const resolveOptionalPlugin = (\n platformOS: string,\n loaders?: OptionalPluginLoaders\n): { plugin: PostHogReactNativePluginExtended | undefined; version: string | undefined } => {\n let plugin: PostHogReactNativePluginExtended | undefined\n let version: string | undefined\n\n if (platformOS !== 'web') {\n try {\n plugin = loaders ? loaders.loadPrimary() : require('@posthog/react-native-plugin')\n try {\n version = loaders ? loaders.loadPrimaryVersion() : require('@posthog/react-native-plugin/package.json')?.version\n } catch {\n // Strict resolvers can reject this unexported subpath on older plugin versions.\n // Metro falls back to file-based resolution, so version logging only degrades to unknown where needed.\n }\n } catch {}\n\n // The legacy fallback is session-replay only and has no macOS support, so it's skipped on macOS.\n if (!plugin && platformOS !== 'macos') {\n try {\n plugin = loaders ? loaders.loadLegacy() : require('posthog-react-native-session-replay')\n } catch {}\n\n // Always visible (not gated on debug): it resolves at import, before any client or logger exists.\n if (plugin && !legacyPluginWarned) {\n legacyPluginWarned = true\n console.warn(\n '[PostHog] posthog-react-native-session-replay is deprecated and no longer receives native SDK updates. ' +\n 'Replace it with @posthog/react-native-plugin.'\n )\n }\n }\n }\n\n return { plugin, version }\n}\n\nconst optionalPlugin = resolveOptionalPlugin(Platform.OS)\n\nexport const OptionalReactNativePlugin = optionalPlugin.plugin\n\n// Resolved version of the loaded native plugin. It is logged next to the replay\n// config so a stale plugin, which silently ignores newer options such as sampleRate,\n// is visible in a debug log.\nexport const OptionalReactNativePluginVersion = optionalPlugin.version\n"],"mappings":"sLAAA,IAAAA,YAAA,CAAAC,OAAA,iBAoCA,GAAI,CAAAC,kBAAkB,CAAG,KAAK,CAEvB,GAAM,CAAAC,qBAAqB,CAAAC,OAAA,CAAAD,qBAAA,CAAG,QAAxB,CAAAA,qBAAqBA,CAChCE,UAAkB,CAClBC,OAA+B,CAC0D,C,OACzF,GAAI,CAAAC,MAAoD,CACxD,GAAI,CAAAC,OAA2B,CAE/B,GAAIH,UAAU,GAAK,KAAK,CAAE,CACxB,GAAI,CACFE,MAAM,CAAGD,OAAO,CAAGA,OAAO,CAACG,WAAW,EAAE,CAAGR,OAAO,CAAC,8BAA8B,CAAC,CAClF,GAAI,CACFO,OAAO,CAAGF,OAAO,CAAGA,OAAO,CAACI,kBAAkB,EAAE,CAAG,CAAAC,EAAA,CAAAV,OAAO,CAAC,2CAA2C,CAAC,UAAAU,EAAA,iBAAAA,EAAA,CAAEH,OAAO,CAClH,C,SAAQ,CAGR,CACF,C,SAAQ,CAAC,CAGT,GAAI,CAACD,MAAM,EAAIF,UAAU,GAAK,OAAO,CAAE,CACrC,GAAI,CACFE,MAAM,CAAGD,OAAO,CAAGA,OAAO,CAACM,UAAU,EAAE,CAAGX,OAAO,CAAC,qCAAqC,CAAC,CAC1F,C,SAAQ,CAAC,CAGT,GAAIM,MAAM,EAAI,CAACL,kBAAkB,CAAE,CACjCA,kBAAkB,CAAG,IAAI,CACzBW,OAAO,CAACC,IAAI,CACV,yGAAyG,CACvG,+CAA+C,CAClD,CACH,CACF,CACF,CAEA,MAAO,CAAEP,MAAM,CAANA,MAAM,CAAEC,OAAO,CAAPA,OAAO,CAAE,CAC5B,CAAC,CAED,GAAM,CAAAO,cAAc,CAAGZ,qBAAqB,CAACa,qBAAQ,CAACC,EAAE,CAAC,CAElD,GAAM,CAAAC,yBAAyB,CAAAd,OAAA,CAAAc,yBAAA,CAAGH,cAAc,CAACR,MAAM,CAKvD,GAAM,CAAAY,gCAAgC,CAAAf,OAAA,CAAAe,gCAAA,CAAGJ,cAAc,CAACP,OAAO","ignoreList":[]}
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "4.78.4";
1
+ export declare const version = "4.78.5";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.78.4";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.78.5";
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.78.4\"\n"],"mappings":"6FAAO,GAAM,CAAAA,OAAO,CAAAC,OAAA,CAAAD,OAAA,CAAG,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.78.5\"\n"],"mappings":"6FAAO,GAAM,CAAAA,OAAO,CAAAC,OAAA,CAAAD,OAAA,CAAG,QAAQ","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-react-native",
3
- "version": "4.78.4",
3
+ "version": "4.78.5",
4
4
  "bugs": {
5
5
  "url": "https://github.com/PostHog/posthog-js/issues"
6
6
  },
@@ -34,8 +34,8 @@
34
34
  "directory": "packages/react-native"
35
35
  },
36
36
  "dependencies": {
37
- "@posthog/core": "^1.55.3",
38
- "@posthog/types": "^1.413.0"
37
+ "@posthog/types": "^1.413.0",
38
+ "@posthog/core": "^1.56.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@babel/cli": "^7.19.3",
@@ -74,8 +74,8 @@
74
74
  "@vitest/coverage-v8": "^1.6.1",
75
75
  "vitest": "^1.6.1",
76
76
  "@posthog-tooling/rollup-utils": "1.1.1",
77
- "@posthog-tooling/tsconfig-base": "1.1.1",
78
- "@posthog/react-native-plugin": "2.12.3"
77
+ "@posthog/react-native-plugin": "2.12.4",
78
+ "@posthog-tooling/tsconfig-base": "1.1.1"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "@react-native-async-storage/async-storage": ">=1.0.0",