posthog-react-native 4.78.4 → 4.79.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/native-deps.js +1 -1
- package/dist/native-deps.js.map +1 -1
- package/dist/optional/OptionalPlugin.js +1 -1
- package/dist/optional/OptionalPlugin.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +4 -4
package/dist/native-deps.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getAppProperties=exports.currentDeviceType=exports.buildOptimisticAsyncStorage=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _OptionalAsyncStorage=require("./optional/OptionalAsyncStorage");var _utils=require("./utils");var _OptionalExpoApplication=require("./optional/OptionalExpoApplication");var _OptionalExpoDevice=require("./optional/OptionalExpoDevice");var _OptionalExpoFileSystem=require("./optional/OptionalExpoFileSystem");var _OptionalExpoLocalization=require("./optional/OptionalExpoLocalization");var _OptionalReactNativeDeviceInfo=require("./optional/OptionalReactNativeDeviceInfo");var _OptionalReactNativeLocalize=require("./optional/OptionalReactNativeLocalize");var _OptionalExpoFileSystemLegacy=require("./optional/OptionalExpoFileSystemLegacy");var _core=require("@posthog/core");var getDeviceType=function getDeviceType(){var _a,_b,_c;var deviceType='Mobile';if((0,_utils.isMacOS)()||(0,_utils.isWindows)()){deviceType='Desktop';}else if((0,_utils.isWeb)()){var ua=typeof navigator!=='undefined'&&navigator.userAgent?navigator.userAgent:'';var nav=typeof navigator!=='undefined'?navigator:undefined;var win=typeof globalThis.window!=='undefined'?globalThis.window:undefined;deviceType=(0,_core.detectDeviceType)(ua,{userAgentDataPlatform:(_a=nav===null||nav===void 0?void 0:nav.userAgentData)===null||_a===void 0?void 0:_a.platform,maxTouchPoints:nav===null||nav===void 0?void 0:nav.maxTouchPoints,screenWidth:(_b=win===null||win===void 0?void 0:win.screen)===null||_b===void 0?void 0:_b.width,screenHeight:(_c=win===null||win===void 0?void 0:win.screen)===null||_c===void 0?void 0:_c.height,devicePixelRatio:win===null||win===void 0?void 0:win.devicePixelRatio});}return deviceType;};var currentDeviceType=exports.currentDeviceType=getDeviceType();var getAppProperties=exports.getAppProperties=function getAppProperties(){var _a,_b;var properties={$device_type:currentDeviceType};if(_OptionalExpoApplication.OptionalExpoApplication){properties.$app_build=_OptionalExpoApplication.OptionalExpoApplication.nativeBuildVersion;properties.$app_name=_OptionalExpoApplication.OptionalExpoApplication.applicationName;properties.$app_namespace=_OptionalExpoApplication.OptionalExpoApplication.applicationId;properties.$app_version=_OptionalExpoApplication.OptionalExpoApplication.nativeApplicationVersion;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$app_build=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBuildNumber());properties.$app_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getApplicationName());properties.$app_namespace=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBundleId());properties.$app_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getVersion());}if(_OptionalExpoDevice.OptionalExpoDevice){properties.$device_manufacturer=_OptionalExpoDevice.OptionalExpoDevice.manufacturer;properties.$device_name=_OptionalExpoDevice.OptionalExpoDevice.modelName;if((0,_utils.getPlatformOS)()==='android'){properties.$os_name='Android';}else{properties.$os_name=_OptionalExpoDevice.OptionalExpoDevice.osName;}properties.$os_version=_OptionalExpoDevice.OptionalExpoDevice.osVersion;properties.$is_emulator=!_OptionalExpoDevice.OptionalExpoDevice.isDevice;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$device_manufacturer=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getManufacturerSync());properties.$device_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getModel());properties.$os_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemName());properties.$os_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemVersion());properties.$is_emulator=_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.isEmulatorSync();}if(_OptionalExpoLocalization.OptionalExpoLocalization){var optionalExpoLocalization=_OptionalExpoLocalization.OptionalExpoLocalization;var locale=optionalExpoLocalization.locale;if(!locale&&optionalExpoLocalization.getLocales){locale=(_a=optionalExpoLocalization.getLocales()[0])===null||_a===void 0?void 0:_a.languageTag;}if(locale){properties.$locale=locale;}var timezone=optionalExpoLocalization.timezone;if(!timezone&&optionalExpoLocalization.getCalendars){timezone=(_b=optionalExpoLocalization.getCalendars()[0])===null||_b===void 0?void 0:_b.timeZone;}if(timezone){properties.$timezone=timezone;}}else if(_OptionalReactNativeLocalize.OptionalReactNativeLocalize){var localesFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getLocales;if(localesFn){var locales=localesFn();if(locales&&locales.length>0){var languageTag=locales[0].languageTag;if(languageTag){properties.$locale=languageTag;}}}var timezoneFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getTimeZone;if(timezoneFn){var _timezone=timezoneFn();if(_timezone){properties.$timezone=_timezone;}}}return properties;};var returnPropertyIfNotUnknown=function returnPropertyIfNotUnknown(value){if(value!=='unknown'){return value;}return null;};var buildLegacyStorage=function buildLegacyStorage(filesystem){return{getItem:function getItem(key){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var uri,stringContent,_t;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;uri=(filesystem.documentDirectory||'')+key;_context.next=1;return filesystem.readAsStringAsync(uri);case 1:stringContent=_context.sent;return _context.abrupt("return",stringContent);case 2:_context.prev=2;_t=_context["catch"](0);return _context.abrupt("return",null);case 3:case"end":return _context.stop();}},_callee,null,[[0,2]]);}))();},setItem:function setItem(key,value){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(){var uri;return _regenerator["default"].wrap(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:uri=(filesystem.documentDirectory||'')+key;_context2.next=1;return filesystem.writeAsStringAsync(uri,value);case 1:case"end":return _context2.stop();}},_callee2);}))();}};};var buildOptimisticAsyncStorage=exports.buildOptimisticAsyncStorage=function buildOptimisticAsyncStorage(){if((0,_utils.isWeb)()&&typeof(_utils.GLOBAL_OBJ===null||_utils.GLOBAL_OBJ===void 0?void 0:_utils.GLOBAL_OBJ.window)==='undefined'){return undefined;}var supportedPlatform=!(0,_utils.isWeb)()&&!(0,_utils.isMacOS)();if(supportedPlatform){if(_OptionalExpoFileSystem.OptionalExpoFileSystem){var filesystem=_OptionalExpoFileSystem.OptionalExpoFileSystem;if(filesystem.Paths&&filesystem.File){return{getItem:function getItem(key){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(){var file,stringContent,_t2;return _regenerator["default"].wrap(function(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.prev=0;file=new filesystem.File(filesystem.Paths.document,key);_context3.next=1;return file.text();case 1:stringContent=_context3.sent;return _context3.abrupt("return",stringContent);case 2:_context3.prev=2;_t2=_context3["catch"](0);return _context3.abrupt("return",null);case 3:case"end":return _context3.stop();}},_callee3,null,[[0,2]]);}))();},setItem:function setItem(key,value){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(){var file;return _regenerator["default"].wrap(function(_context4){while(1)switch(_context4.prev=_context4.next){case 0:file=new filesystem.File(filesystem.Paths.document,key);_context4.next=1;return file.write(value);case 1:case"end":return _context4.stop();}},_callee4);}))();}};}}var legacyModule=_OptionalExpoFileSystemLegacy.OptionalExpoFileSystemLegacy||_OptionalExpoFileSystem.OptionalExpoFileSystem;try{if(legacyModule&&typeof legacyModule.readAsStringAsync==='function'){return buildLegacyStorage(legacyModule);}}catch(e){}}if(_OptionalAsyncStorage.OptionalAsyncStorage){return _OptionalAsyncStorage.OptionalAsyncStorage;}throw new Error('PostHog: No storage available. Please install expo-file-system or react-native-async-storage OR implement a custom storage provider.');};
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getAppProperties=exports.currentDeviceType=exports.buildOptimisticAsyncStorage=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _OptionalAsyncStorage=require("./optional/OptionalAsyncStorage");var _utils=require("./utils");var _OptionalExpoApplication=require("./optional/OptionalExpoApplication");var _OptionalExpoDevice=require("./optional/OptionalExpoDevice");var _OptionalExpoFileSystem=require("./optional/OptionalExpoFileSystem");var _OptionalExpoLocalization=require("./optional/OptionalExpoLocalization");var _OptionalReactNativeDeviceInfo=require("./optional/OptionalReactNativeDeviceInfo");var _OptionalReactNativeLocalize=require("./optional/OptionalReactNativeLocalize");var _OptionalExpoFileSystemLegacy=require("./optional/OptionalExpoFileSystemLegacy");var _core=require("@posthog/core");var getDeviceType=function getDeviceType(){var _a,_b,_c;var deviceType='Mobile';if((0,_utils.isMacOS)()||(0,_utils.isWindows)()){deviceType='Desktop';}else if((0,_utils.isWeb)()){var ua=typeof navigator!=='undefined'&&navigator.userAgent?navigator.userAgent:'';var nav=typeof navigator!=='undefined'?navigator:undefined;var win=typeof globalThis.window!=='undefined'?globalThis.window:undefined;deviceType=(0,_core.detectDeviceType)(ua,{userAgentDataPlatform:(_a=nav===null||nav===void 0?void 0:nav.userAgentData)===null||_a===void 0?void 0:_a.platform,maxTouchPoints:nav===null||nav===void 0?void 0:nav.maxTouchPoints,screenWidth:(_b=win===null||win===void 0?void 0:win.screen)===null||_b===void 0?void 0:_b.width,screenHeight:(_c=win===null||win===void 0?void 0:win.screen)===null||_c===void 0?void 0:_c.height,devicePixelRatio:win===null||win===void 0?void 0:win.devicePixelRatio});}return deviceType;};var currentDeviceType=exports.currentDeviceType=getDeviceType();var getAppProperties=exports.getAppProperties=function getAppProperties(){var _a,_b;var properties={$device_type:currentDeviceType};var reactNativeVersion=(0,_utils.getReactNativeVersion)();if(reactNativeVersion){properties.$react_native_version=reactNativeVersion;}if(_OptionalExpoApplication.OptionalExpoApplication){properties.$app_build=_OptionalExpoApplication.OptionalExpoApplication.nativeBuildVersion;properties.$app_name=_OptionalExpoApplication.OptionalExpoApplication.applicationName;properties.$app_namespace=_OptionalExpoApplication.OptionalExpoApplication.applicationId;properties.$app_version=_OptionalExpoApplication.OptionalExpoApplication.nativeApplicationVersion;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$app_build=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBuildNumber());properties.$app_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getApplicationName());properties.$app_namespace=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBundleId());properties.$app_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getVersion());}if(_OptionalExpoDevice.OptionalExpoDevice){properties.$device_manufacturer=_OptionalExpoDevice.OptionalExpoDevice.manufacturer;properties.$device_name=_OptionalExpoDevice.OptionalExpoDevice.modelName;if((0,_utils.getPlatformOS)()==='android'){properties.$os_name='Android';}else{properties.$os_name=_OptionalExpoDevice.OptionalExpoDevice.osName;}properties.$os_version=_OptionalExpoDevice.OptionalExpoDevice.osVersion;properties.$is_emulator=!_OptionalExpoDevice.OptionalExpoDevice.isDevice;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$device_manufacturer=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getManufacturerSync());properties.$device_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getModel());properties.$os_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemName());properties.$os_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemVersion());properties.$is_emulator=_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.isEmulatorSync();}if(_OptionalExpoLocalization.OptionalExpoLocalization){var optionalExpoLocalization=_OptionalExpoLocalization.OptionalExpoLocalization;var locale=optionalExpoLocalization.locale;if(!locale&&optionalExpoLocalization.getLocales){locale=(_a=optionalExpoLocalization.getLocales()[0])===null||_a===void 0?void 0:_a.languageTag;}if(locale){properties.$locale=locale;}var timezone=optionalExpoLocalization.timezone;if(!timezone&&optionalExpoLocalization.getCalendars){timezone=(_b=optionalExpoLocalization.getCalendars()[0])===null||_b===void 0?void 0:_b.timeZone;}if(timezone){properties.$timezone=timezone;}}else if(_OptionalReactNativeLocalize.OptionalReactNativeLocalize){var localesFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getLocales;if(localesFn){var locales=localesFn();if(locales&&locales.length>0){var languageTag=locales[0].languageTag;if(languageTag){properties.$locale=languageTag;}}}var timezoneFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getTimeZone;if(timezoneFn){var _timezone=timezoneFn();if(_timezone){properties.$timezone=_timezone;}}}return properties;};var returnPropertyIfNotUnknown=function returnPropertyIfNotUnknown(value){if(value!=='unknown'){return value;}return null;};var buildLegacyStorage=function buildLegacyStorage(filesystem){return{getItem:function getItem(key){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var uri,stringContent,_t;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;uri=(filesystem.documentDirectory||'')+key;_context.next=1;return filesystem.readAsStringAsync(uri);case 1:stringContent=_context.sent;return _context.abrupt("return",stringContent);case 2:_context.prev=2;_t=_context["catch"](0);return _context.abrupt("return",null);case 3:case"end":return _context.stop();}},_callee,null,[[0,2]]);}))();},setItem:function setItem(key,value){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(){var uri;return _regenerator["default"].wrap(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:uri=(filesystem.documentDirectory||'')+key;_context2.next=1;return filesystem.writeAsStringAsync(uri,value);case 1:case"end":return _context2.stop();}},_callee2);}))();}};};var buildOptimisticAsyncStorage=exports.buildOptimisticAsyncStorage=function buildOptimisticAsyncStorage(){if((0,_utils.isWeb)()&&typeof(_utils.GLOBAL_OBJ===null||_utils.GLOBAL_OBJ===void 0?void 0:_utils.GLOBAL_OBJ.window)==='undefined'){return undefined;}var supportedPlatform=!(0,_utils.isWeb)()&&!(0,_utils.isMacOS)();if(supportedPlatform){if(_OptionalExpoFileSystem.OptionalExpoFileSystem){var filesystem=_OptionalExpoFileSystem.OptionalExpoFileSystem;if(filesystem.Paths&&filesystem.File){return{getItem:function getItem(key){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(){var file,stringContent,_t2;return _regenerator["default"].wrap(function(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.prev=0;file=new filesystem.File(filesystem.Paths.document,key);_context3.next=1;return file.text();case 1:stringContent=_context3.sent;return _context3.abrupt("return",stringContent);case 2:_context3.prev=2;_t2=_context3["catch"](0);return _context3.abrupt("return",null);case 3:case"end":return _context3.stop();}},_callee3,null,[[0,2]]);}))();},setItem:function setItem(key,value){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(){var file;return _regenerator["default"].wrap(function(_context4){while(1)switch(_context4.prev=_context4.next){case 0:file=new filesystem.File(filesystem.Paths.document,key);_context4.next=1;return file.write(value);case 1:case"end":return _context4.stop();}},_callee4);}))();}};}}var legacyModule=_OptionalExpoFileSystemLegacy.OptionalExpoFileSystemLegacy||_OptionalExpoFileSystem.OptionalExpoFileSystem;try{if(legacyModule&&typeof legacyModule.readAsStringAsync==='function'){return buildLegacyStorage(legacyModule);}}catch(e){}}if(_OptionalAsyncStorage.OptionalAsyncStorage){return _OptionalAsyncStorage.OptionalAsyncStorage;}throw new Error('PostHog: No storage available. Please install expo-file-system or react-native-async-storage OR implement a custom storage provider.');};
|
|
2
2
|
//# sourceMappingURL=native-deps.js.map
|
package/dist/native-deps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-deps.js","names":["_OptionalAsyncStorage","require","_utils","_OptionalExpoApplication","_OptionalExpoDevice","_OptionalExpoFileSystem","_OptionalExpoLocalization","_OptionalReactNativeDeviceInfo","_OptionalReactNativeLocalize","_OptionalExpoFileSystemLegacy","_core","getDeviceType","deviceType","isMacOS","isWindows","isWeb","ua","navigator","userAgent","nav","undefined","win","globalThis","window","detectDeviceType","userAgentDataPlatform","_a","userAgentData","platform","maxTouchPoints","screenWidth","_b","screen","width","screenHeight","_c","height","devicePixelRatio","currentDeviceType","exports","getAppProperties","properties","$device_type","OptionalExpoApplication","$app_build","nativeBuildVersion","$app_name","applicationName","$app_namespace","applicationId","$app_version","nativeApplicationVersion","OptionalReactNativeDeviceInfo","returnPropertyIfNotUnknown","getBuildNumber","getApplicationName","getBundleId","getVersion","OptionalExpoDevice","$device_manufacturer","manufacturer","$device_name","modelName","getPlatformOS","$os_name","osName","$os_version","osVersion","$is_emulator","isDevice","getManufacturerSync","getModel","getSystemName","getSystemVersion","isEmulatorSync","OptionalExpoLocalization","optionalExpoLocalization","locale","getLocales","languageTag","$locale","timezone","getCalendars","timeZone","$timezone","OptionalReactNativeLocalize","localesFn","locales","length","timezoneFn","getTimeZone","value","buildLegacyStorage","filesystem","getItem","key","_asyncToGenerator2","_regenerator","mark","_callee","uri","stringContent","_t","wrap","_context","prev","next","documentDirectory","readAsStringAsync","sent","abrupt","stop","setItem","_callee2","_context2","writeAsStringAsync","buildOptimisticAsyncStorage","GLOBAL_OBJ","supportedPlatform","OptionalExpoFileSystem","Paths","File","_callee3","file","_t2","_context3","document","text","_callee4","_context4","write","legacyModule","OptionalExpoFileSystemLegacy","e","OptionalAsyncStorage","Error"],"sources":["../src/native-deps.tsx"],"sourcesContent":["import { OptionalAsyncStorage } from './optional/OptionalAsyncStorage'\nimport { GLOBAL_OBJ, getPlatformOS, isMacOS, isWeb, isWindows } from './utils'\nimport { OptionalExpoApplication } from './optional/OptionalExpoApplication'\nimport { OptionalExpoDevice } from './optional/OptionalExpoDevice'\nimport { OptionalExpoFileSystem } from './optional/OptionalExpoFileSystem'\nimport { OptionalExpoLocalization } from './optional/OptionalExpoLocalization'\nimport { OptionalReactNativeDeviceInfo } from './optional/OptionalReactNativeDeviceInfo'\nimport { PostHogCustomAppProperties, PostHogCustomStorage } from './types'\nimport { OptionalReactNativeLocalize } from './optional/OptionalReactNativeLocalize'\nimport { OptionalExpoFileSystemLegacy } from './optional/OptionalExpoFileSystemLegacy'\nimport { detectDeviceType } from '@posthog/core'\n\nconst getDeviceType = (): string => {\n let deviceType = 'Mobile'\n\n if (isMacOS() || isWindows()) {\n deviceType = 'Desktop'\n } else if (isWeb()) {\n // Check user agent to determine if it's desktop or mobile\n const ua = typeof navigator !== 'undefined' && navigator.userAgent ? navigator.userAgent : ''\n\n const nav = typeof navigator !== 'undefined' ? (navigator as any) : undefined\n const win = typeof (globalThis as any).window !== 'undefined' ? (globalThis as any).window : undefined\n deviceType = detectDeviceType(ua, {\n userAgentDataPlatform: nav?.userAgentData?.platform,\n maxTouchPoints: nav?.maxTouchPoints,\n screenWidth: win?.screen?.width,\n screenHeight: win?.screen?.height,\n devicePixelRatio: win?.devicePixelRatio,\n })\n }\n return deviceType\n}\n\nexport const currentDeviceType = getDeviceType()\n\nexport const getAppProperties = (): PostHogCustomAppProperties => {\n const properties: PostHogCustomAppProperties = {\n $device_type: currentDeviceType,\n }\n\n if (OptionalExpoApplication) {\n properties.$app_build = OptionalExpoApplication.nativeBuildVersion\n properties.$app_name = OptionalExpoApplication.applicationName\n properties.$app_namespace = OptionalExpoApplication.applicationId\n properties.$app_version = OptionalExpoApplication.nativeApplicationVersion\n } else if (OptionalReactNativeDeviceInfo) {\n properties.$app_build = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getBuildNumber())\n properties.$app_name = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getApplicationName())\n properties.$app_namespace = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getBundleId())\n properties.$app_version = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getVersion())\n }\n\n if (OptionalExpoDevice) {\n properties.$device_manufacturer = OptionalExpoDevice.manufacturer\n // expo-device already maps the device model identifier to a human readable name\n properties.$device_name = OptionalExpoDevice.modelName\n\n // https://github.com/expo/expo/issues/6990\n // some devices return a value similar to:\n // HUAWEI/SNE-LX1/HWSNE:8.1.0/HUAWEISNE-LX1/131(C432):user/release-keys\n if (getPlatformOS() === 'android') {\n properties.$os_name = 'Android'\n } else {\n properties.$os_name = OptionalExpoDevice.osName\n }\n\n properties.$os_version = OptionalExpoDevice.osVersion\n properties.$is_emulator = !OptionalExpoDevice.isDevice\n } else if (OptionalReactNativeDeviceInfo) {\n properties.$device_manufacturer = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getManufacturerSync())\n // react-native-device-info already maps the device model identifier to a human readable name\n properties.$device_name = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getModel())\n properties.$os_name = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getSystemName())\n properties.$os_version = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getSystemVersion())\n properties.$is_emulator = OptionalReactNativeDeviceInfo.isEmulatorSync()\n }\n\n if (OptionalExpoLocalization) {\n // expo-localization >= 14 use functions to get these results, older versions use JS getters\n // https://github.com/expo/expo/blob/sdk-54/packages/expo-localization/CHANGELOG.md#1400--2022-10-25\n // this type below supports both variants, and type-checks with older and newer versions of expo-localization\n const optionalExpoLocalization: {\n locale?: string\n getLocales?: () => {\n languageTag: string\n }[]\n timezone?: string\n getCalendars?: () => {\n timeZone: string | null\n }[]\n } = OptionalExpoLocalization\n\n let locale = optionalExpoLocalization.locale\n if (!locale && optionalExpoLocalization.getLocales) {\n locale = optionalExpoLocalization.getLocales()[0]?.languageTag\n }\n if (locale) {\n properties.$locale = locale\n }\n let timezone: string | undefined | null = optionalExpoLocalization.timezone\n if (!timezone && optionalExpoLocalization.getCalendars) {\n timezone = optionalExpoLocalization.getCalendars()[0]?.timeZone\n }\n if (timezone) {\n properties.$timezone = timezone\n }\n } else if (OptionalReactNativeLocalize) {\n const localesFn = OptionalReactNativeLocalize.getLocales\n if (localesFn) {\n const locales = localesFn()\n\n if (locales && locales.length > 0) {\n const languageTag = locales[0].languageTag\n if (languageTag) {\n properties.$locale = languageTag\n }\n }\n }\n\n const timezoneFn = OptionalReactNativeLocalize.getTimeZone\n if (timezoneFn) {\n const timezone = timezoneFn()\n\n if (timezone) {\n properties.$timezone = timezone\n }\n }\n }\n\n return properties\n}\n\n// react-native-device-info returns 'unknown' if the property is not available (Web target)\nconst returnPropertyIfNotUnknown = (value: string | null): string | null => {\n if (value !== 'unknown') {\n return value\n }\n return null\n}\n\nconst buildLegacyStorage = (filesystem: any): PostHogCustomStorage => {\n return {\n async getItem(key: string) {\n try {\n const uri = (filesystem.documentDirectory || '') + key\n const stringContent = await filesystem.readAsStringAsync(uri)\n return stringContent\n } catch (e) {\n return null\n }\n },\n\n async setItem(key: string, value: string) {\n const uri = (filesystem.documentDirectory || '') + key\n await filesystem.writeAsStringAsync(uri, value)\n },\n }\n}\n\nexport const buildOptimisticAsyncStorage = (): PostHogCustomStorage | undefined => {\n // On web platform during SSR (no window), skip file storage\n // The caller will fall back to memory storage\n if (isWeb() && typeof (GLOBAL_OBJ as any)?.window === 'undefined') {\n return undefined\n }\n\n // expo-file-system is not supported on web and macos, so we need to use the react-native-async-storage package instead\n // see https://github.com/PostHog/posthog-js-lite/blob/5fb7bee96f739b243dfea5589e2027f16629e8cd/posthog-react-native/src/optional/OptionalExpoFileSystem.ts#L7-L11\n const supportedPlatform = !isWeb() && !isMacOS()\n\n // expo-file-system is only supported on native platforms (not web/macOS).\n // See https://github.com/PostHog/posthog-js-lite/issues/140\n if (supportedPlatform) {\n // expo >= 54 and expo-file-system >= 19: prefer the new File/Paths API.\n // We always check for the new API first because:\n // - SDK 54 stable exports legacy methods (readAsStringAsync, writeAsStringAsync) that throw\n // a deprecation error when called, so existence checks alone are unreliable.\n // - SDK 55+ has a working legacy subpath, but the new API is the recommended approach.\n // See https://github.com/PostHog/posthog-js/issues/3151\n if (OptionalExpoFileSystem) {\n const filesystem = OptionalExpoFileSystem as any\n\n if (filesystem.Paths && filesystem.File) {\n return {\n async getItem(key: string) {\n try {\n // File constructor accepts Directory instances and joins path segments\n // See https://docs.expo.dev/versions/latest/sdk/filesystem/\n const file = new filesystem.File(filesystem.Paths.document, key)\n const stringContent = await file.text()\n return stringContent\n } catch (e) {\n return null\n }\n },\n\n async setItem(key: string, value: string) {\n const file = new filesystem.File(filesystem.Paths.document, key)\n await file.write(value)\n },\n }\n }\n }\n\n // Fallback to legacy APIs for older Expo versions (expo <= 53, expo-file-system <= 18).\n // Try the legacy subpath first (available in SDK 55+), then the main module.\n // We validate that readAsStringAsync is a real function before using it,\n // to avoid calling deprecated stubs that throw at runtime (SDK 54 stable).\n const legacyModule = (OptionalExpoFileSystemLegacy || OptionalExpoFileSystem) as any\n try {\n if (legacyModule && typeof legacyModule.readAsStringAsync === 'function') {\n return buildLegacyStorage(legacyModule)\n }\n } catch (e) {}\n }\n\n if (OptionalAsyncStorage) {\n return OptionalAsyncStorage\n }\n\n throw new Error(\n 'PostHog: No storage available. Please install expo-file-system or react-native-async-storage OR implement a custom storage provider.'\n )\n}\n"],"mappings":"waAAA,IAAAA,qBAAA,CAAAC,OAAA,oCACA,IAAAC,MAAA,CAAAD,OAAA,YACA,IAAAE,wBAAA,CAAAF,OAAA,uCACA,IAAAG,mBAAA,CAAAH,OAAA,kCACA,IAAAI,uBAAA,CAAAJ,OAAA,sCACA,IAAAK,yBAAA,CAAAL,OAAA,wCACA,IAAAM,8BAAA,CAAAN,OAAA,6CAEA,IAAAO,4BAAA,CAAAP,OAAA,2CACA,IAAAQ,6BAAA,CAAAR,OAAA,4CACA,IAAAS,KAAA,CAAAT,OAAA,kBAEA,GAAM,CAAAU,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAgB,C,aACjC,GAAI,CAAAC,UAAU,CAAG,QAAQ,CAEzB,GAAI,GAAAC,cAAO,GAAE,EAAI,GAAAC,gBAAS,GAAE,CAAE,CAC5BF,UAAU,CAAG,SAAS,CACxB,CAAC,IAAM,IAAI,GAAAG,YAAK,GAAE,CAAE,CAElB,GAAM,CAAAC,EAAE,CAAG,MAAO,CAAAC,SAAS,GAAK,WAAW,EAAIA,SAAS,CAACC,SAAS,CAAGD,SAAS,CAACC,SAAS,CAAG,EAAE,CAE7F,GAAM,CAAAC,GAAG,CAAG,MAAO,CAAAF,SAAS,GAAK,WAAW,CAAIA,SAAiB,CAAGG,SAAS,CAC7E,GAAM,CAAAC,GAAG,CAAG,MAAQ,CAAAC,UAAkB,CAACC,MAAM,GAAK,WAAW,CAAID,UAAkB,CAACC,MAAM,CAAGH,SAAS,CACtGR,UAAU,CAAG,GAAAY,sBAAgB,EAACR,EAAE,CAAE,CAChCS,qBAAqB,CAAE,CAAAC,EAAA,CAAAP,GAAG,SAAHA,GAAG,iBAAHA,GAAG,CAAEQ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P,CAAAA,OAAOA,CAACjB,GAAW,CAAEJ,KAAa,WAAAK,kBAAA,aAAAC,YAAA,YAAAC,IAAA,UAAA8B,SAAA,MAAAL,IAAA,QAAA1B,YAAA,YAAAM,IAAA,UAAA0B,SAAA,iBAAAA,SAAA,CAAAxB,IAAA,CAAAwB,SAAA,CAAAvB,IAAA,SAChCiB,IAAI,CAAG,GAAI,CAAA9B,UAAU,CAAC4B,IAAI,CAAC5B,UAAU,CAAC2B,KAAK,CAACM,QAAQ,CAAE/B,GAAG,CAACkC,CAAA,UAAAvB,IAAA,SAC1D,CAAAiB,IAAI,CAACO,KAAK,CAACvC,KAAK,CAAC,yBAAAsC,SAAA,CAAAlB,IAAA,MAAAiB,QAAA,QACzB,C,CACD,CACH,CACF,CAMA,GAAM,CAAAG,YAAY,CAAIC,0DAA4B,EAAIb,8CAA8B,CACpF,GAAI,CACF,GAAIY,YAAY,EAAI,MAAO,CAAAA,YAAY,CAACvB,iBAAiB,GAAK,UAAU,CAAE,CACxE,MAAO,CAAAhB,kBAAkB,CAACuC,YAAY,CAAC,CACzC,CACF,CAAE,MAAOE,CAAC,CAAE,CAAC,CACf,CAEA,GAAIC,0CAAoB,CAAE,CACxB,MAAO,CAAAA,0CAAoB,CAC7B,CAEA,KAAM,IAAI,CAAAC,KAAK,CACb,sIAAsI,CACvI,CACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"native-deps.js","names":["_OptionalAsyncStorage","require","_utils","_OptionalExpoApplication","_OptionalExpoDevice","_OptionalExpoFileSystem","_OptionalExpoLocalization","_OptionalReactNativeDeviceInfo","_OptionalReactNativeLocalize","_OptionalExpoFileSystemLegacy","_core","getDeviceType","deviceType","isMacOS","isWindows","isWeb","ua","navigator","userAgent","nav","undefined","win","globalThis","window","detectDeviceType","userAgentDataPlatform","_a","userAgentData","platform","maxTouchPoints","screenWidth","_b","screen","width","screenHeight","_c","height","devicePixelRatio","currentDeviceType","exports","getAppProperties","properties","$device_type","reactNativeVersion","getReactNativeVersion","$react_native_version","OptionalExpoApplication","$app_build","nativeBuildVersion","$app_name","applicationName","$app_namespace","applicationId","$app_version","nativeApplicationVersion","OptionalReactNativeDeviceInfo","returnPropertyIfNotUnknown","getBuildNumber","getApplicationName","getBundleId","getVersion","OptionalExpoDevice","$device_manufacturer","manufacturer","$device_name","modelName","getPlatformOS","$os_name","osName","$os_version","osVersion","$is_emulator","isDevice","getManufacturerSync","getModel","getSystemName","getSystemVersion","isEmulatorSync","OptionalExpoLocalization","optionalExpoLocalization","locale","getLocales","languageTag","$locale","timezone","getCalendars","timeZone","$timezone","OptionalReactNativeLocalize","localesFn","locales","length","timezoneFn","getTimeZone","value","buildLegacyStorage","filesystem","getItem","key","_asyncToGenerator2","_regenerator","mark","_callee","uri","stringContent","_t","wrap","_context","prev","next","documentDirectory","readAsStringAsync","sent","abrupt","stop","setItem","_callee2","_context2","writeAsStringAsync","buildOptimisticAsyncStorage","GLOBAL_OBJ","supportedPlatform","OptionalExpoFileSystem","Paths","File","_callee3","file","_t2","_context3","document","text","_callee4","_context4","write","legacyModule","OptionalExpoFileSystemLegacy","e","OptionalAsyncStorage","Error"],"sources":["../src/native-deps.tsx"],"sourcesContent":["import { OptionalAsyncStorage } from './optional/OptionalAsyncStorage'\nimport { GLOBAL_OBJ, getPlatformOS, getReactNativeVersion, isMacOS, isWeb, isWindows } from './utils'\nimport { OptionalExpoApplication } from './optional/OptionalExpoApplication'\nimport { OptionalExpoDevice } from './optional/OptionalExpoDevice'\nimport { OptionalExpoFileSystem } from './optional/OptionalExpoFileSystem'\nimport { OptionalExpoLocalization } from './optional/OptionalExpoLocalization'\nimport { OptionalReactNativeDeviceInfo } from './optional/OptionalReactNativeDeviceInfo'\nimport { PostHogCustomAppProperties, PostHogCustomStorage } from './types'\nimport { OptionalReactNativeLocalize } from './optional/OptionalReactNativeLocalize'\nimport { OptionalExpoFileSystemLegacy } from './optional/OptionalExpoFileSystemLegacy'\nimport { detectDeviceType } from '@posthog/core'\n\nconst getDeviceType = (): string => {\n let deviceType = 'Mobile'\n\n if (isMacOS() || isWindows()) {\n deviceType = 'Desktop'\n } else if (isWeb()) {\n // Check user agent to determine if it's desktop or mobile\n const ua = typeof navigator !== 'undefined' && navigator.userAgent ? navigator.userAgent : ''\n\n const nav = typeof navigator !== 'undefined' ? (navigator as any) : undefined\n const win = typeof (globalThis as any).window !== 'undefined' ? (globalThis as any).window : undefined\n deviceType = detectDeviceType(ua, {\n userAgentDataPlatform: nav?.userAgentData?.platform,\n maxTouchPoints: nav?.maxTouchPoints,\n screenWidth: win?.screen?.width,\n screenHeight: win?.screen?.height,\n devicePixelRatio: win?.devicePixelRatio,\n })\n }\n return deviceType\n}\n\nexport const currentDeviceType = getDeviceType()\n\nexport const getAppProperties = (): PostHogCustomAppProperties => {\n const properties: PostHogCustomAppProperties = {\n $device_type: currentDeviceType,\n }\n\n const reactNativeVersion = getReactNativeVersion()\n if (reactNativeVersion) {\n properties.$react_native_version = reactNativeVersion\n }\n\n if (OptionalExpoApplication) {\n properties.$app_build = OptionalExpoApplication.nativeBuildVersion\n properties.$app_name = OptionalExpoApplication.applicationName\n properties.$app_namespace = OptionalExpoApplication.applicationId\n properties.$app_version = OptionalExpoApplication.nativeApplicationVersion\n } else if (OptionalReactNativeDeviceInfo) {\n properties.$app_build = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getBuildNumber())\n properties.$app_name = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getApplicationName())\n properties.$app_namespace = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getBundleId())\n properties.$app_version = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getVersion())\n }\n\n if (OptionalExpoDevice) {\n properties.$device_manufacturer = OptionalExpoDevice.manufacturer\n // expo-device already maps the device model identifier to a human readable name\n properties.$device_name = OptionalExpoDevice.modelName\n\n // https://github.com/expo/expo/issues/6990\n // some devices return a value similar to:\n // HUAWEI/SNE-LX1/HWSNE:8.1.0/HUAWEISNE-LX1/131(C432):user/release-keys\n if (getPlatformOS() === 'android') {\n properties.$os_name = 'Android'\n } else {\n properties.$os_name = OptionalExpoDevice.osName\n }\n\n properties.$os_version = OptionalExpoDevice.osVersion\n properties.$is_emulator = !OptionalExpoDevice.isDevice\n } else if (OptionalReactNativeDeviceInfo) {\n properties.$device_manufacturer = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getManufacturerSync())\n // react-native-device-info already maps the device model identifier to a human readable name\n properties.$device_name = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getModel())\n properties.$os_name = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getSystemName())\n properties.$os_version = returnPropertyIfNotUnknown(OptionalReactNativeDeviceInfo.getSystemVersion())\n properties.$is_emulator = OptionalReactNativeDeviceInfo.isEmulatorSync()\n }\n\n if (OptionalExpoLocalization) {\n // expo-localization >= 14 use functions to get these results, older versions use JS getters\n // https://github.com/expo/expo/blob/sdk-54/packages/expo-localization/CHANGELOG.md#1400--2022-10-25\n // this type below supports both variants, and type-checks with older and newer versions of expo-localization\n const optionalExpoLocalization: {\n locale?: string\n getLocales?: () => {\n languageTag: string\n }[]\n timezone?: string\n getCalendars?: () => {\n timeZone: string | null\n }[]\n } = OptionalExpoLocalization\n\n let locale = optionalExpoLocalization.locale\n if (!locale && optionalExpoLocalization.getLocales) {\n locale = optionalExpoLocalization.getLocales()[0]?.languageTag\n }\n if (locale) {\n properties.$locale = locale\n }\n let timezone: string | undefined | null = optionalExpoLocalization.timezone\n if (!timezone && optionalExpoLocalization.getCalendars) {\n timezone = optionalExpoLocalization.getCalendars()[0]?.timeZone\n }\n if (timezone) {\n properties.$timezone = timezone\n }\n } else if (OptionalReactNativeLocalize) {\n const localesFn = OptionalReactNativeLocalize.getLocales\n if (localesFn) {\n const locales = localesFn()\n\n if (locales && locales.length > 0) {\n const languageTag = locales[0].languageTag\n if (languageTag) {\n properties.$locale = languageTag\n }\n }\n }\n\n const timezoneFn = OptionalReactNativeLocalize.getTimeZone\n if (timezoneFn) {\n const timezone = timezoneFn()\n\n if (timezone) {\n properties.$timezone = timezone\n }\n }\n }\n\n return properties\n}\n\n// react-native-device-info returns 'unknown' if the property is not available (Web target)\nconst returnPropertyIfNotUnknown = (value: string | null): string | null => {\n if (value !== 'unknown') {\n return value\n }\n return null\n}\n\nconst buildLegacyStorage = (filesystem: any): PostHogCustomStorage => {\n return {\n async getItem(key: string) {\n try {\n const uri = (filesystem.documentDirectory || '') + key\n const stringContent = await filesystem.readAsStringAsync(uri)\n return stringContent\n } catch (e) {\n return null\n }\n },\n\n async setItem(key: string, value: string) {\n const uri = (filesystem.documentDirectory || '') + key\n await filesystem.writeAsStringAsync(uri, value)\n },\n }\n}\n\nexport const buildOptimisticAsyncStorage = (): PostHogCustomStorage | undefined => {\n // On web platform during SSR (no window), skip file storage\n // The caller will fall back to memory storage\n if (isWeb() && typeof (GLOBAL_OBJ as any)?.window === 'undefined') {\n return undefined\n }\n\n // expo-file-system is not supported on web and macos, so we need to use the react-native-async-storage package instead\n // see https://github.com/PostHog/posthog-js-lite/blob/5fb7bee96f739b243dfea5589e2027f16629e8cd/posthog-react-native/src/optional/OptionalExpoFileSystem.ts#L7-L11\n const supportedPlatform = !isWeb() && !isMacOS()\n\n // expo-file-system is only supported on native platforms (not web/macOS).\n // See https://github.com/PostHog/posthog-js-lite/issues/140\n if (supportedPlatform) {\n // expo >= 54 and expo-file-system >= 19: prefer the new File/Paths API.\n // We always check for the new API first because:\n // - SDK 54 stable exports legacy methods (readAsStringAsync, writeAsStringAsync) that throw\n // a deprecation error when called, so existence checks alone are unreliable.\n // - SDK 55+ has a working legacy subpath, but the new API is the recommended approach.\n // See https://github.com/PostHog/posthog-js/issues/3151\n if (OptionalExpoFileSystem) {\n const filesystem = OptionalExpoFileSystem as any\n\n if (filesystem.Paths && filesystem.File) {\n return {\n async getItem(key: string) {\n try {\n // File constructor accepts Directory instances and joins path segments\n // See https://docs.expo.dev/versions/latest/sdk/filesystem/\n const file = new filesystem.File(filesystem.Paths.document, key)\n const stringContent = await file.text()\n return stringContent\n } catch (e) {\n return null\n }\n },\n\n async setItem(key: string, value: string) {\n const file = new filesystem.File(filesystem.Paths.document, key)\n await file.write(value)\n },\n }\n }\n }\n\n // Fallback to legacy APIs for older Expo versions (expo <= 53, expo-file-system <= 18).\n // Try the legacy subpath first (available in SDK 55+), then the main module.\n // We validate that readAsStringAsync is a real function before using it,\n // to avoid calling deprecated stubs that throw at runtime (SDK 54 stable).\n const legacyModule = (OptionalExpoFileSystemLegacy || OptionalExpoFileSystem) as any\n try {\n if (legacyModule && typeof legacyModule.readAsStringAsync === 'function') {\n return buildLegacyStorage(legacyModule)\n }\n } catch (e) {}\n }\n\n if (OptionalAsyncStorage) {\n return OptionalAsyncStorage\n }\n\n throw new Error(\n 'PostHog: No storage available. Please install expo-file-system or react-native-async-storage OR implement a custom storage provider.'\n )\n}\n"],"mappings":"waAAA,IAAAA,qBAAA,CAAAC,OAAA,oCACA,IAAAC,MAAA,CAAAD,OAAA,YACA,IAAAE,wBAAA,CAAAF,OAAA,uCACA,IAAAG,mBAAA,CAAAH,OAAA,kCACA,IAAAI,uBAAA,CAAAJ,OAAA,sCACA,IAAAK,yBAAA,CAAAL,OAAA,wCACA,IAAAM,8BAAA,CAAAN,OAAA,6CAEA,IAAAO,4BAAA,CAAAP,OAAA,2CACA,IAAAQ,6BAAA,CAAAR,OAAA,4CACA,IAAAS,KAAA,CAAAT,OAAA,kBAEA,GAAM,CAAAU,aAAa,CAAG,QAAhB,CAAAA,aAAaA,CAAA,CAAgB,C,aACjC,GAAI,CAAAC,UAAU,CAAG,QAAQ,CAEzB,GAAI,GAAAC,cAAO,GAAE,EAAI,GAAAC,gBAAS,GAAE,CAAE,CAC5BF,UAAU,CAAG,SAAS,CACxB,CAAC,IAAM,IAAI,GAAAG,YAAK,GAAE,CAAE,CAElB,GAAM,CAAAC,EAAE,CAAG,MAAO,CAAAC,SAAS,GAAK,WAAW,EAA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AAE,MAAOE,CAAC,CAAE,CAAC,CACf,CAEA,GAAIC,0CAAoB,CAAE,CACxB,MAAO,CAAAA,0CAAoB,CAC7B,CAEA,KAAM,IAAI,CAAAC,KAAK,CACb,sIAAsI,CACvI,CACH,CAAC","ignoreList":[]}
|
|
@@ -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,
|
|
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/types.d.ts
CHANGED
|
@@ -149,6 +149,8 @@ export interface PostHogCustomAppProperties {
|
|
|
149
149
|
$timezone?: string | null;
|
|
150
150
|
/** Whether the app is running on an emulator/simulator */
|
|
151
151
|
$is_emulator?: boolean | null;
|
|
152
|
+
/** React Native version like "0.79.6" */
|
|
153
|
+
$react_native_version?: string | null;
|
|
152
154
|
}
|
|
153
155
|
export type PostHogSessionReplayConfig = {
|
|
154
156
|
/**
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["export type PostHogAutocaptureNavigationTrackerOptions = {\n routeToName?: (name: string, params: any) => string\n routeToProperties?: (name: string, params: any) => Record<string, any>\n}\n\n/**\n * @deprecated\n */\nexport type PostHogNavigationRef = {\n getCurrentRoute(): any | undefined\n isReady: () => boolean\n current?: PostHogNavigationRef | any | undefined\n}\n\nexport type PostHogRageClickConfig = {\n /**\n * Enable or disable rage click (rage tap) detection.\n *\n * When enabled the native SDK emits a `$rageclick` event whenever a user\n * taps the same area repeatedly in quick succession.\n *\n * @default true\n */\n enabled?: boolean\n /**\n * Number of consecutive taps required to trigger a rage click.\n *\n * @default 3\n */\n minimumTapCount?: number\n /**\n * Maximum pixel distance between consecutive taps for them to still\n * count toward a rage click.\n *\n * @default 30\n */\n thresholdPoints?: number\n /**\n * Maximum time in seconds allowed between consecutive taps.\n *\n * @default 1.0\n */\n timeoutInterval?: number\n}\n\nexport type PostHogAutocaptureOptions = {\n /**\n * Enable autocapture of touch events.\n *\n * On React Native Web this also captures `click` events — mouse, trackpad, keyboard\n * activation and programmatic clicks — emitted with `$event_type: 'click'`, since\n * browsers fire `touchend` only for touch input.\n *\n * @default false\n */\n captureTouches?: boolean\n /**\n * Custom prop name used to label elements for autocapture\n *\n * @default 'ph-label'\n */\n customLabelProp?: string\n /**\n * Prop name used to prevent autocapture on an element and its children\n *\n * @default 'ph-no-capture'\n */\n noCaptureProp?: string\n /**\n * Maximum number of elements to capture in the component tree hierarchy\n *\n * @default 20\n */\n maxElementsCaptured?: number\n /**\n * List of element labels to ignore during autocapture\n *\n * @default []\n */\n ignoreLabels?: string[]\n /**\n * List of prop names to capture from elements\n *\n * @default ['style', 'testID', 'accessibilityLabel', 'ph-label', 'children']\n */\n propsToCapture?: string[]\n\n /**\n * Capture the screen name (or route name) and properties\n *\n * Only used for expo-router, @react-navigation/native and react-native-navigation\n *\n * For react-native-navigation, you need to call initReactNativeNavigation before using this option\n * See example: https://posthog.com/docs/libraries/react-native#with-react-native-navigation-and-autocapture\n *\n * For @react-navigation/native v6 and below, you need to wrap the PostHogProvider within the NavigationContainer\n * See example: https://posthog.com/docs/libraries/react-native#with-react-navigationnative-and-autocapture\n *\n * For @react-navigation/native v7 and above, because of a library change, you'll need to capture the screens manually and disable this option\n * You can use the onStateChange callback from the NavigationContainer to capture the screens automatically using the screen capture method\n * You can use the 'usePostHog()' hook or your own posthog instance to capture the screens\n * Since captureScreens is disabled, you don't need to pass the navigationRef, the navigation mutation object is also ignored\n * See example: https://reactnavigation.org/docs/screen-tracking/ and https://posthog.com/docs/libraries/react-native#manually-capturing-screen-capture-events\n *\n * For expo-router, expo-router uses @react-navigation/native, but does not expose the NavigationContainer, you'll need to capture the screens manually and disable this option\n * expo-router always has access to a URL, you can use the URL to capture the screens automatically using the screen capture method\n * You can use the 'usePostHog()' hook or your own posthog instance to capture the screens\n * Since captureScreens is disabled, you don't need to pass the navigationRef, the navigation mutation object is also ignored\n * See example: https://docs.expo.dev/router/reference/screen-tracking/ and https://posthog.com/docs/libraries/react-native#manually-capturing-screen-capture-events\n *\n * @default true\n */\n captureScreens?: boolean\n /**\n * Used for mutating the screen name and properties\n * Only used if captureScreens is true\n *\n * @default Default to the route name and params\n */\n navigation?: PostHogAutocaptureNavigationTrackerOptions\n /**\n * If you create a navigation ref with createNavigationContainerRef, you need to pass the navigation ref\n * Only used for expo-router and @react-navigation/native if captureScreens is true\n *\n * @deprecated this is deprecated since it didn't work as expected, check out the `captureScreens` comments for capturing screen views semi-automatically\n */\n navigationRef?: PostHogNavigationRef\n}\n\nexport interface PostHogCustomAppProperties {\n /** Build number like \"1.2.2\" or \"122\" */\n $app_build?: string | null\n /** Name of the app as displayed below the icon like \"PostHog\" */\n $app_name?: string | null\n /** Namespace of the app usually like \"com.posthog.app\" */\n $app_namespace?: string | null\n /** Human friendly app version like what a user would see in the app store like \"1.2.2\" */\n $app_version?: string | null\n /** Manufacturer like \"Apple\", \"Samsung\" or \"Android\" */\n $device_manufacturer?: string | null\n /** Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\" */\n $device_name?: string | null\n /** Model identifier like \"iPhone13,2\" or \"SM-S921B\" */\n $device_model?: string | null\n /** Device type (\"Mobile\" | \"Desktop\") */\n $device_type?: string | null\n /** Operating system name like iOS or Android */\n $os_name?: string | null\n /** Operating system version \"14.0\" */\n $os_version?: string | null\n /** Locale (language) of the device like \"en-US\" */\n $locale?: string | null\n /** Timezone of the device like \"Europe/Berlin\" */\n $timezone?: string | null\n /** Whether the app is running on an emulator/simulator */\n $is_emulator?: boolean | null\n}\n\nexport type PostHogSessionReplayConfig = {\n /**\n * Capture touch coordinates in session replay. Set to false to keep screenshots\n * without recording taps that could reveal sensitive input on a known keypad layout.\n * Does not change masking or `PostHogProvider` touch autocapture.\n * Android and iOS only. Requires `@posthog/react-native-plugin` 2.9.0 or later;\n * older plugins and `posthog-react-native-session-replay` ignore this option.\n * Set before constructing PostHog. Changes after initialization do not update native state.\n *\n * @default true\n */\n captureTouches?: boolean\n /**\n * Enable masking of all text and text input fields\n *\n * @default true\n */\n maskAllTextInputs?: boolean\n /**\n * Enable masking of all images to a placeholder\n *\n * @default true\n */\n maskAllImages?: boolean\n /**\n * Enable masking of all sandboxed system views\n * These may include UIImagePickerController, PHPickerViewController and CNContactPickerViewController\n * iOS only\n *\n * @default true\n */\n maskAllSandboxedViews?: boolean\n /**\n * Enable capturing of logs as console events\n *\n * @default true\n */\n captureLog?: boolean\n /**\n * Deboucer delay used to reduce the number of snapshots captured and reduce performance impact\n * This is used for capturing the view as a screenshot\n * The lower the number more snapshots will be captured but higher the performance impact\n *\n * @default 1000\n * @deprecated please use throttleDelayMs instead\n */\n iOSdebouncerDelayMs?: number\n /**\n * Deboucer delay used to reduce the number of snapshots captured and reduce performance impact\n * This is used for capturing the view as a screenshot\n * The lower the number more snapshots will be captured but higher the performance impact\n * Ps: it was 500ms (0.5s) by default until version 3.3.7\n *\n * @default 1000\n * @deprecated please use throttleDelayMs instead\n */\n androidDebouncerDelayMs?: number\n /**\n * Throttling delay used to reduce the number of snapshots captured and reduce performance impact\n * This is used for capturing the view as a wireframe or screenshot\n * The lower the number more snapshots will be captured but higher the performance impact\n *\n * This value has precedence over iOSdebouncerDelayMs and androidDebouncerDelayMs\n * If this is not set, we will take the max number between iOSdebouncerDelayMs and androidDebouncerDelayMs for back compatibility\n *\n * @default 1000\n */\n throttleDelayMs?: number\n /**\n * Enable capturing network telemetry\n * iOS only\n *\n * @default true\n */\n captureNetworkTelemetry?: boolean\n /**\n * Verify that masks remain aligned while capturing session replay screenshots.\n * Android only. Requires `@posthog/react-native-plugin`.\n *\n * Enabling this can preserve screenshots during pixel-only redraws, including\n * continuously animated content, but performs additional view hierarchy walks\n * while a screenshot is captured.\n *\n * @default false\n */\n verifyScreenshotMaskAlignment?: boolean\n /**\n * Experimental. Multiplier for the physical width and height of screenshots, clamped to 0.1–1.0.\n * For example, 0.5 captures half the width and height, or one quarter of the pixels.\n * The logical replay viewport is unchanged. Non-finite values use the native default.\n * Android only. Requires `@posthog/react-native-plugin` 2.8.0 or later.\n * Does not enable session replay or change compression quality or color mode.\n *\n * @experimental\n * @default 1.0\n */\n screenshotScale?: number\n /**\n * Experimental. WebP compression quality, clamped to 0–100. Fractional values are truncated.\n * Higher values generally retain more detail and produce larger payloads.\n * Compression is lossy, except at quality 100 on Android 10, which uses lossless WebP.\n * Non-finite values use the native default. Does not change screenshot resolution.\n * Android only. Requires `@posthog/react-native-plugin` 2.8.0 or later.\n *\n * @experimental\n * @default 30\n */\n screenshotCompressionQuality?: number\n /**\n * Experimental. Screenshot bitmap pixel format. ARGB_8888 preserves transparency and color precision.\n * RGB_565 uses half the bitmap memory but reduces color precision and removes alpha,\n * making transparent window regions appear black. Unsupported devices fall back to ARGB_8888.\n * Android only. Requires `@posthog/react-native-plugin` 2.8.0 or later.\n *\n * @experimental\n * @default 'ARGB_8888'\n */\n screenshotColorMode?: 'ARGB_8888' | 'RGB_565'\n /**\n * Schedule screenshot image capture on a background queue.\n * iOS only\n * Experimental support\n *\n * Warning: Enabling this option will trigger Main Thread Checker warnings and may\n * briefly freeze the app the first time a screenshot is captured. Consider disabling\n * Main Thread Checker in your scheme's run diagnostics when enabling this.\n *\n * @default false\n */\n screenshotModeBackgroundCapture?: boolean\n /**\n * Session replay sample rate between 0 and 1\n * Local config has precedence over remote config when both are set.\n * If undefined, sampling is controlled by remote config (when available).\n */\n sampleRate?: number\n}\n\nexport interface PostHogCustomStorage {\n getItem: (key: string) => string | null | Promise<string | null>\n setItem: (key: string, value: string) => void | Promise<void>\n}\n\n/**\n * Mints a signed identity-verification token for a push subscription request.\n *\n * Called by the native SDK with the current `distinctId` and `appId`. Return\n * `null` to send the request without an identity token.\n */\nexport type PostHogPushIdentityProvider = (distinctId: string, appId: string) => Promise<string | null>\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["export type PostHogAutocaptureNavigationTrackerOptions = {\n routeToName?: (name: string, params: any) => string\n routeToProperties?: (name: string, params: any) => Record<string, any>\n}\n\n/**\n * @deprecated\n */\nexport type PostHogNavigationRef = {\n getCurrentRoute(): any | undefined\n isReady: () => boolean\n current?: PostHogNavigationRef | any | undefined\n}\n\nexport type PostHogRageClickConfig = {\n /**\n * Enable or disable rage click (rage tap) detection.\n *\n * When enabled the native SDK emits a `$rageclick` event whenever a user\n * taps the same area repeatedly in quick succession.\n *\n * @default true\n */\n enabled?: boolean\n /**\n * Number of consecutive taps required to trigger a rage click.\n *\n * @default 3\n */\n minimumTapCount?: number\n /**\n * Maximum pixel distance between consecutive taps for them to still\n * count toward a rage click.\n *\n * @default 30\n */\n thresholdPoints?: number\n /**\n * Maximum time in seconds allowed between consecutive taps.\n *\n * @default 1.0\n */\n timeoutInterval?: number\n}\n\nexport type PostHogAutocaptureOptions = {\n /**\n * Enable autocapture of touch events.\n *\n * On React Native Web this also captures `click` events — mouse, trackpad, keyboard\n * activation and programmatic clicks — emitted with `$event_type: 'click'`, since\n * browsers fire `touchend` only for touch input.\n *\n * @default false\n */\n captureTouches?: boolean\n /**\n * Custom prop name used to label elements for autocapture\n *\n * @default 'ph-label'\n */\n customLabelProp?: string\n /**\n * Prop name used to prevent autocapture on an element and its children\n *\n * @default 'ph-no-capture'\n */\n noCaptureProp?: string\n /**\n * Maximum number of elements to capture in the component tree hierarchy\n *\n * @default 20\n */\n maxElementsCaptured?: number\n /**\n * List of element labels to ignore during autocapture\n *\n * @default []\n */\n ignoreLabels?: string[]\n /**\n * List of prop names to capture from elements\n *\n * @default ['style', 'testID', 'accessibilityLabel', 'ph-label', 'children']\n */\n propsToCapture?: string[]\n\n /**\n * Capture the screen name (or route name) and properties\n *\n * Only used for expo-router, @react-navigation/native and react-native-navigation\n *\n * For react-native-navigation, you need to call initReactNativeNavigation before using this option\n * See example: https://posthog.com/docs/libraries/react-native#with-react-native-navigation-and-autocapture\n *\n * For @react-navigation/native v6 and below, you need to wrap the PostHogProvider within the NavigationContainer\n * See example: https://posthog.com/docs/libraries/react-native#with-react-navigationnative-and-autocapture\n *\n * For @react-navigation/native v7 and above, because of a library change, you'll need to capture the screens manually and disable this option\n * You can use the onStateChange callback from the NavigationContainer to capture the screens automatically using the screen capture method\n * You can use the 'usePostHog()' hook or your own posthog instance to capture the screens\n * Since captureScreens is disabled, you don't need to pass the navigationRef, the navigation mutation object is also ignored\n * See example: https://reactnavigation.org/docs/screen-tracking/ and https://posthog.com/docs/libraries/react-native#manually-capturing-screen-capture-events\n *\n * For expo-router, expo-router uses @react-navigation/native, but does not expose the NavigationContainer, you'll need to capture the screens manually and disable this option\n * expo-router always has access to a URL, you can use the URL to capture the screens automatically using the screen capture method\n * You can use the 'usePostHog()' hook or your own posthog instance to capture the screens\n * Since captureScreens is disabled, you don't need to pass the navigationRef, the navigation mutation object is also ignored\n * See example: https://docs.expo.dev/router/reference/screen-tracking/ and https://posthog.com/docs/libraries/react-native#manually-capturing-screen-capture-events\n *\n * @default true\n */\n captureScreens?: boolean\n /**\n * Used for mutating the screen name and properties\n * Only used if captureScreens is true\n *\n * @default Default to the route name and params\n */\n navigation?: PostHogAutocaptureNavigationTrackerOptions\n /**\n * If you create a navigation ref with createNavigationContainerRef, you need to pass the navigation ref\n * Only used for expo-router and @react-navigation/native if captureScreens is true\n *\n * @deprecated this is deprecated since it didn't work as expected, check out the `captureScreens` comments for capturing screen views semi-automatically\n */\n navigationRef?: PostHogNavigationRef\n}\n\nexport interface PostHogCustomAppProperties {\n /** Build number like \"1.2.2\" or \"122\" */\n $app_build?: string | null\n /** Name of the app as displayed below the icon like \"PostHog\" */\n $app_name?: string | null\n /** Namespace of the app usually like \"com.posthog.app\" */\n $app_namespace?: string | null\n /** Human friendly app version like what a user would see in the app store like \"1.2.2\" */\n $app_version?: string | null\n /** Manufacturer like \"Apple\", \"Samsung\" or \"Android\" */\n $device_manufacturer?: string | null\n /** Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\" */\n $device_name?: string | null\n /** Model identifier like \"iPhone13,2\" or \"SM-S921B\" */\n $device_model?: string | null\n /** Device type (\"Mobile\" | \"Desktop\") */\n $device_type?: string | null\n /** Operating system name like iOS or Android */\n $os_name?: string | null\n /** Operating system version \"14.0\" */\n $os_version?: string | null\n /** Locale (language) of the device like \"en-US\" */\n $locale?: string | null\n /** Timezone of the device like \"Europe/Berlin\" */\n $timezone?: string | null\n /** Whether the app is running on an emulator/simulator */\n $is_emulator?: boolean | null\n /** React Native version like \"0.79.6\" */\n $react_native_version?: string | null\n}\n\nexport type PostHogSessionReplayConfig = {\n /**\n * Capture touch coordinates in session replay. Set to false to keep screenshots\n * without recording taps that could reveal sensitive input on a known keypad layout.\n * Does not change masking or `PostHogProvider` touch autocapture.\n * Android and iOS only. Requires `@posthog/react-native-plugin` 2.9.0 or later;\n * older plugins and `posthog-react-native-session-replay` ignore this option.\n * Set before constructing PostHog. Changes after initialization do not update native state.\n *\n * @default true\n */\n captureTouches?: boolean\n /**\n * Enable masking of all text and text input fields\n *\n * @default true\n */\n maskAllTextInputs?: boolean\n /**\n * Enable masking of all images to a placeholder\n *\n * @default true\n */\n maskAllImages?: boolean\n /**\n * Enable masking of all sandboxed system views\n * These may include UIImagePickerController, PHPickerViewController and CNContactPickerViewController\n * iOS only\n *\n * @default true\n */\n maskAllSandboxedViews?: boolean\n /**\n * Enable capturing of logs as console events\n *\n * @default true\n */\n captureLog?: boolean\n /**\n * Deboucer delay used to reduce the number of snapshots captured and reduce performance impact\n * This is used for capturing the view as a screenshot\n * The lower the number more snapshots will be captured but higher the performance impact\n *\n * @default 1000\n * @deprecated please use throttleDelayMs instead\n */\n iOSdebouncerDelayMs?: number\n /**\n * Deboucer delay used to reduce the number of snapshots captured and reduce performance impact\n * This is used for capturing the view as a screenshot\n * The lower the number more snapshots will be captured but higher the performance impact\n * Ps: it was 500ms (0.5s) by default until version 3.3.7\n *\n * @default 1000\n * @deprecated please use throttleDelayMs instead\n */\n androidDebouncerDelayMs?: number\n /**\n * Throttling delay used to reduce the number of snapshots captured and reduce performance impact\n * This is used for capturing the view as a wireframe or screenshot\n * The lower the number more snapshots will be captured but higher the performance impact\n *\n * This value has precedence over iOSdebouncerDelayMs and androidDebouncerDelayMs\n * If this is not set, we will take the max number between iOSdebouncerDelayMs and androidDebouncerDelayMs for back compatibility\n *\n * @default 1000\n */\n throttleDelayMs?: number\n /**\n * Enable capturing network telemetry\n * iOS only\n *\n * @default true\n */\n captureNetworkTelemetry?: boolean\n /**\n * Verify that masks remain aligned while capturing session replay screenshots.\n * Android only. Requires `@posthog/react-native-plugin`.\n *\n * Enabling this can preserve screenshots during pixel-only redraws, including\n * continuously animated content, but performs additional view hierarchy walks\n * while a screenshot is captured.\n *\n * @default false\n */\n verifyScreenshotMaskAlignment?: boolean\n /**\n * Experimental. Multiplier for the physical width and height of screenshots, clamped to 0.1–1.0.\n * For example, 0.5 captures half the width and height, or one quarter of the pixels.\n * The logical replay viewport is unchanged. Non-finite values use the native default.\n * Android only. Requires `@posthog/react-native-plugin` 2.8.0 or later.\n * Does not enable session replay or change compression quality or color mode.\n *\n * @experimental\n * @default 1.0\n */\n screenshotScale?: number\n /**\n * Experimental. WebP compression quality, clamped to 0–100. Fractional values are truncated.\n * Higher values generally retain more detail and produce larger payloads.\n * Compression is lossy, except at quality 100 on Android 10, which uses lossless WebP.\n * Non-finite values use the native default. Does not change screenshot resolution.\n * Android only. Requires `@posthog/react-native-plugin` 2.8.0 or later.\n *\n * @experimental\n * @default 30\n */\n screenshotCompressionQuality?: number\n /**\n * Experimental. Screenshot bitmap pixel format. ARGB_8888 preserves transparency and color precision.\n * RGB_565 uses half the bitmap memory but reduces color precision and removes alpha,\n * making transparent window regions appear black. Unsupported devices fall back to ARGB_8888.\n * Android only. Requires `@posthog/react-native-plugin` 2.8.0 or later.\n *\n * @experimental\n * @default 'ARGB_8888'\n */\n screenshotColorMode?: 'ARGB_8888' | 'RGB_565'\n /**\n * Schedule screenshot image capture on a background queue.\n * iOS only\n * Experimental support\n *\n * Warning: Enabling this option will trigger Main Thread Checker warnings and may\n * briefly freeze the app the first time a screenshot is captured. Consider disabling\n * Main Thread Checker in your scheme's run diagnostics when enabling this.\n *\n * @default false\n */\n screenshotModeBackgroundCapture?: boolean\n /**\n * Session replay sample rate between 0 and 1\n * Local config has precedence over remote config when both are set.\n * If undefined, sampling is controlled by remote config (when available).\n */\n sampleRate?: number\n}\n\nexport interface PostHogCustomStorage {\n getItem: (key: string) => string | null | Promise<string | null>\n setItem: (key: string, value: string) => void | Promise<void>\n}\n\n/**\n * Mints a signed identity-verification token for a push subscription request.\n *\n * Called by the native SDK with the current `distinctId` and `appId`. Return\n * `null` to send the request without an identity token.\n */\nexport type PostHogPushIdentityProvider = (distinctId: string, appId: string) => Promise<string | null>\n"],"mappings":"","ignoreList":[]}
|
package/dist/utils.d.ts
CHANGED
|
@@ -23,3 +23,5 @@ export declare function isMacOS(): boolean;
|
|
|
23
23
|
/** Checks if the current platform is Windows */
|
|
24
24
|
export declare function isWindows(): boolean;
|
|
25
25
|
export declare const isHermes: () => boolean;
|
|
26
|
+
/** React Native version like "0.79.6" or "0.80.0-rc.2", or undefined where Platform.constants doesn't report it (e.g. web) */
|
|
27
|
+
export declare function getReactNativeVersion(): string | undefined;
|
package/dist/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.GLOBAL_OBJ=void 0;exports.getPlatformOS=getPlatformOS;Object.defineProperty(exports,"getRemoteConfigBool",{enumerable:true,get:function get(){return _core.getRemoteConfigBool;}});Object.defineProperty(exports,"getRemoteConfigNumber",{enumerable:true,get:function get(){return _core.getRemoteConfigNumber;}});exports.isHermes=void 0;exports.isMacOS=isMacOS;Object.defineProperty(exports,"isValidSampleRate",{enumerable:true,get:function get(){return _core.isValidSampleRate;}});exports.isWeb=isWeb;exports.isWindows=isWindows;var _reactNative=require("react-native");var _core=require("@posthog/core");var _global=typeof global!=='undefined'?global:undefined;var _globalThis=typeof globalThis!=='undefined'?globalThis:undefined;var GLOBAL_OBJ=exports.GLOBAL_OBJ=_globalThis!==null&&_globalThis!==void 0?_globalThis:_global;function getPlatformOS(){try{return _reactNative.Platform===null||_reactNative.Platform===void 0?void 0:_reactNative.Platform.OS;}catch(_a){return undefined;}}function isWeb(){return getPlatformOS()==='web';}function isMacOS(){return getPlatformOS()==='macos';}function isWindows(){return getPlatformOS()==='windows';}var isHermes=exports.isHermes=function isHermes(){return!!GLOBAL_OBJ.HermesInternal;};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.GLOBAL_OBJ=void 0;exports.getPlatformOS=getPlatformOS;exports.getReactNativeVersion=getReactNativeVersion;Object.defineProperty(exports,"getRemoteConfigBool",{enumerable:true,get:function get(){return _core.getRemoteConfigBool;}});Object.defineProperty(exports,"getRemoteConfigNumber",{enumerable:true,get:function get(){return _core.getRemoteConfigNumber;}});exports.isHermes=void 0;exports.isMacOS=isMacOS;Object.defineProperty(exports,"isValidSampleRate",{enumerable:true,get:function get(){return _core.isValidSampleRate;}});exports.isWeb=isWeb;exports.isWindows=isWindows;var _reactNative=require("react-native");var _core=require("@posthog/core");var _global=typeof global!=='undefined'?global:undefined;var _globalThis=typeof globalThis!=='undefined'?globalThis:undefined;var GLOBAL_OBJ=exports.GLOBAL_OBJ=_globalThis!==null&&_globalThis!==void 0?_globalThis:_global;function getPlatformOS(){try{return _reactNative.Platform===null||_reactNative.Platform===void 0?void 0:_reactNative.Platform.OS;}catch(_a){return undefined;}}function isWeb(){return getPlatformOS()==='web';}function isMacOS(){return getPlatformOS()==='macos';}function isWindows(){return getPlatformOS()==='windows';}var isHermes=exports.isHermes=function isHermes(){return!!GLOBAL_OBJ.HermesInternal;};function getReactNativeVersion(){var _a;try{var version=(_a=_reactNative.Platform.constants)===null||_a===void 0?void 0:_a.reactNativeVersion;if(!version||typeof version.major!=='number'){return undefined;}var major=version.major,minor=version.minor,patch=version.patch,prerelease=version.prerelease;return"".concat(major,".").concat(minor,".").concat(patch).concat(prerelease!=null?"-".concat(prerelease):'');}catch(_b){return undefined;}}
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_reactNative","require","_core","_global","global","undefined","_globalThis","globalThis","GLOBAL_OBJ","exports","getPlatformOS","Platform","OS","isWeb","isMacOS","isWindows","isHermes","HermesInternal"],"sources":["../src/utils.ts"],"sourcesContent":["import { Platform } from 'react-native'\n\n// Re-export remote config utilities from core\nexport { getRemoteConfigBool, getRemoteConfigNumber, isValidSampleRate } from '@posthog/core'\n\ntype ReactNativeGlobal = {\n HermesInternal?: {\n enablePromiseRejectionTracker?: (args: {\n allRejections: boolean\n onUnhandled?: (id: string, error: any) => void\n onHandled?: (id: string, error: any) => void\n }) => void\n hasPromise?: () => boolean\n }\n ErrorUtils?: {\n getGlobalHandler?: () => (error: Error, isFatal: boolean) => void\n setGlobalHandler?: (handler: (error: Error, isFatal: boolean) => void) => void\n }\n onunhandledrejection?: (event: unknown) => void\n}\n\n// fallback for older environments\nconst _global: typeof global | undefined = typeof global !== 'undefined' ? global : undefined\n\n// works after for ECMAScript 2020 (React Native >= 0.63)\nconst _globalThis: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : undefined\n\nexport const GLOBAL_OBJ = (_globalThis ?? _global) as unknown as ReactNativeGlobal\n\nexport function getPlatformOS(): string | undefined {\n try {\n return Platform?.OS\n } catch {\n return undefined\n }\n}\n\n/** Checks if the current platform is web */\nexport function isWeb(): boolean {\n return getPlatformOS() === 'web'\n}\n\n/** Checks if the current platform is macOS */\nexport function isMacOS(): boolean {\n return getPlatformOS() === 'macos'\n}\n\n/** Checks if the current platform is Windows */\nexport function isWindows(): boolean {\n return getPlatformOS() === 'windows'\n}\n\nexport const isHermes = () => !!GLOBAL_OBJ.HermesInternal\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_reactNative","require","_core","_global","global","undefined","_globalThis","globalThis","GLOBAL_OBJ","exports","getPlatformOS","Platform","OS","isWeb","isMacOS","isWindows","isHermes","HermesInternal","getReactNativeVersion","version","_a","constants","reactNativeVersion","major","minor","patch","prerelease","concat"],"sources":["../src/utils.ts"],"sourcesContent":["import { Platform } from 'react-native'\n\n// Re-export remote config utilities from core\nexport { getRemoteConfigBool, getRemoteConfigNumber, isValidSampleRate } from '@posthog/core'\n\ntype ReactNativeGlobal = {\n HermesInternal?: {\n enablePromiseRejectionTracker?: (args: {\n allRejections: boolean\n onUnhandled?: (id: string, error: any) => void\n onHandled?: (id: string, error: any) => void\n }) => void\n hasPromise?: () => boolean\n }\n ErrorUtils?: {\n getGlobalHandler?: () => (error: Error, isFatal: boolean) => void\n setGlobalHandler?: (handler: (error: Error, isFatal: boolean) => void) => void\n }\n onunhandledrejection?: (event: unknown) => void\n}\n\n// fallback for older environments\nconst _global: typeof global | undefined = typeof global !== 'undefined' ? global : undefined\n\n// works after for ECMAScript 2020 (React Native >= 0.63)\nconst _globalThis: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : undefined\n\nexport const GLOBAL_OBJ = (_globalThis ?? _global) as unknown as ReactNativeGlobal\n\nexport function getPlatformOS(): string | undefined {\n try {\n return Platform?.OS\n } catch {\n return undefined\n }\n}\n\n/** Checks if the current platform is web */\nexport function isWeb(): boolean {\n return getPlatformOS() === 'web'\n}\n\n/** Checks if the current platform is macOS */\nexport function isMacOS(): boolean {\n return getPlatformOS() === 'macos'\n}\n\n/** Checks if the current platform is Windows */\nexport function isWindows(): boolean {\n return getPlatformOS() === 'windows'\n}\n\nexport const isHermes = () => !!GLOBAL_OBJ.HermesInternal\n\ntype ReactNativeVersion = { major: number; minor: number; patch: number; prerelease?: number | string | null }\n\n/** React Native version like \"0.79.6\" or \"0.80.0-rc.2\", or undefined where Platform.constants doesn't report it (e.g. web) */\nexport function getReactNativeVersion(): string | undefined {\n try {\n const version = (Platform as { constants?: { reactNativeVersion?: ReactNativeVersion } }).constants\n ?.reactNativeVersion\n if (!version || typeof version.major !== 'number') {\n return undefined\n }\n const { major, minor, patch, prerelease } = version\n return `${major}.${minor}.${patch}${prerelease != null ? `-${prerelease}` : ''}`\n } catch {\n return undefined\n }\n}\n"],"mappings":"+oBAAA,IAAAA,YAAA,CAAAC,OAAA,iBAGA,IAAAC,KAAA,CAAAD,OAAA,kBAmBA,GAAM,CAAAE,OAAO,CAA8B,MAAO,CAAAC,MAAM,GAAK,WAAW,CAAGA,MAAM,CAAGC,SAAS,CAG7F,GAAM,CAAAC,WAAW,CAAkC,MAAO,CAAAC,UAAU,GAAK,WAAW,CAAGA,UAAU,CAAGF,SAAS,CAEtG,GAAM,CAAAG,UAAU,CAAAC,OAAA,CAAAD,UAAA,CAAIF,WAAW,SAAXA,WAAW,UAAXA,WAAW,CAAIH,OAAwC,CAE5E,QAAU,CAAAO,aAAaA,CAAA,EAC3B,GAAI,CACF,MAAO,CAAAC,qBAAQ,SAARA,qBAAQ,iBAARA,qBAAQ,CAAEC,EAAE,CACrB,C,SAAQ,CACN,MAAO,CAAAP,SAAS,CAClB,CACF,CAGM,QAAU,CAAAQ,KAAKA,CAAA,EACnB,MAAO,CAAAH,aAAa,EAAE,GAAK,KAAK,CAClC,CAGM,QAAU,CAAAI,OAAOA,CAAA,EACrB,MAAO,CAAAJ,aAAa,EAAE,GAAK,OAAO,CACpC,CAGM,QAAU,CAAAK,SAASA,CAAA,EACvB,MAAO,CAAAL,aAAa,EAAE,GAAK,SAAS,CACtC,CAEO,GAAM,CAAAM,QAAQ,CAAAP,OAAA,CAAAO,QAAA,CAAG,QAAX,CAAAA,QAAQA,CAAA,QAAS,CAAC,CAACR,UAAU,CAACS,cAAc,GAKnD,QAAU,CAAAC,qBAAqBA,CAAA,E,OACnC,GAAI,CACF,GAAM,CAAAC,OAAO,CAAG,CAAAC,EAAA,CAACT,qBAAwE,CAACU,SAAS,UAAAD,EAAA,iBAAAA,EAAA,CAC/FE,kBAAkB,CACtB,GAAI,CAACH,OAAO,EAAI,MAAO,CAAAA,OAAO,CAACI,KAAK,GAAK,QAAQ,CAAE,CACjD,MAAO,CAAAlB,SAAS,CAClB,CACA,GAAQ,CAAAkB,KAAK,CAA+BJ,OAAO,CAA3CI,KAAK,CAAEC,KAAK,CAAwBL,OAAO,CAApCK,KAAK,CAAEC,KAAK,CAAiBN,OAAO,CAA7BM,KAAK,CAAEC,UAAU,CAAKP,OAAO,CAAtBO,UAAU,CACvC,SAAAC,MAAA,CAAUJ,KAAK,MAAAI,MAAA,CAAIH,KAAK,MAAAG,MAAA,CAAIF,KAAK,EAAAE,MAAA,CAAGD,UAAU,EAAI,IAAI,KAAAC,MAAA,CAAOD,UAAU,EAAK,EAAE,EAChF,C,SAAQ,CACN,MAAO,CAAArB,SAAS,CAClB,CACF","ignoreList":[]}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.
|
|
1
|
+
export declare const version = "4.79.0";
|
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.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.79.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.
|
|
1
|
+
{"version":3,"file":"version.js","names":["version","exports"],"sources":["../src/version.ts"],"sourcesContent":["export const version = \"4.79.0\"\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.
|
|
3
|
+
"version": "4.79.0",
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/PostHog/posthog-js/issues"
|
|
6
6
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"directory": "packages/react-native"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@posthog/core": "^1.
|
|
37
|
+
"@posthog/core": "^1.56.1",
|
|
38
38
|
"@posthog/types": "^1.413.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -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
|
|
78
|
-
"@posthog/
|
|
77
|
+
"@posthog/react-native-plugin": "2.12.5",
|
|
78
|
+
"@posthog-tooling/tsconfig-base": "1.1.1"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@react-native-async-storage/async-storage": ">=1.0.0",
|