posthog-react-native 3.16.1 → 4.1.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/lib/posthog-core/src/featureFlagUtils.d.ts +8 -8
- package/lib/posthog-core/src/featureFlagUtils.js +1 -1
- package/lib/posthog-core/src/featureFlagUtils.js.map +1 -1
- package/lib/posthog-core/src/gzip.d.ts +9 -0
- package/lib/posthog-core/src/gzip.js +1 -0
- package/lib/posthog-core/src/gzip.js.map +1 -0
- package/lib/posthog-core/src/index.d.ts +24 -32
- package/lib/posthog-core/src/index.js +1 -1
- package/lib/posthog-core/src/index.js.map +1 -1
- package/lib/posthog-core/src/types.d.ts +25 -16
- package/lib/posthog-core/src/types.js +1 -1
- package/lib/posthog-core/src/types.js.map +1 -1
- package/lib/posthog-core/src/utils.d.ts +0 -3
- package/lib/posthog-core/src/utils.js +1 -1
- package/lib/posthog-core/src/utils.js.map +1 -1
- package/lib/posthog-react-native/src/PostHogProvider.js +1 -1
- package/lib/posthog-react-native/src/PostHogProvider.js.map +1 -1
- package/lib/posthog-react-native/src/hooks/useFeatureFlags.d.ts +2 -2
- package/lib/posthog-react-native/src/posthog-rn.d.ts +2 -4
- package/lib/posthog-react-native/src/posthog-rn.js +1 -1
- package/lib/posthog-react-native/src/posthog-rn.js.map +1 -1
- package/lib/posthog-react-native/src/types.d.ts +0 -16
- package/lib/posthog-react-native/src/version.d.ts +1 -1
- package/lib/posthog-react-native/src/version.js +1 -1
- package/lib/posthog-react-native/src/version.js.map +1 -1
- package/lib/posthog-react-native/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/lib/posthog-core/src/lz-string.d.ts +0 -8
- package/lib/posthog-core/src/lz-string.js +0 -1
- package/lib/posthog-core/src/lz-string.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHog=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _get2=_interopRequireDefault(require("@babel/runtime/helpers/get"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _reactNative=require("react-native");var _src=require("../../posthog-core/src");var _legacy=require("./legacy");var _storage=require("./storage");var _version=require("./version");var _nativeDeps=require("./native-deps");var _wixNavigation=require("./frameworks/wix-navigation");var _OptionalSessionReplay=require("./optional/OptionalSessionReplay");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _callSuper(t,o,e){return o=(0,_getPrototypeOf2["default"])(o),(0,_possibleConstructorReturn2["default"])(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2["default"])(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,e,o,r){var p=(0,_get2["default"])((0,_getPrototypeOf2["default"])(1&r?t.prototype:t),e,o);return 2&r&&"function"==typeof p?function(t){return p.apply(o,t);}:p;}var PostHog=exports.PostHog=function(_PostHogCore){function PostHog(apiKey,options){var _this;(0,_classCallCheck2["default"])(this,PostHog);var _a,_b,_c,_d;_this=_callSuper(this,PostHog,[apiKey,options]);_this._appProperties={};_this._isInitialized=false;_this._persistence=(_a=options===null||options===void 0?void 0:options.persistence)!==null&&_a!==void 0?_a:'file';_this._disableSurveys=(_b=options===null||options===void 0?void 0:options.disableSurveys)!==null&&_b!==void 0?_b:false;_this._disableRemoteConfig=(_c=options===null||options===void 0?void 0:options.disableRemoteConfig)!==null&&_c!==void 0?_c:false;_this._appProperties=typeof(options===null||options===void 0?void 0:options.customAppProperties)==='function'?options.customAppProperties((0,_nativeDeps.getAppProperties)()):(options===null||options===void 0?void 0:options.customAppProperties)||(0,_nativeDeps.getAppProperties)();_reactNative.AppState.addEventListener('change',function(state){if(state==='unknown'){return;}void _this.flush()["catch"](function(){var _ref=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(err){return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return(0,_src.logFlushError)(err);case 2:case"end":return _context.stop();}},_callee);}));return function(_x3){return _ref.apply(this,arguments);};}());if(state==='active'){_this.getSessionId();}});var storagePromise;if(_this._persistence==='file'){_this._storage=new _storage.PostHogRNStorage((_d=options===null||options===void 0?void 0:options.customStorage)!==null&&_d!==void 0?_d:(0,_nativeDeps.buildOptimisiticAsyncStorage)());storagePromise=_this._storage.preloadPromise;}else{_this._storage=new _storage.PostHogRNSyncMemoryStorage();}if(storagePromise){storagePromise.then(function(){if(!_this._storage.getItem(_src.PostHogPersistedProperty.AnonymousId)){void(0,_legacy.getLegacyValues)().then(function(legacyValues){var _a,_b;if(legacyValues===null||legacyValues===void 0?void 0:legacyValues.distinctId){(_a=_this._storage)===null||_a===void 0?void 0:_a.setItem(_src.PostHogPersistedProperty.DistinctId,legacyValues.distinctId);(_b=_this._storage)===null||_b===void 0?void 0:_b.setItem(_src.PostHogPersistedProperty.AnonymousId,legacyValues.anonymousId);}});}});}var initAfterStorage=function initAfterStorage(){var enablePersistSessionIdAcrossRestart=options===null||options===void 0?void 0:options.enablePersistSessionIdAcrossRestart;if(!enablePersistSessionIdAcrossRestart){_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionId,null);_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionLastTimestamp,null);_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionStartTimestamp,null);}_this.setupBootstrap(options);_this._isInitialized=true;if(_this._disableRemoteConfig===false){_this.reloadRemoteConfigAsync();}else{_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Remote config is disabled.");});if((options===null||options===void 0?void 0:options.preloadFeatureFlags)!==false){_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Feature flags will be preloaded from Decide API.");});_this.reloadFeatureFlags();}else{_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"preloadFeatureFlags is disabled.");});}}if(options===null||options===void 0?void 0:options.captureNativeAppLifecycleEvents){void _this.captureNativeAppLifecycleEvents();}void _this.persistAppVersion();void _this.startSessionReplay(options);};if(storagePromise){_this._initPromise=storagePromise.then(initAfterStorage);}else{_this._initPromise=Promise.resolve();initAfterStorage();}return _this;}(0,_inherits2["default"])(PostHog,_PostHogCore);return(0,_createClass2["default"])(PostHog,[{key:"ready",value:function(){var _ready=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(){return _regenerator["default"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this._initPromise;case 2:case"end":return _context2.stop();}},_callee2,this);}));function ready(){return _ready.apply(this,arguments);}return ready;}()},{key:"getPersistedProperty",value:function getPersistedProperty(key){return this._storage.getItem(key);}},{key:"setPersistedProperty",value:function setPersistedProperty(key,value){return value!==null?this._storage.setItem(key,value):this._storage.removeItem(key);}},{key:"fetch",value:function(_fetch){function fetch(_x,_x2){return _fetch.apply(this,arguments);}fetch.toString=function(){return _fetch.toString();};return fetch;}(function(url,options){return fetch(url,options);})},{key:"getLibraryId",value:function getLibraryId(){return'posthog-react-native';}},{key:"getLibraryVersion",value:function getLibraryVersion(){return _version.version;}},{key:"getCustomUserAgent",value:function getCustomUserAgent(){if(_reactNative.Platform.OS==='web'){return'';}return"".concat(this.getLibraryId(),"/").concat(this.getLibraryVersion());}},{key:"getCommonEventProperties",value:function getCommonEventProperties(){return _objectSpread(_objectSpread(_objectSpread({},_superPropGet(PostHog,"getCommonEventProperties",this,3)([])),this._appProperties),{},{$screen_height:_reactNative.Dimensions.get('screen').height,$screen_width:_reactNative.Dimensions.get('screen').width});}},{key:"screen",value:function(){var _screen=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(name,properties,options){return _regenerator["default"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return this._initPromise;case 2:this.registerForSession({$screen_name:name});return _context3.abrupt("return",this.capture('$screen',_objectSpread(_objectSpread({},properties),{},{$screen_name:name}),options));case 4:case"end":return _context3.stop();}},_callee3,this);}));function screen(_x4,_x5,_x6){return _screen.apply(this,arguments);}return screen;}()},{key:"_isEnableSessionReplay",value:function _isEnableSessionReplay(){var _a;return!this.isDisabled&&((_a=this._enableSessionReplay)!==null&&_a!==void 0?_a:false);}},{key:"_resetSessionId",value:function _resetSessionId(reactNativeSessionReplay,sessionId){if(reactNativeSessionReplay){reactNativeSessionReplay.endSession();reactNativeSessionReplay.startSession(sessionId);}}},{key:"getSessionId",value:function getSessionId(){var _this2=this;var sessionId=_superPropGet(PostHog,"getSessionId",this,3)([]);if(!this._isEnableSessionReplay()){return sessionId;}if(sessionId.length>0&&this._currentSessionId&&sessionId!==this._currentSessionId){if(_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.info('PostHog Debug',"sessionId rotated from ".concat(_this2._currentSessionId," to ").concat(sessionId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Failed to rotate sessionId: ".concat(e,"."));});}}this._currentSessionId=sessionId;}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"sessionId not rotated, sessionId ".concat(sessionId," and currentSessionId ").concat(_this2._currentSessionId,"."));});}return sessionId;}},{key:"resetSessionId",value:function resetSessionId(){_superPropGet(PostHog,"resetSessionId",this,3)([]);if(this._isEnableSessionReplay()&&_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{_OptionalSessionReplay.OptionalReactNativeSessionReplay.endSession();this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay ended.");});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to end: ".concat(e,"."));});}}}},{key:"identify",value:function identify(distinctId,properties,options){var previousDistinctId=this.getDistinctId();_superPropGet(PostHog,"identify",this,3)([distinctId,properties,options]);if(this._isEnableSessionReplay()&&_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{distinctId=distinctId||previousDistinctId;_OptionalSessionReplay.OptionalReactNativeSessionReplay.identify(distinctId,this.getAnonymousId());this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay identified with distinctId ".concat(distinctId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to identify: ".concat(e,"."));});}}}},{key:"initReactNativeNavigation",value:function initReactNativeNavigation(options){return(0,_wixNavigation.withReactNativeNavigation)(this,options);}},{key:"getSurveys",value:function(){var _getSurveys=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(){var surveys,surveysFromApi;return _regenerator["default"].wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(this._disableSurveys===true)){_context4.next=4;break;}this.logMsgIfDebug(function(){return console.log('PostHog Debug','Loading surveys is disabled.');});this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,null);return _context4.abrupt("return",[]);case 4:surveys=this.getPersistedProperty(_src.PostHogPersistedProperty.Surveys);if(!(surveys&&surveys.length>0)){_context4.next=10;break;}this.logMsgIfDebug(function(){return console.log('PostHog Debug','Surveys fetched from storage: ',JSON.stringify(surveys));});return _context4.abrupt("return",surveys);case 10:this.logMsgIfDebug(function(){return console.log('PostHog Debug','No surveys found in storage');});case 11:if(!(this._disableRemoteConfig===true)){_context4.next=18;break;}_context4.next=14;return _superPropGet(PostHog,"getSurveysStateless",this,3)([]);case 14:surveysFromApi=_context4.sent;if(!(surveysFromApi&&surveysFromApi.length>0)){_context4.next=18;break;}this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,surveysFromApi);return _context4.abrupt("return",surveysFromApi);case 18:return _context4.abrupt("return",[]);case 19:case"end":return _context4.stop();}},_callee4,this);}));function getSurveys(){return _getSurveys.apply(this,arguments);}return getSurveys;}()},{key:"startSessionReplay",value:function(){var _startSessionReplay=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5(options){var _a,_b,_c,_d,_e,_ref2,_ref2$maskAllTextInpu,maskAllTextInputs,_ref2$maskAllImages,maskAllImages,_ref2$maskAllSandboxe,maskAllSandboxedViews,_ref2$maskPhotoLibrar,maskPhotoLibraryImages,_ref2$captureLog,captureLog,_ref2$captureNetworkT,captureNetworkTelemetry,_ref2$iOSdebouncerDel,iOSdebouncerDelayMs,_ref2$androidDebounce,androidDebouncerDelayMs,sdkReplayConfig,sessionReplay,featureFlags,cachedFeatureFlags,cachedSessionReplayConfig,recordingActive,linkedFlag,value,flag,variant,_value,sessionId,sdkOptions;return _regenerator["default"].wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:this._enableSessionReplay=options===null||options===void 0?void 0:options.enableSessionReplay;if(this._isEnableSessionReplay()){_context5.next=4;break;}this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay is not enabled.');});return _context5.abrupt("return");case 4:_ref2=(_a=options===null||options===void 0?void 0:options.sessionReplayConfig)!==null&&_a!==void 0?_a:{},_ref2$maskAllTextInpu=_ref2.maskAllTextInputs,maskAllTextInputs=_ref2$maskAllTextInpu===void 0?true:_ref2$maskAllTextInpu,_ref2$maskAllImages=_ref2.maskAllImages,maskAllImages=_ref2$maskAllImages===void 0?true:_ref2$maskAllImages,_ref2$maskAllSandboxe=_ref2.maskAllSandboxedViews,maskAllSandboxedViews=_ref2$maskAllSandboxe===void 0?true:_ref2$maskAllSandboxe,_ref2$maskPhotoLibrar=_ref2.maskPhotoLibraryImages,maskPhotoLibraryImages=_ref2$maskPhotoLibrar===void 0?false:_ref2$maskPhotoLibrar,_ref2$captureLog=_ref2.captureLog,captureLog=_ref2$captureLog===void 0?true:_ref2$captureLog,_ref2$captureNetworkT=_ref2.captureNetworkTelemetry,captureNetworkTelemetry=_ref2$captureNetworkT===void 0?true:_ref2$captureNetworkT,_ref2$iOSdebouncerDel=_ref2.iOSdebouncerDelayMs,iOSdebouncerDelayMs=_ref2$iOSdebouncerDel===void 0?1000:_ref2$iOSdebouncerDel,_ref2$androidDebounce=_ref2.androidDebouncerDelayMs,androidDebouncerDelayMs=_ref2$androidDebounce===void 0?1000:_ref2$androidDebounce;sdkReplayConfig={maskAllTextInputs:maskAllTextInputs,maskAllImages:maskAllImages,maskAllSandboxedViews:maskAllSandboxedViews,maskPhotoLibraryImages:maskPhotoLibraryImages,captureLog:captureLog,captureNetworkTelemetry:captureNetworkTelemetry,iOSdebouncerDelayMs:iOSdebouncerDelayMs,androidDebouncerDelayMs:androidDebouncerDelayMs};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay SDK config: ".concat(JSON.stringify(sdkReplayConfig)));});sessionReplay=(_b=this.getPersistedProperty(_src.PostHogPersistedProperty.SessionReplay))!==null&&_b!==void 0?_b:{};featureFlags=(_c=this.getKnownFeatureFlags())!==null&&_c!==void 0?_c:{};cachedFeatureFlags=(_d=featureFlags)!==null&&_d!==void 0?_d:{};cachedSessionReplayConfig=(_e=sessionReplay)!==null&&_e!==void 0?_e:{};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay feature flags from decide/flags cached config: ".concat(JSON.stringify(cachedFeatureFlags)));});this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay session recording from decide/flags cached config: ".concat(JSON.stringify(cachedSessionReplayConfig)));});recordingActive=true;linkedFlag=cachedSessionReplayConfig['linkedFlag'];if(typeof linkedFlag==='string'){value=cachedFeatureFlags[linkedFlag];if(typeof value==='boolean'){recordingActive=value;}else if(typeof value==='string'){recordingActive=true;}else{recordingActive=false;}this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay '".concat(linkedFlag,"' linked flag value: '").concat(value,"'"));});}else if(linkedFlag&&(0,_typeof2["default"])(linkedFlag)==='object'){flag=linkedFlag['flag'];variant=linkedFlag['variant'];if(flag&&variant){_value=cachedFeatureFlags[flag];recordingActive=_value===variant;this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay '".concat(flag,"' linked flag variant '").concat(variant,"' and value '").concat(_value,"'"));});}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay '".concat(flag,"' linked flag variant: '").concat(variant,"' does not exist/quota limited."));});recordingActive=false;}}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay has no cached linkedFlag.");});}if(!recordingActive){_context5.next=46;break;}if(!_OptionalSessionReplay.OptionalReactNativeSessionReplay){_context5.next=43;break;}sessionId=this.getSessionId();if(!(sessionId.length===0)){_context5.next=22;break;}this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but no sessionId found.');});return _context5.abrupt("return");case 22:sdkOptions={apiKey:this.apiKey,host:this.host,debug:this.isDebug,distinctId:this.getDistinctId(),anonymousId:this.getAnonymousId(),sdkVersion:this.getLibraryVersion(),flushAt:this.flushAt};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay sdk options: ".concat(JSON.stringify(sdkOptions)));});_context5.prev=24;_context5.next=27;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.isEnabled();case 27:if(_context5.sent){_context5.next=33;break;}_context5.next=30;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.start(sessionId,sdkOptions,sdkReplayConfig,cachedSessionReplayConfig);case 30:this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});_context5.next=35;break;case 33:this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay already started with sessionId ".concat(sessionId,"."));});case 35:this._currentSessionId=sessionId;_context5.next=41;break;case 38:_context5.prev=38;_context5.t0=_context5["catch"](24);this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start: ".concat(_context5.t0,"."));});case 41:_context5.next=44;break;case 43:this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but not installed.');});case 44:_context5.next=47;break;case 46:this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay disabled.');});case 47:case"end":return _context5.stop();}},_callee5,this,[[24,38]]);}));function startSessionReplay(_x7){return _startSessionReplay.apply(this,arguments);}return startSessionReplay;}()},{key:"captureNativeAppLifecycleEvents",value:function(){var _captureNativeAppLifecycleEvents=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee6(){var _this3=this;var _a,appBuild,appVersion,isMemoryPersistence,properties,prevAppBuild,prevAppVersion,initialUrl;return _regenerator["default"].wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;isMemoryPersistence=this._persistence==='memory';properties=_objectSpread(_objectSpread({},(0,_src.maybeAdd)('version',appVersion)),(0,_src.maybeAdd)('build',appBuild));if(!isMemoryPersistence){prevAppBuild=this.getPersistedProperty(_src.PostHogPersistedProperty.InstalledAppBuild);prevAppVersion=this.getPersistedProperty(_src.PostHogPersistedProperty.InstalledAppVersion);if(!appBuild||!appVersion){this.logMsgIfDebug(function(){return console.warn('PostHog could not track installation/update/open, as the build and version were not set. '+'This can happen if some dependencies are not installed correctly, or if you have provided'+'customAppProperties but not included $app_build or $app_version.');});}if(appBuild){if(!prevAppBuild){this.capture('Application Installed',properties);}else if(prevAppBuild!==appBuild){this.capture('Application Updated',_objectSpread(_objectSpread(_objectSpread({},(0,_src.maybeAdd)('previous_version',prevAppVersion)),(0,_src.maybeAdd)('previous_build',prevAppBuild)),properties));}}}else{this.logMsgIfDebug(function(){return console.warn('PostHog was initialised with persistence set to "memory", capturing native app events (Application Installed and Application Updated) is not supported.');});}_context6.next=7;return _reactNative.Linking.getInitialURL();case 7:_context6.t1=_a=_context6.sent;_context6.t0=_context6.t1!==null;if(!_context6.t0){_context6.next=11;break;}_context6.t0=_a!==void 0;case 11:if(!_context6.t0){_context6.next=15;break;}_context6.t2=_a;_context6.next=16;break;case 15:_context6.t2=undefined;case 16:initialUrl=_context6.t2;this.capture('Application Opened',_objectSpread(_objectSpread({},properties),(0,_src.maybeAdd)('url',initialUrl)));_reactNative.AppState.addEventListener('change',function(state){if(state==='active'){_this3.capture('Application Became Active');}else if(state==='background'){_this3.capture('Application Backgrounded');}});case 19:case"end":return _context6.stop();}},_callee6,this);}));function captureNativeAppLifecycleEvents(){return _captureNativeAppLifecycleEvents.apply(this,arguments);}return captureNativeAppLifecycleEvents;}()},{key:"persistAppVersion",value:function(){var _persistAppVersion=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee7(){var appBuild,appVersion;return _regenerator["default"].wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppBuild,appBuild);this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppVersion,appVersion);case 4:case"end":return _context7.stop();}},_callee7,this);}));function persistAppVersion(){return _persistAppVersion.apply(this,arguments);}return persistAppVersion;}()}]);}(_src.PostHogCore);
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHog=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _get2=_interopRequireDefault(require("@babel/runtime/helpers/get"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _reactNative=require("react-native");var _src=require("../../posthog-core/src");var _legacy=require("./legacy");var _storage=require("./storage");var _version=require("./version");var _nativeDeps=require("./native-deps");var _wixNavigation=require("./frameworks/wix-navigation");var _OptionalSessionReplay=require("./optional/OptionalSessionReplay");function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _callSuper(t,o,e){return o=(0,_getPrototypeOf2["default"])(o),(0,_possibleConstructorReturn2["default"])(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2["default"])(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,e,o,r){var p=(0,_get2["default"])((0,_getPrototypeOf2["default"])(1&r?t.prototype:t),e,o);return 2&r&&"function"==typeof p?function(t){return p.apply(o,t);}:p;}var PostHog=exports.PostHog=function(_PostHogCore){function PostHog(apiKey,options){var _this;(0,_classCallCheck2["default"])(this,PostHog);var _a,_b,_c,_d;_this=_callSuper(this,PostHog,[apiKey,options]);_this._appProperties={};_this._isInitialized=false;_this._persistence=(_a=options===null||options===void 0?void 0:options.persistence)!==null&&_a!==void 0?_a:'file';_this._disableSurveys=(_b=options===null||options===void 0?void 0:options.disableSurveys)!==null&&_b!==void 0?_b:false;_this._disableRemoteConfig=(_c=options===null||options===void 0?void 0:options.disableRemoteConfig)!==null&&_c!==void 0?_c:false;_this._appProperties=typeof(options===null||options===void 0?void 0:options.customAppProperties)==='function'?options.customAppProperties((0,_nativeDeps.getAppProperties)()):(options===null||options===void 0?void 0:options.customAppProperties)||(0,_nativeDeps.getAppProperties)();_reactNative.AppState.addEventListener('change',function(state){if(state==='unknown'){return;}void _this.flush()["catch"](function(){var _ref=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(err){return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return(0,_src.logFlushError)(err);case 2:case"end":return _context.stop();}},_callee);}));return function(_x3){return _ref.apply(this,arguments);};}());if(state==='active'){_this.getSessionId();}});var storagePromise;if(_this._persistence==='file'){_this._storage=new _storage.PostHogRNStorage((_d=options===null||options===void 0?void 0:options.customStorage)!==null&&_d!==void 0?_d:(0,_nativeDeps.buildOptimisiticAsyncStorage)());storagePromise=_this._storage.preloadPromise;}else{_this._storage=new _storage.PostHogRNSyncMemoryStorage();}if(storagePromise){storagePromise.then(function(){if(!_this._storage.getItem(_src.PostHogPersistedProperty.AnonymousId)){void(0,_legacy.getLegacyValues)().then(function(legacyValues){var _a,_b;if(legacyValues===null||legacyValues===void 0?void 0:legacyValues.distinctId){(_a=_this._storage)===null||_a===void 0?void 0:_a.setItem(_src.PostHogPersistedProperty.DistinctId,legacyValues.distinctId);(_b=_this._storage)===null||_b===void 0?void 0:_b.setItem(_src.PostHogPersistedProperty.AnonymousId,legacyValues.anonymousId);}});}});}var initAfterStorage=function initAfterStorage(){var enablePersistSessionIdAcrossRestart=options===null||options===void 0?void 0:options.enablePersistSessionIdAcrossRestart;if(!enablePersistSessionIdAcrossRestart){_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionId,null);_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionLastTimestamp,null);_this.setPersistedProperty(_src.PostHogPersistedProperty.SessionStartTimestamp,null);}_this.setupBootstrap(options);_this._isInitialized=true;if(_this._disableRemoteConfig===false){_this.reloadRemoteConfigAsync();}else{_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Remote config is disabled.");});if((options===null||options===void 0?void 0:options.preloadFeatureFlags)!==false){_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Feature flags will be preloaded from Flags API.");});_this.reloadFeatureFlags();}else{_this.logMsgIfDebug(function(){return console.info('PostHog Debug',"preloadFeatureFlags is disabled.");});}}if(options===null||options===void 0?void 0:options.captureAppLifecycleEvents){void _this.captureAppLifecycleEvents();}void _this.persistAppVersion();void _this.startSessionReplay(options);};if(storagePromise){_this._initPromise=storagePromise.then(initAfterStorage);}else{_this._initPromise=Promise.resolve();initAfterStorage();}return _this;}(0,_inherits2["default"])(PostHog,_PostHogCore);return(0,_createClass2["default"])(PostHog,[{key:"ready",value:function(){var _ready=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(){return _regenerator["default"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this._initPromise;case 2:case"end":return _context2.stop();}},_callee2,this);}));function ready(){return _ready.apply(this,arguments);}return ready;}()},{key:"getPersistedProperty",value:function getPersistedProperty(key){return this._storage.getItem(key);}},{key:"setPersistedProperty",value:function setPersistedProperty(key,value){return value!==null?this._storage.setItem(key,value):this._storage.removeItem(key);}},{key:"fetch",value:function(_fetch){function fetch(_x,_x2){return _fetch.apply(this,arguments);}fetch.toString=function(){return _fetch.toString();};return fetch;}(function(url,options){return fetch(url,options);})},{key:"getLibraryId",value:function getLibraryId(){return'posthog-react-native';}},{key:"getLibraryVersion",value:function getLibraryVersion(){return _version.version;}},{key:"getCustomUserAgent",value:function getCustomUserAgent(){if(_reactNative.Platform.OS==='web'){return'';}return"".concat(this.getLibraryId(),"/").concat(this.getLibraryVersion());}},{key:"getCommonEventProperties",value:function getCommonEventProperties(){return _objectSpread(_objectSpread(_objectSpread({},_superPropGet(PostHog,"getCommonEventProperties",this,3)([])),this._appProperties),{},{$screen_height:_reactNative.Dimensions.get('screen').height,$screen_width:_reactNative.Dimensions.get('screen').width});}},{key:"screen",value:function(){var _screen=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(name,properties,options){return _regenerator["default"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return this._initPromise;case 2:this.registerForSession({$screen_name:name});return _context3.abrupt("return",this.capture('$screen',_objectSpread(_objectSpread({},properties),{},{$screen_name:name}),options));case 4:case"end":return _context3.stop();}},_callee3,this);}));function screen(_x4,_x5,_x6){return _screen.apply(this,arguments);}return screen;}()},{key:"_isEnableSessionReplay",value:function _isEnableSessionReplay(){var _a;return!this.isDisabled&&((_a=this._enableSessionReplay)!==null&&_a!==void 0?_a:false);}},{key:"_resetSessionId",value:function _resetSessionId(reactNativeSessionReplay,sessionId){if(reactNativeSessionReplay){reactNativeSessionReplay.endSession();reactNativeSessionReplay.startSession(sessionId);}}},{key:"getSessionId",value:function getSessionId(){var _this2=this;var sessionId=_superPropGet(PostHog,"getSessionId",this,3)([]);if(!this._isEnableSessionReplay()){return sessionId;}if(sessionId.length>0&&this._currentSessionId&&sessionId!==this._currentSessionId){if(_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.info('PostHog Debug',"sessionId rotated from ".concat(_this2._currentSessionId," to ").concat(sessionId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Failed to rotate sessionId: ".concat(e,"."));});}}this._currentSessionId=sessionId;}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"sessionId not rotated, sessionId ".concat(sessionId," and currentSessionId ").concat(_this2._currentSessionId,"."));});}return sessionId;}},{key:"resetSessionId",value:function resetSessionId(){_superPropGet(PostHog,"resetSessionId",this,3)([]);if(this._isEnableSessionReplay()&&_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{_OptionalSessionReplay.OptionalReactNativeSessionReplay.endSession();this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay ended.");});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to end: ".concat(e,"."));});}}}},{key:"identify",value:function identify(distinctId,properties,options){var previousDistinctId=this.getDistinctId();_superPropGet(PostHog,"identify",this,3)([distinctId,properties,options]);if(this._isEnableSessionReplay()&&_OptionalSessionReplay.OptionalReactNativeSessionReplay){try{distinctId=distinctId||previousDistinctId;_OptionalSessionReplay.OptionalReactNativeSessionReplay.identify(distinctId,this.getAnonymousId());this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay identified with distinctId ".concat(distinctId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to identify: ".concat(e,"."));});}}}},{key:"initReactNativeNavigation",value:function initReactNativeNavigation(options){return(0,_wixNavigation.withReactNativeNavigation)(this,options);}},{key:"getSurveys",value:function(){var _getSurveys=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(){var surveys,surveysFromApi;return _regenerator["default"].wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(this._disableSurveys===true)){_context4.next=4;break;}this.logMsgIfDebug(function(){return console.log('PostHog Debug','Loading surveys is disabled.');});this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,null);return _context4.abrupt("return",[]);case 4:surveys=this.getPersistedProperty(_src.PostHogPersistedProperty.Surveys);if(!(surveys&&surveys.length>0)){_context4.next=10;break;}this.logMsgIfDebug(function(){return console.log('PostHog Debug','Surveys fetched from storage: ',JSON.stringify(surveys));});return _context4.abrupt("return",surveys);case 10:this.logMsgIfDebug(function(){return console.log('PostHog Debug','No surveys found in storage');});case 11:if(!(this._disableRemoteConfig===true)){_context4.next=18;break;}_context4.next=14;return _superPropGet(PostHog,"getSurveysStateless",this,3)([]);case 14:surveysFromApi=_context4.sent;if(!(surveysFromApi&&surveysFromApi.length>0)){_context4.next=18;break;}this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,surveysFromApi);return _context4.abrupt("return",surveysFromApi);case 18:return _context4.abrupt("return",[]);case 19:case"end":return _context4.stop();}},_callee4,this);}));function getSurveys(){return _getSurveys.apply(this,arguments);}return getSurveys;}()},{key:"startSessionReplay",value:function(){var _startSessionReplay=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5(options){var _a,_b,_c,_d,_e,_ref2,_ref2$maskAllTextInpu,maskAllTextInputs,_ref2$maskAllImages,maskAllImages,_ref2$maskAllSandboxe,maskAllSandboxedViews,_ref2$captureLog,captureLog,_ref2$captureNetworkT,captureNetworkTelemetry,_ref2$iOSdebouncerDel,iOSdebouncerDelayMs,_ref2$androidDebounce,androidDebouncerDelayMs,sdkReplayConfig,sessionReplay,featureFlags,cachedFeatureFlags,cachedSessionReplayConfig,recordingActive,linkedFlag,value,flag,variant,_value,sessionId,sdkOptions;return _regenerator["default"].wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:this._enableSessionReplay=options===null||options===void 0?void 0:options.enableSessionReplay;if(this._isEnableSessionReplay()){_context5.next=4;break;}this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay is not enabled.');});return _context5.abrupt("return");case 4:_ref2=(_a=options===null||options===void 0?void 0:options.sessionReplayConfig)!==null&&_a!==void 0?_a:{},_ref2$maskAllTextInpu=_ref2.maskAllTextInputs,maskAllTextInputs=_ref2$maskAllTextInpu===void 0?true:_ref2$maskAllTextInpu,_ref2$maskAllImages=_ref2.maskAllImages,maskAllImages=_ref2$maskAllImages===void 0?true:_ref2$maskAllImages,_ref2$maskAllSandboxe=_ref2.maskAllSandboxedViews,maskAllSandboxedViews=_ref2$maskAllSandboxe===void 0?true:_ref2$maskAllSandboxe,_ref2$captureLog=_ref2.captureLog,captureLog=_ref2$captureLog===void 0?true:_ref2$captureLog,_ref2$captureNetworkT=_ref2.captureNetworkTelemetry,captureNetworkTelemetry=_ref2$captureNetworkT===void 0?true:_ref2$captureNetworkT,_ref2$iOSdebouncerDel=_ref2.iOSdebouncerDelayMs,iOSdebouncerDelayMs=_ref2$iOSdebouncerDel===void 0?1000:_ref2$iOSdebouncerDel,_ref2$androidDebounce=_ref2.androidDebouncerDelayMs,androidDebouncerDelayMs=_ref2$androidDebounce===void 0?1000:_ref2$androidDebounce;sdkReplayConfig={maskAllTextInputs:maskAllTextInputs,maskAllImages:maskAllImages,maskAllSandboxedViews:maskAllSandboxedViews,captureLog:captureLog,captureNetworkTelemetry:captureNetworkTelemetry,iOSdebouncerDelayMs:iOSdebouncerDelayMs,androidDebouncerDelayMs:androidDebouncerDelayMs};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay SDK config: ".concat(JSON.stringify(sdkReplayConfig)));});sessionReplay=(_b=this.getPersistedProperty(_src.PostHogPersistedProperty.SessionReplay))!==null&&_b!==void 0?_b:{};featureFlags=(_c=this.getKnownFeatureFlags())!==null&&_c!==void 0?_c:{};cachedFeatureFlags=(_d=featureFlags)!==null&&_d!==void 0?_d:{};cachedSessionReplayConfig=(_e=sessionReplay)!==null&&_e!==void 0?_e:{};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay feature flags from flags cached config: ".concat(JSON.stringify(cachedFeatureFlags)));});this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay session recording from flags cached config: ".concat(JSON.stringify(cachedSessionReplayConfig)));});recordingActive=true;linkedFlag=cachedSessionReplayConfig['linkedFlag'];if(typeof linkedFlag==='string'){value=cachedFeatureFlags[linkedFlag];if(typeof value==='boolean'){recordingActive=value;}else if(typeof value==='string'){recordingActive=true;}else{recordingActive=false;}this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay '".concat(linkedFlag,"' linked flag value: '").concat(value,"'"));});}else if(linkedFlag&&(0,_typeof2["default"])(linkedFlag)==='object'){flag=linkedFlag['flag'];variant=linkedFlag['variant'];if(flag&&variant){_value=cachedFeatureFlags[flag];recordingActive=_value===variant;this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay '".concat(flag,"' linked flag variant '").concat(variant,"' and value '").concat(_value,"'"));});}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay '".concat(flag,"' linked flag variant: '").concat(variant,"' does not exist/quota limited."));});recordingActive=false;}}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay has no cached linkedFlag.");});}if(!recordingActive){_context5.next=46;break;}if(!_OptionalSessionReplay.OptionalReactNativeSessionReplay){_context5.next=43;break;}sessionId=this.getSessionId();if(!(sessionId.length===0)){_context5.next=22;break;}this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but no sessionId found.');});return _context5.abrupt("return");case 22:sdkOptions={apiKey:this.apiKey,host:this.host,debug:this.isDebug,distinctId:this.getDistinctId(),anonymousId:this.getAnonymousId(),sdkVersion:this.getLibraryVersion(),flushAt:this.flushAt};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay sdk options: ".concat(JSON.stringify(sdkOptions)));});_context5.prev=24;_context5.next=27;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.isEnabled();case 27:if(_context5.sent){_context5.next=33;break;}_context5.next=30;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.start(sessionId,sdkOptions,sdkReplayConfig,cachedSessionReplayConfig);case 30:this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});_context5.next=35;break;case 33:this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay already started with sessionId ".concat(sessionId,"."));});case 35:this._currentSessionId=sessionId;_context5.next=41;break;case 38:_context5.prev=38;_context5.t0=_context5["catch"](24);this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start: ".concat(_context5.t0,"."));});case 41:_context5.next=44;break;case 43:this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but not installed.');});case 44:_context5.next=47;break;case 46:this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay disabled.');});case 47:case"end":return _context5.stop();}},_callee5,this,[[24,38]]);}));function startSessionReplay(_x7){return _startSessionReplay.apply(this,arguments);}return startSessionReplay;}()},{key:"captureAppLifecycleEvents",value:function(){var _captureAppLifecycleEvents=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee6(){var _this3=this;var _a,appBuild,appVersion,isMemoryPersistence,properties,prevAppBuild,prevAppVersion,initialUrl;return _regenerator["default"].wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;isMemoryPersistence=this._persistence==='memory';properties={};if(!isMemoryPersistence){prevAppBuild=this.getPersistedProperty(_src.PostHogPersistedProperty.InstalledAppBuild);prevAppVersion=this.getPersistedProperty(_src.PostHogPersistedProperty.InstalledAppVersion);if(!appBuild||!appVersion){this.logMsgIfDebug(function(){return console.warn('PostHog could not track installation/update/open, as the build and version were not set. '+'This can happen if some dependencies are not installed correctly, or if you have provided'+'customAppProperties but not included $app_build or $app_version.');});}if(appBuild){if(!prevAppBuild){this.capture('Application Installed',properties);}else if(prevAppBuild!==appBuild){this.capture('Application Updated',_objectSpread(_objectSpread(_objectSpread({},(0,_src.maybeAdd)('previous_version',prevAppVersion)),(0,_src.maybeAdd)('previous_build',prevAppBuild)),properties));}}}else{this.logMsgIfDebug(function(){return console.warn('PostHog was initialised with persistence set to "memory", capturing native app events (Application Installed and Application Updated) is not supported.');});}_context6.next=7;return _reactNative.Linking.getInitialURL();case 7:_context6.t1=_a=_context6.sent;_context6.t0=_context6.t1!==null;if(!_context6.t0){_context6.next=11;break;}_context6.t0=_a!==void 0;case 11:if(!_context6.t0){_context6.next=15;break;}_context6.t2=_a;_context6.next=16;break;case 15:_context6.t2=undefined;case 16:initialUrl=_context6.t2;this.capture('Application Opened',_objectSpread(_objectSpread({},properties),(0,_src.maybeAdd)('url',initialUrl)));_reactNative.AppState.addEventListener('change',function(state){if(state==='active'){_this3.capture('Application Became Active');}else if(state==='background'){_this3.capture('Application Backgrounded');}});case 19:case"end":return _context6.stop();}},_callee6,this);}));function captureAppLifecycleEvents(){return _captureAppLifecycleEvents.apply(this,arguments);}return captureAppLifecycleEvents;}()},{key:"persistAppVersion",value:function(){var _persistAppVersion=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee7(){var appBuild,appVersion;return _regenerator["default"].wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppBuild,appBuild);this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppVersion,appVersion);case 4:case"end":return _context7.stop();}},_callee7,this);}));function persistAppVersion(){return _persistAppVersion.apply(this,arguments);}return persistAppVersion;}()}]);}(_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TrackerOptions;
|
|
18
18
|
navigationRef?: PostHogNavigationRef;
|
|
19
|
-
/** Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded.
|
|
20
|
-
* By default is true.
|
|
21
|
-
* If you're already using the 'captureNativeAppLifecycleEvents' client option, you don't need to set this.
|
|
22
|
-
* If 'captureNativeAppLifecycleEvents' is set, the 'captureNativeAppLifecycleEvents' value has priority over this option.
|
|
23
|
-
* Application Installed and Application Updated events are not supported with persistence set to 'memory'.
|
|
24
|
-
*/
|
|
25
|
-
captureLifecycleEvents?: boolean;
|
|
26
19
|
};
|
|
27
20
|
export interface PostHogCustomAppProperties {
|
|
28
21
|
/** Build number like "1.2.2" or "122" */
|
|
@@ -69,15 +62,6 @@ export type PostHogSessionReplayConfig = {
|
|
|
69
62
|
* Default: true
|
|
70
63
|
*/
|
|
71
64
|
maskAllSandboxedViews?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Enable masking of images that likely originated from user's photo library
|
|
74
|
-
* Experimental support (UIKit only)
|
|
75
|
-
* iOS only
|
|
76
|
-
* Default: false
|
|
77
|
-
*
|
|
78
|
-
* @deprecated This property has no effect and will be removed in the next major release. To learn how to manually mask user photos please see our Privacy controls documentation: https://posthog.com/docs/session-replay/privacy?tab=React+Native
|
|
79
|
-
*/
|
|
80
|
-
maskPhotoLibraryImages?: boolean;
|
|
81
65
|
/**
|
|
82
66
|
* Enable capturing of logcat as console events
|
|
83
67
|
* Android only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "4.1.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.1.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAA"}
|