posthog-react-native 4.6.0 → 4.6.1
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/PostHogProvider.d.ts +72 -0
- package/dist/PostHogProvider.js.map +1 -1
- package/dist/posthog-rn.d.ts +444 -1
- package/dist/posthog-rn.js +1 -1
- package/dist/posthog-rn.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -5
|
@@ -2,13 +2,85 @@ import React from 'react';
|
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import { PostHog, PostHogOptions } from './posthog-rn';
|
|
4
4
|
import { PostHogAutocaptureOptions } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the PostHogProvider component.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
5
10
|
export interface PostHogProviderProps {
|
|
11
|
+
/** The child components to render within the PostHog context */
|
|
6
12
|
children: React.ReactNode;
|
|
13
|
+
/** PostHog configuration options */
|
|
7
14
|
options?: PostHogOptions;
|
|
15
|
+
/** Your PostHog API key */
|
|
8
16
|
apiKey?: string;
|
|
17
|
+
/** An existing PostHog client instance */
|
|
9
18
|
client?: PostHog;
|
|
19
|
+
/** Autocapture configuration - can be a boolean or detailed options */
|
|
10
20
|
autocapture?: boolean | PostHogAutocaptureOptions;
|
|
21
|
+
/** Enable debug mode for additional logging */
|
|
11
22
|
debug?: boolean;
|
|
23
|
+
/** Custom styles for the provider wrapper View */
|
|
12
24
|
style?: StyleProp<ViewStyle>;
|
|
13
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* PostHogProvider is a React component that provides PostHog functionality to your React Native app. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).
|
|
28
|
+
*
|
|
29
|
+
* Autocapturing navigation requires further configuration. See the [React Native SDK navigation docs](https://posthog.com/docs/libraries/react-native#capturing-screen-views)
|
|
30
|
+
* for more information about autocapturing navigation.
|
|
31
|
+
*
|
|
32
|
+
* This is the recommended way to set up PostHog for React Native. This utilizes the Context API to pass the PostHog client around, enable autocapture.
|
|
33
|
+
*
|
|
34
|
+
* {@label Initialization}
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```jsx
|
|
38
|
+
* // Add to App.(js|ts)
|
|
39
|
+
* import { usePostHog, PostHogProvider } from 'posthog-react-native'
|
|
40
|
+
*
|
|
41
|
+
* export function MyApp() {
|
|
42
|
+
* return (
|
|
43
|
+
* <PostHogProvider apiKey="<ph_project_api_key>" options={{
|
|
44
|
+
* host: '<ph_client_api_host>',
|
|
45
|
+
* }}>
|
|
46
|
+
* <MyComponent />
|
|
47
|
+
* </PostHogProvider>
|
|
48
|
+
* )
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* // And access the PostHog client via the usePostHog hook
|
|
52
|
+
* import { usePostHog } from 'posthog-react-native'
|
|
53
|
+
*
|
|
54
|
+
* const MyComponent = () => {
|
|
55
|
+
* const posthog = usePostHog()
|
|
56
|
+
*
|
|
57
|
+
* useEffect(() => {
|
|
58
|
+
* posthog.capture("event_name")
|
|
59
|
+
* }, [posthog])
|
|
60
|
+
* }
|
|
61
|
+
*
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```jsx
|
|
66
|
+
* // Using with existing client
|
|
67
|
+
* import { PostHog } from 'posthog-react-native'
|
|
68
|
+
*
|
|
69
|
+
* const posthog = new PostHog('<ph_project_api_key>', {
|
|
70
|
+
* host: '<ph_client_api_host>'
|
|
71
|
+
* })
|
|
72
|
+
*
|
|
73
|
+
* export function MyApp() {
|
|
74
|
+
* return (
|
|
75
|
+
* <PostHogProvider client={posthog}>
|
|
76
|
+
* <MyComponent />
|
|
77
|
+
* </PostHogProvider>
|
|
78
|
+
* )
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @public
|
|
83
|
+
*
|
|
84
|
+
* @param props - The PostHogProvider props
|
|
85
|
+
*/
|
|
14
86
|
export declare const PostHogProvider: ({ children, client, options, apiKey, autocapture, style, debug, }: PostHogProviderProps) => JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostHogProvider.js","sourceRoot":"","sources":["../src/PostHogProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAoC,IAAI,EAAa,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,OAAO,EAAkB,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"PostHogProvider.js","sourceRoot":"","sources":["../src/PostHogProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAoC,IAAI,EAAa,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,OAAO,EAAkB,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAwBvD,SAAS,qBAAqB,CAAC,EAC7B,OAAO,EACP,MAAM,GAIP;IACC,oBAAoB,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,EAAE,O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AAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAEzE;MAAA,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAClD;QAAA,CAAC,cAAc,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAG,CAC1F;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,cAAc,CAAC,QAAQ,CAC3B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA"}
|
package/dist/posthog-rn.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PostHogCaptureOptions, PostHogCore, PostHogCoreOptions, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty, SurveyResponse } from '@posthog/core';
|
|
1
|
+
import { JsonType, PostHogCaptureOptions, PostHogCore, PostHogCoreOptions, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty, SurveyResponse } from '@posthog/core';
|
|
2
2
|
import { PostHogAutocaptureOptions, PostHogCustomAppProperties, PostHogCustomStorage, PostHogSessionReplayConfig } from './types';
|
|
3
3
|
import { OptionalReactNativeSessionReplay } from './optional/OptionalSessionReplay';
|
|
4
4
|
export { PostHogPersistedProperty };
|
|
@@ -45,7 +45,46 @@ export declare class PostHog extends PostHogCore {
|
|
|
45
45
|
private _enableSessionReplay?;
|
|
46
46
|
private _disableSurveys;
|
|
47
47
|
private _disableRemoteConfig;
|
|
48
|
+
/**
|
|
49
|
+
* Creates a new PostHog instance for React Native. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).
|
|
50
|
+
*
|
|
51
|
+
* If you prefer not to use the PostHogProvider, you can initialize PostHog in its own file and import the instance from there.
|
|
52
|
+
*
|
|
53
|
+
* {@label Initialization}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* // posthog.ts
|
|
58
|
+
* import PostHog from 'posthog-react-native'
|
|
59
|
+
*
|
|
60
|
+
* export const posthog = new PostHog('<ph_project_api_key>', {
|
|
61
|
+
* host: '<ph_client_api_host>'
|
|
62
|
+
* })
|
|
63
|
+
*
|
|
64
|
+
* // Then you can access PostHog by importing your instance
|
|
65
|
+
* // Another file:
|
|
66
|
+
* import { posthog } from './posthog'
|
|
67
|
+
*
|
|
68
|
+
* export function MyApp1() {
|
|
69
|
+
* useEffect(async () => {
|
|
70
|
+
* posthog.capture('event_name')
|
|
71
|
+
* }, [posthog])
|
|
72
|
+
*
|
|
73
|
+
* return <View>Your app code</View>
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*
|
|
79
|
+
* @param apiKey - Your PostHog API key
|
|
80
|
+
* @param options - PostHog configuration options
|
|
81
|
+
*/
|
|
48
82
|
constructor(apiKey: string, options?: PostHogOptions);
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @internal
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
49
88
|
ready(): Promise<void>;
|
|
50
89
|
getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
|
|
51
90
|
setPersistedProperty<T>(key: PostHogPersistedProperty, value: T | null): void;
|
|
@@ -54,11 +93,415 @@ export declare class PostHog extends PostHogCore {
|
|
|
54
93
|
getLibraryVersion(): string;
|
|
55
94
|
getCustomUserAgent(): string;
|
|
56
95
|
getCommonEventProperties(): PostHogEventProperties;
|
|
96
|
+
/**
|
|
97
|
+
* Registers super properties that are sent with every event.
|
|
98
|
+
*
|
|
99
|
+
* Super properties are properties associated with events that are set once and then sent with every capture call.
|
|
100
|
+
* They persist across sessions and are stored locally.
|
|
101
|
+
*
|
|
102
|
+
* {@label Capture}
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```js
|
|
106
|
+
* // register super properties
|
|
107
|
+
* posthog.register({
|
|
108
|
+
* 'icecream pref': 'vanilla',
|
|
109
|
+
* team_id: 22,
|
|
110
|
+
* })
|
|
111
|
+
* ```
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
*
|
|
115
|
+
* @param properties An associative array of properties to store about the user
|
|
116
|
+
*/
|
|
117
|
+
register(properties: PostHogEventProperties): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Removes a super property so it won't be sent with future events.
|
|
120
|
+
*
|
|
121
|
+
* Super Properties are persisted across sessions so you have to explicitly remove them if they are no longer relevant.
|
|
122
|
+
*
|
|
123
|
+
* {@label Capture}
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```js
|
|
127
|
+
* // remove a super property
|
|
128
|
+
* posthog.unregister('icecream pref')
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* @public
|
|
132
|
+
*
|
|
133
|
+
* @param property The name of the super property to remove
|
|
134
|
+
*/
|
|
135
|
+
unregister(property: string): Promise<void>;
|
|
136
|
+
/**
|
|
137
|
+
* Resets the user's ID and anonymous ID after logout.
|
|
138
|
+
*
|
|
139
|
+
* To reset the user's ID and anonymous ID, call reset. Usually you would do this right after the user logs out.
|
|
140
|
+
* This also clears all stored super properties and more.
|
|
141
|
+
*
|
|
142
|
+
* {@label Identification}
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```js
|
|
146
|
+
* // reset after logout
|
|
147
|
+
* posthog.reset()
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
reset(): void;
|
|
153
|
+
/**
|
|
154
|
+
* Manually flushes the event queue.
|
|
155
|
+
*
|
|
156
|
+
* You can set the number of events in the configuration that should queue before flushing.
|
|
157
|
+
* Setting this to 1 will send events immediately and will use more battery. This is set to 20 by default.
|
|
158
|
+
* You can also manually flush the queue. If a flush is already in progress it returns a promise for the existing flush.
|
|
159
|
+
*
|
|
160
|
+
* {@label Capture}
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```js
|
|
164
|
+
* // manually flush the queue
|
|
165
|
+
* await posthog.flush()
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @public
|
|
169
|
+
*
|
|
170
|
+
* @returns Promise that resolves when the flush is complete
|
|
171
|
+
*/
|
|
172
|
+
flush(): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Opts the user in to data capture.
|
|
175
|
+
*
|
|
176
|
+
* By default, PostHog has tracking enabled unless it is forcefully disabled by default using the option { defaultOptIn: false }.
|
|
177
|
+
* Once this has been called it is persisted and will be respected until optOut is called again or the reset function is called.
|
|
178
|
+
*
|
|
179
|
+
* {@label Privacy}
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```js
|
|
183
|
+
* // opt in to tracking
|
|
184
|
+
* posthog.optIn()
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @public
|
|
188
|
+
*/
|
|
189
|
+
optIn(): Promise<void>;
|
|
190
|
+
/**
|
|
191
|
+
* Opts the user out of data capture.
|
|
192
|
+
*
|
|
193
|
+
* You can completely opt-out users from data capture. Once this has been called it is persisted and will be respected until optIn is called again or the reset function is called.
|
|
194
|
+
*
|
|
195
|
+
* {@label Privacy}
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```js
|
|
199
|
+
* // opt out of tracking
|
|
200
|
+
* posthog.optOut()
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* @public
|
|
204
|
+
*/
|
|
205
|
+
optOut(): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Checks if a feature flag is enabled for the current user.
|
|
208
|
+
*
|
|
209
|
+
* Defaults to undefined if not loaded yet or if there was a problem loading.
|
|
210
|
+
*
|
|
211
|
+
* {@label Feature flags}
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```js
|
|
215
|
+
* // check if feature flag is enabled
|
|
216
|
+
* const isEnabled = posthog.isFeatureEnabled('key-for-your-boolean-flag')
|
|
217
|
+
* ```
|
|
218
|
+
*
|
|
219
|
+
* @public
|
|
220
|
+
*
|
|
221
|
+
* @param key The feature flag key
|
|
222
|
+
* @returns True if enabled, false if disabled, undefined if not loaded
|
|
223
|
+
*/
|
|
224
|
+
isFeatureEnabled(key: string): boolean | undefined;
|
|
225
|
+
/**
|
|
226
|
+
* Gets the value of a feature flag for the current user.
|
|
227
|
+
*
|
|
228
|
+
* Defaults to undefined if not loaded yet or if there was a problem loading.
|
|
229
|
+
* Multivariant feature flags are returned as a string.
|
|
230
|
+
*
|
|
231
|
+
* {@label Feature flags}
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```js
|
|
235
|
+
* // get feature flag value
|
|
236
|
+
* const value = posthog.getFeatureFlag('key-for-your-boolean-flag')
|
|
237
|
+
* ```
|
|
238
|
+
*
|
|
239
|
+
* @public
|
|
240
|
+
*
|
|
241
|
+
* @param key The feature flag key
|
|
242
|
+
* @returns The feature flag value or undefined if not loaded
|
|
243
|
+
*/
|
|
244
|
+
getFeatureFlag(key: string): boolean | string | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* Gets the payload of a feature flag for the current user.
|
|
247
|
+
*
|
|
248
|
+
* Returns JsonType or undefined if not loaded yet or if there was a problem loading.
|
|
249
|
+
*
|
|
250
|
+
* {@label Feature flags}
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```js
|
|
254
|
+
* // get feature flag payload
|
|
255
|
+
* const payload = posthog.getFeatureFlagPayload('key-for-your-multivariate-flag')
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* @public
|
|
259
|
+
*
|
|
260
|
+
* @param key The feature flag key
|
|
261
|
+
* @returns The feature flag payload or undefined if not loaded
|
|
262
|
+
*/
|
|
263
|
+
getFeatureFlagPayload(key: string): JsonType | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* Reloads feature flags from the server.
|
|
266
|
+
*
|
|
267
|
+
* PostHog loads feature flags when instantiated and refreshes whenever methods are called that affect the flag.
|
|
268
|
+
* If you want to manually trigger a refresh, you can call this method.
|
|
269
|
+
*
|
|
270
|
+
* {@label Feature flags}
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```js
|
|
274
|
+
* // reload feature flags
|
|
275
|
+
* posthog.reloadFeatureFlags()
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @public
|
|
279
|
+
*/
|
|
280
|
+
reloadFeatureFlags(): void;
|
|
281
|
+
/**
|
|
282
|
+
* Reloads feature flags from the server asynchronously.
|
|
283
|
+
*
|
|
284
|
+
* PostHog loads feature flags when instantiated and refreshes whenever methods are called that affect the flag.
|
|
285
|
+
* If you want to manually trigger a refresh and get the result, you can call this method.
|
|
286
|
+
*
|
|
287
|
+
* {@label Feature flags}
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```js
|
|
291
|
+
* // reload feature flags and get result
|
|
292
|
+
* posthog.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))
|
|
293
|
+
* ```
|
|
294
|
+
*
|
|
295
|
+
* @public
|
|
296
|
+
*
|
|
297
|
+
* @returns Promise that resolves with the refreshed flags
|
|
298
|
+
*/
|
|
299
|
+
reloadFeatureFlagsAsync(): Promise<Record<string, boolean | string> | undefined>;
|
|
300
|
+
/**
|
|
301
|
+
* Associates the current user with a group.
|
|
302
|
+
*
|
|
303
|
+
* Group analytics allows you to associate the events for that person's session with a group (e.g. teams, organizations, etc.).
|
|
304
|
+
* This is a paid feature and is not available on the open-source or free cloud plan.
|
|
305
|
+
*
|
|
306
|
+
* {@label Group analytics}
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* ```js
|
|
310
|
+
* // associate with a group
|
|
311
|
+
* posthog.group('company', 'company_id_in_your_db')
|
|
312
|
+
* ```
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```js
|
|
316
|
+
* // associate with a group and update properties
|
|
317
|
+
* posthog.group('company', 'company_id_in_your_db', {
|
|
318
|
+
* name: 'Awesome Inc.',
|
|
319
|
+
* employees: 11,
|
|
320
|
+
* })
|
|
321
|
+
* ```
|
|
322
|
+
*
|
|
323
|
+
* @public
|
|
324
|
+
*
|
|
325
|
+
* @param groupType The type of group (e.g. 'company', 'team')
|
|
326
|
+
* @param groupKey The unique identifier for the group
|
|
327
|
+
* @param properties Optional properties to set for the group
|
|
328
|
+
*/
|
|
329
|
+
group(groupType: string, groupKey: string, properties?: PostHogEventProperties): void;
|
|
330
|
+
/**
|
|
331
|
+
* Assigns an alias to the current user.
|
|
332
|
+
*
|
|
333
|
+
* Sometimes, you want to assign multiple distinct IDs to a single user. This is helpful when your primary distinct ID is inaccessible.
|
|
334
|
+
* For example, if a distinct ID used on the frontend is not available in your backend.
|
|
335
|
+
*
|
|
336
|
+
* {@label Identification}
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* ```js
|
|
340
|
+
* // set alias for current user
|
|
341
|
+
* posthog.alias('distinct_id')
|
|
342
|
+
* ```
|
|
343
|
+
*
|
|
344
|
+
* @public
|
|
345
|
+
*
|
|
346
|
+
* @param alias The alias to assign to the current user
|
|
347
|
+
*/
|
|
348
|
+
alias(alias: string): void;
|
|
349
|
+
/**
|
|
350
|
+
* Gets the current user's distinct ID.
|
|
351
|
+
*
|
|
352
|
+
* You may find it helpful to get the current user's distinct ID. For example, to check whether you've already called identify for a user or not.
|
|
353
|
+
* This returns either the ID automatically generated by PostHog or the ID that has been passed by a call to identify().
|
|
354
|
+
*
|
|
355
|
+
* {@label Identification}
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```js
|
|
359
|
+
* // get current distinct ID
|
|
360
|
+
* const distinctId = posthog.getDistinctId()
|
|
361
|
+
* ```
|
|
362
|
+
*
|
|
363
|
+
* @public
|
|
364
|
+
*
|
|
365
|
+
* @returns The current user's distinct ID
|
|
366
|
+
*/
|
|
367
|
+
getDistinctId(): string;
|
|
368
|
+
/**
|
|
369
|
+
* Sets person properties for feature flag evaluation.
|
|
370
|
+
*
|
|
371
|
+
* Sometimes, you might want to evaluate feature flags using properties that haven't been ingested yet, or were set incorrectly earlier.
|
|
372
|
+
* You can do so by setting properties the flag depends on with this call. These are set for the entire session.
|
|
373
|
+
* Successive calls are additive: all properties you set are combined together and sent for flag evaluation.
|
|
374
|
+
*
|
|
375
|
+
* {@label Feature flags}
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```js
|
|
379
|
+
* // set person properties for flags
|
|
380
|
+
* posthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})
|
|
381
|
+
* ```
|
|
382
|
+
*
|
|
383
|
+
* @public
|
|
384
|
+
*
|
|
385
|
+
* @param properties The person properties to set for flag evaluation
|
|
386
|
+
*/
|
|
387
|
+
setPersonPropertiesForFlags(properties: Record<string, string>): void;
|
|
388
|
+
/**
|
|
389
|
+
* Resets person properties for feature flag evaluation.
|
|
390
|
+
*
|
|
391
|
+
*
|
|
392
|
+
* {@label Feature flags}
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* ```js
|
|
396
|
+
* // reset person properties for flags
|
|
397
|
+
* posthog.resetPersonPropertiesForFlags()
|
|
398
|
+
* ```
|
|
399
|
+
*
|
|
400
|
+
* @public
|
|
401
|
+
*/
|
|
402
|
+
resetPersonPropertiesForFlags(): void;
|
|
403
|
+
/**
|
|
404
|
+
* Sets group properties for feature flag evaluation.
|
|
405
|
+
*
|
|
406
|
+
* These properties are automatically attached to the current group (set via posthog.group()).
|
|
407
|
+
* When you change the group, these properties are reset.
|
|
408
|
+
*
|
|
409
|
+
* {@label Feature flags}
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```js
|
|
413
|
+
* // set group properties for flags
|
|
414
|
+
* posthog.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})
|
|
415
|
+
* ```
|
|
416
|
+
*
|
|
417
|
+
* @public
|
|
418
|
+
*
|
|
419
|
+
* @param properties The group properties to set for flag evaluation
|
|
420
|
+
*/
|
|
421
|
+
setGroupPropertiesForFlags(properties: Record<string, Record<string, string>>): void;
|
|
422
|
+
/**
|
|
423
|
+
* Resets group properties for feature flag evaluation.
|
|
424
|
+
*
|
|
425
|
+
* {@label Feature flags}
|
|
426
|
+
*
|
|
427
|
+
* @example
|
|
428
|
+
* ```js
|
|
429
|
+
* // reset group properties for flags
|
|
430
|
+
* posthog.resetGroupPropertiesForFlags()
|
|
431
|
+
* ```
|
|
432
|
+
*
|
|
433
|
+
* @public
|
|
434
|
+
*/
|
|
435
|
+
resetGroupPropertiesForFlags(): void;
|
|
436
|
+
/**
|
|
437
|
+
* Captures a screen view event.
|
|
438
|
+
*
|
|
439
|
+
* @remarks
|
|
440
|
+
* This function requires a name. You may also pass in an optional properties object.
|
|
441
|
+
* Screen name is automatically registered for the session and will be included in subsequent events.
|
|
442
|
+
*
|
|
443
|
+
* {@label Capture}
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* ```js
|
|
447
|
+
* // Basic screen capture
|
|
448
|
+
* posthog.screen('dashboard')
|
|
449
|
+
* ```
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```js
|
|
453
|
+
* // Screen capture with properties
|
|
454
|
+
* posthog.screen('dashboard', {
|
|
455
|
+
* background: 'blue',
|
|
456
|
+
* hero: 'superhog',
|
|
457
|
+
* })
|
|
458
|
+
* ```
|
|
459
|
+
*
|
|
460
|
+
* @public
|
|
461
|
+
*
|
|
462
|
+
* @param name - The name of the screen
|
|
463
|
+
* @param properties - Optional properties to include with the screen event
|
|
464
|
+
* @param options - Optional capture options
|
|
465
|
+
*/
|
|
57
466
|
screen(name: string, properties?: PostHogEventProperties, options?: PostHogCaptureOptions): Promise<void>;
|
|
58
467
|
_isEnableSessionReplay(): boolean;
|
|
59
468
|
_resetSessionId(reactNativeSessionReplay: typeof OptionalReactNativeSessionReplay | undefined, sessionId: string): void;
|
|
60
469
|
getSessionId(): string;
|
|
61
470
|
resetSessionId(): void;
|
|
471
|
+
/**
|
|
472
|
+
* Associates events with a specific user. Learn more about [identifying users](https://posthog.com/docs/product-analytics/identify)
|
|
473
|
+
*
|
|
474
|
+
* {@label Identification}
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```js
|
|
478
|
+
* // Basic identify
|
|
479
|
+
* posthog.identify('distinctID', {
|
|
480
|
+
* email: 'user@posthog.com',
|
|
481
|
+
* name: 'My Name'
|
|
482
|
+
* })
|
|
483
|
+
* ```
|
|
484
|
+
*
|
|
485
|
+
* @example
|
|
486
|
+
* ```js
|
|
487
|
+
* // Using $set and $set_once
|
|
488
|
+
* posthog.identify('distinctID', {
|
|
489
|
+
* $set: {
|
|
490
|
+
* email: 'user@posthog.com',
|
|
491
|
+
* name: 'My Name'
|
|
492
|
+
* },
|
|
493
|
+
* $set_once: {
|
|
494
|
+
* date_of_first_log_in: '2024-03-01'
|
|
495
|
+
* }
|
|
496
|
+
* })
|
|
497
|
+
* ```
|
|
498
|
+
*
|
|
499
|
+
* @public
|
|
500
|
+
*
|
|
501
|
+
* @param distinctId - A unique identifier for your user. Typically either their email or database ID.
|
|
502
|
+
* @param properties - Optional dictionary with key:value pairs to set the person properties
|
|
503
|
+
* @param options - Optional capture options
|
|
504
|
+
*/
|
|
62
505
|
identify(distinctId?: string, properties?: PostHogEventProperties, options?: PostHogCaptureOptions): void;
|
|
63
506
|
initReactNativeNavigation(options: PostHogAutocaptureOptions): boolean;
|
|
64
507
|
getSurveys(): Promise<SurveyResponse['surveys']>;
|
package/dist/posthog-rn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof3=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHog=void 0;Object.defineProperty(exports,"PostHogPersistedProperty",{enumerable:true,get:function get(){return _core.PostHogPersistedProperty;}});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 _core=require("@posthog/core");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 _regeneratorRuntime(){"use strict";_regeneratorRuntime=function _regeneratorRuntime(){return r;};var t,r={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,r,e,n){return Object.defineProperty(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n});}try{c({},"");}catch(t){c=function c(t,r,e){return t[r]=e;};}function h(r,e,n,o){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype);return c(a,"_invoke",function(r,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=d(u,n);if(c){if(c===f)continue;return c;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var h=s(r,e,n);if("normal"===h.type){if(o=n.done?4:2,h.arg===f)continue;return{value:h.arg,done:n.done};}"throw"===h.type&&(o=4,n.method="throw",n.arg=h.arg);}};}(r,n,new Context(o||[])),!0),a;}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)};}catch(t){return{type:"throw",arg:t};}}r.wrap=h;var f={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var l={};c(l,i,function(){return this;});var p=Object.getPrototypeOf,y=p&&p(p(x([])));y&&y!==e&&n.call(y,i)&&(l=y);var v=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(l);function g(t){["next","throw","return"].forEach(function(r){c(t,r,function(t){return this._invoke(r,t);});});}function AsyncIterator(t,r){function e(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var h=c.arg,f=h.value;return f&&"object"==_typeof3(f)&&n.call(f,"__await")?r.resolve(f.__await).then(function(t){e("next",t,a,u);},function(t){e("throw",t,a,u);}):r.resolve(f).then(function(t){h.value=t,a(h);},function(t){return e("throw",t,a,u);});}u(c.arg);}var o;c(this,"_invoke",function(t,n){function i(){return new r(function(r,o){e(t,n,r,o);});}return o=o?o.then(i,i):i();},!0);}function d(r,e){var n=e.method,o=r.i[n];if(o===t)return e.delegate=null,"throw"===n&&r.i["return"]&&(e.method="return",e.arg=t,d(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=s(o,r.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[r.r]=a.value,e.next=r.n,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f);}function w(t){this.tryEntries.push(t);}function m(r){var e=r[4]||{};e.type="normal",e.arg=t,r[4]=e;}function Context(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0);}function x(r){if(null!=r){var e=r[i];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(n.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e;};return a.next=a;}}throw new TypeError(_typeof3(r)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,c(v,"constructor",GeneratorFunctionPrototype),c(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=c(GeneratorFunctionPrototype,u,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name));},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,c(t,u,"GeneratorFunction")),t.prototype=Object.create(v),t;},r.awrap=function(t){return{__await:t};},g(AsyncIterator.prototype),c(AsyncIterator.prototype,a,function(){return this;}),r.AsyncIterator=AsyncIterator,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(h(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next();});},g(v),c(v,u,"Generator"),c(v,i,function(){return this;}),c(v,"toString",function(){return"[object Generator]";}),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.unshift(n);return function t(){for(;e.length;)if((n=e.pop())in r)return t.value=n,t.done=!1,t;return t.done=!0,t;};},r.values=x,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(m),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(r){if(this.done)throw r;var e=this;function n(t){a.type="throw",a.arg=r,e.next=t;}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],h=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!h)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=t,n(c),!0;if(u<h)return n(h),!1;}}},abrupt:function abrupt(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break;}}o&&("break"===t||"continue"===t)&&o[0]<=r&&r<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=r,o?(this.method="next",this.next=o[2],f):this.complete(i);},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),f;},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[2]===t)return this.complete(e[4],e[3]),m(e),f;}},"catch":function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[0]===t){var n=e[4];if("throw"===n.type){var o=n.arg;m(e);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(r,e,n){return this.delegate={i:x(r),r:e,n:n},"next"===this.method&&(this.arg=t),f;}},r;}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,o,e,r){var p=(0,_get2["default"])((0,_getPrototypeOf2["default"])(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,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"])(_regeneratorRuntime().mark(function _callee(err){return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return(0,_core.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["catch"](function(error){console.error('PostHog storage initialization failed:',error);});}var initAfterStorage=function initAfterStorage(){var enablePersistSessionIdAcrossRestart=options===null||options===void 0?void 0:options.enablePersistSessionIdAcrossRestart;if(!enablePersistSessionIdAcrossRestart){_this.setPersistedProperty(_core.PostHogPersistedProperty.SessionId,null);_this.setPersistedProperty(_core.PostHogPersistedProperty.SessionLastTimestamp,null);_this.setPersistedProperty(_core.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"])(_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().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"])(_regeneratorRuntime().mark(function _callee3(name,properties,options){return _regeneratorRuntime().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,String(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;var anonymousId=this.getAnonymousId();_OptionalSessionReplay.OptionalReactNativeSessionReplay.identify(String(distinctId),String(anonymousId));this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay identified with distinctId ".concat(distinctId," and anonymousId ").concat(anonymousId,"."));});}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"])(_regeneratorRuntime().mark(function _callee4(){var surveys,surveysFromApi;return _regeneratorRuntime().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(_core.PostHogPersistedProperty.Surveys,null);return _context4.abrupt("return",[]);case 4:surveys=this.getPersistedProperty(_core.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(_core.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"])(_regeneratorRuntime().mark(function _callee5(options){var _a,_b,_c,_d,_e,_f,_g,defaultThrottleDelayMs,_ref2,_ref2$maskAllTextInpu,maskAllTextInputs,_ref2$maskAllImages,maskAllImages,_ref2$maskAllSandboxe,maskAllSandboxedViews,_ref2$captureLog,captureLog,_ref2$captureNetworkT,captureNetworkTelemetry,_ref2$iOSdebouncerDel,iOSdebouncerDelayMs,_ref2$androidDebounce,androidDebouncerDelayMs,throttleDelayMs,sdkReplayConfig,sessionReplay,featureFlags,cachedFeatureFlags,cachedSessionReplayConfig,recordingActive,linkedFlag,value,flag,variant,_value,sessionId,sdkOptions;return _regeneratorRuntime().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:defaultThrottleDelayMs=1000;_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?defaultThrottleDelayMs:_ref2$iOSdebouncerDel,_ref2$androidDebounce=_ref2.androidDebouncerDelayMs,androidDebouncerDelayMs=_ref2$androidDebounce===void 0?defaultThrottleDelayMs:_ref2$androidDebounce;throttleDelayMs=(_c=(_b=options===null||options===void 0?void 0:options.sessionReplayConfig)===null||_b===void 0?void 0:_b.throttleDelayMs)!==null&&_c!==void 0?_c:defaultThrottleDelayMs;if(throttleDelayMs===defaultThrottleDelayMs&&(iOSdebouncerDelayMs!==defaultThrottleDelayMs||androidDebouncerDelayMs!==defaultThrottleDelayMs)){throttleDelayMs=Math.max(iOSdebouncerDelayMs,androidDebouncerDelayMs);}sdkReplayConfig={maskAllTextInputs:maskAllTextInputs,maskAllImages:maskAllImages,maskAllSandboxedViews:maskAllSandboxedViews,captureLog:captureLog,captureNetworkTelemetry:captureNetworkTelemetry,iOSdebouncerDelayMs:iOSdebouncerDelayMs,androidDebouncerDelayMs:androidDebouncerDelayMs,throttleDelayMs:throttleDelayMs};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay SDK config: ".concat(JSON.stringify(sdkReplayConfig)));});sessionReplay=(_d=this.getPersistedProperty(_core.PostHogPersistedProperty.SessionReplay))!==null&&_d!==void 0?_d:{};featureFlags=(_e=this.getKnownFeatureFlags())!==null&&_e!==void 0?_e:{};cachedFeatureFlags=(_f=featureFlags)!==null&&_f!==void 0?_f:{};cachedSessionReplayConfig=(_g=sessionReplay)!==null&&_g!==void 0?_g:{};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=49;break;}if(!_OptionalSessionReplay.OptionalReactNativeSessionReplay){_context5.next=46;break;}sessionId=this.getSessionId();if(!(sessionId.length===0)){_context5.next=25;break;}this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but no sessionId found.');});return _context5.abrupt("return");case 25: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=27;_context5.next=30;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.isEnabled();case 30:if(_context5.sent){_context5.next=36;break;}_context5.next=33;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.start(String(sessionId),sdkOptions,sdkReplayConfig,cachedSessionReplayConfig);case 33:this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});_context5.next=38;break;case 36:this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,String(sessionId));this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay already started with sessionId ".concat(sessionId,"."));});case 38:this._currentSessionId=sessionId;_context5.next=44;break;case 41:_context5.prev=41;_context5.t0=_context5["catch"](27);this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start: ".concat(_context5.t0,"."));});case 44:_context5.next=47;break;case 46:this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but not installed.');});case 47:_context5.next=50;break;case 49:this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay disabled.');});case 50:case"end":return _context5.stop();}},_callee5,this,[[27,41]]);}));function startSessionReplay(_x7){return _startSessionReplay.apply(this,arguments);}return startSessionReplay;}()},{key:"captureAppLifecycleEvents",value:function(){var _captureAppLifecycleEvents=(0,_asyncToGenerator2["default"])(_regeneratorRuntime().mark(function _callee6(){var _this3=this;var _a,appBuild,appVersion,isMemoryPersistence,properties,prevAppBuild,prevAppVersion,initialUrl;return _regeneratorRuntime().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(_core.PostHogPersistedProperty.InstalledAppBuild);prevAppVersion=this.getPersistedProperty(_core.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,_core.maybeAdd)('previous_version',prevAppVersion)),(0,_core.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,_core.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"])(_regeneratorRuntime().mark(function _callee7(){var appBuild,appVersion;return _regeneratorRuntime().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(_core.PostHogPersistedProperty.InstalledAppBuild,appBuild);this.setPersistedProperty(_core.PostHogPersistedProperty.InstalledAppVersion,appVersion);case 4:case"end":return _context7.stop();}},_callee7,this);}));function persistAppVersion(){return _persistAppVersion.apply(this,arguments);}return persistAppVersion;}()}]);}(_core.PostHogCore);
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof3=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHog=void 0;Object.defineProperty(exports,"PostHogPersistedProperty",{enumerable:true,get:function get(){return _core.PostHogPersistedProperty;}});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 _core=require("@posthog/core");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 _regeneratorRuntime(){"use strict";_regeneratorRuntime=function _regeneratorRuntime(){return r;};var t,r={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,r,e,n){return Object.defineProperty(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n});}try{c({},"");}catch(t){c=function c(t,r,e){return t[r]=e;};}function h(r,e,n,o){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype);return c(a,"_invoke",function(r,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=d(u,n);if(c){if(c===f)continue;return c;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var h=s(r,e,n);if("normal"===h.type){if(o=n.done?4:2,h.arg===f)continue;return{value:h.arg,done:n.done};}"throw"===h.type&&(o=4,n.method="throw",n.arg=h.arg);}};}(r,n,new Context(o||[])),!0),a;}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)};}catch(t){return{type:"throw",arg:t};}}r.wrap=h;var f={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var l={};c(l,i,function(){return this;});var p=Object.getPrototypeOf,y=p&&p(p(x([])));y&&y!==e&&n.call(y,i)&&(l=y);var v=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(l);function g(t){["next","throw","return"].forEach(function(r){c(t,r,function(t){return this._invoke(r,t);});});}function AsyncIterator(t,r){function e(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var h=c.arg,f=h.value;return f&&"object"==_typeof3(f)&&n.call(f,"__await")?r.resolve(f.__await).then(function(t){e("next",t,a,u);},function(t){e("throw",t,a,u);}):r.resolve(f).then(function(t){h.value=t,a(h);},function(t){return e("throw",t,a,u);});}u(c.arg);}var o;c(this,"_invoke",function(t,n){function i(){return new r(function(r,o){e(t,n,r,o);});}return o=o?o.then(i,i):i();},!0);}function d(r,e){var n=e.method,o=r.i[n];if(o===t)return e.delegate=null,"throw"===n&&r.i["return"]&&(e.method="return",e.arg=t,d(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=s(o,r.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[r.r]=a.value,e.next=r.n,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f);}function w(t){this.tryEntries.push(t);}function m(r){var e=r[4]||{};e.type="normal",e.arg=t,r[4]=e;}function Context(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0);}function x(r){if(null!=r){var e=r[i];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function e(){for(;++o<r.length;)if(n.call(r,o))return e.value=r[o],e.done=!1,e;return e.value=t,e.done=!0,e;};return a.next=a;}}throw new TypeError(_typeof3(r)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,c(v,"constructor",GeneratorFunctionPrototype),c(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=c(GeneratorFunctionPrototype,u,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name));},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,c(t,u,"GeneratorFunction")),t.prototype=Object.create(v),t;},r.awrap=function(t){return{__await:t};},g(AsyncIterator.prototype),c(AsyncIterator.prototype,a,function(){return this;}),r.AsyncIterator=AsyncIterator,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(h(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next();});},g(v),c(v,u,"Generator"),c(v,i,function(){return this;}),c(v,"toString",function(){return"[object Generator]";}),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.unshift(n);return function t(){for(;e.length;)if((n=e.pop())in r)return t.value=n,t.done=!1,t;return t.done=!0,t;};},r.values=x,Context.prototype={constructor:Context,reset:function reset(r){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(m),!r)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(r){if(this.done)throw r;var e=this;function n(t){a.type="throw",a.arg=r,e.next=t;}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],h=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!h)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=t,n(c),!0;if(u<h)return n(h),!1;}}},abrupt:function abrupt(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break;}}o&&("break"===t||"continue"===t)&&o[0]<=r&&r<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=r,o?(this.method="next",this.next=o[2],f):this.complete(i);},complete:function complete(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),f;},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[2]===t)return this.complete(e[4],e[3]),m(e),f;}},"catch":function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e[0]===t){var n=e[4];if("throw"===n.type){var o=n.arg;m(e);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(r,e,n){return this.delegate={i:x(r),r:e,n:n},"next"===this.method&&(this.arg=t),f;}},r;}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,o,e,r){var p=(0,_get2["default"])((0,_getPrototypeOf2["default"])(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,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"])(_regeneratorRuntime().mark(function _callee(err){return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return(0,_core.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["catch"](function(error){console.error('PostHog storage initialization failed:',error);});}var initAfterStorage=function initAfterStorage(){var enablePersistSessionIdAcrossRestart=options===null||options===void 0?void 0:options.enablePersistSessionIdAcrossRestart;if(!enablePersistSessionIdAcrossRestart){_this.setPersistedProperty(_core.PostHogPersistedProperty.SessionId,null);_this.setPersistedProperty(_core.PostHogPersistedProperty.SessionLastTimestamp,null);_this.setPersistedProperty(_core.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"])(_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().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:"register",value:function register(properties){return _superPropGet(PostHog,"register",this,3)([properties]);}},{key:"unregister",value:function unregister(property){return _superPropGet(PostHog,"unregister",this,3)([property]);}},{key:"reset",value:function reset(){_superPropGet(PostHog,"reset",this,3)([]);}},{key:"flush",value:function flush(){return _superPropGet(PostHog,"flush",this,3)([]);}},{key:"optIn",value:function optIn(){return _superPropGet(PostHog,"optIn",this,3)([]);}},{key:"optOut",value:function optOut(){return _superPropGet(PostHog,"optOut",this,3)([]);}},{key:"isFeatureEnabled",value:function isFeatureEnabled(key){return _superPropGet(PostHog,"isFeatureEnabled",this,3)([key]);}},{key:"getFeatureFlag",value:function getFeatureFlag(key){return _superPropGet(PostHog,"getFeatureFlag",this,3)([key]);}},{key:"getFeatureFlagPayload",value:function getFeatureFlagPayload(key){return _superPropGet(PostHog,"getFeatureFlagPayload",this,3)([key]);}},{key:"reloadFeatureFlags",value:function reloadFeatureFlags(){_superPropGet(PostHog,"reloadFeatureFlags",this,3)([]);}},{key:"reloadFeatureFlagsAsync",value:function reloadFeatureFlagsAsync(){return _superPropGet(PostHog,"reloadFeatureFlagsAsync",this,3)([]);}},{key:"group",value:function group(groupType,groupKey,properties){_superPropGet(PostHog,"group",this,3)([groupType,groupKey,properties]);}},{key:"alias",value:function alias(_alias){_superPropGet(PostHog,"alias",this,3)([_alias]);}},{key:"getDistinctId",value:function getDistinctId(){return _superPropGet(PostHog,"getDistinctId",this,3)([]);}},{key:"setPersonPropertiesForFlags",value:function setPersonPropertiesForFlags(properties){_superPropGet(PostHog,"setPersonPropertiesForFlags",this,3)([properties]);}},{key:"resetPersonPropertiesForFlags",value:function resetPersonPropertiesForFlags(){_superPropGet(PostHog,"resetPersonPropertiesForFlags",this,3)([]);}},{key:"setGroupPropertiesForFlags",value:function setGroupPropertiesForFlags(properties){_superPropGet(PostHog,"setGroupPropertiesForFlags",this,3)([properties]);}},{key:"resetGroupPropertiesForFlags",value:function resetGroupPropertiesForFlags(){_superPropGet(PostHog,"resetGroupPropertiesForFlags",this,3)([]);}},{key:"screen",value:(function(){var _screen=(0,_asyncToGenerator2["default"])(_regeneratorRuntime().mark(function _callee3(name,properties,options){return _regeneratorRuntime().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,String(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;var anonymousId=this.getAnonymousId();_OptionalSessionReplay.OptionalReactNativeSessionReplay.identify(String(distinctId),String(anonymousId));this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay identified with distinctId ".concat(distinctId," and anonymousId ").concat(anonymousId,"."));});}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"])(_regeneratorRuntime().mark(function _callee4(){var surveys,surveysFromApi;return _regeneratorRuntime().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(_core.PostHogPersistedProperty.Surveys,null);return _context4.abrupt("return",[]);case 4:surveys=this.getPersistedProperty(_core.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(_core.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"])(_regeneratorRuntime().mark(function _callee5(options){var _a,_b,_c,_d,_e,_f,_g,defaultThrottleDelayMs,_ref2,_ref2$maskAllTextInpu,maskAllTextInputs,_ref2$maskAllImages,maskAllImages,_ref2$maskAllSandboxe,maskAllSandboxedViews,_ref2$captureLog,captureLog,_ref2$captureNetworkT,captureNetworkTelemetry,_ref2$iOSdebouncerDel,iOSdebouncerDelayMs,_ref2$androidDebounce,androidDebouncerDelayMs,throttleDelayMs,sdkReplayConfig,sessionReplay,featureFlags,cachedFeatureFlags,cachedSessionReplayConfig,recordingActive,linkedFlag,value,flag,variant,_value,sessionId,sdkOptions;return _regeneratorRuntime().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:defaultThrottleDelayMs=1000;_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?defaultThrottleDelayMs:_ref2$iOSdebouncerDel,_ref2$androidDebounce=_ref2.androidDebouncerDelayMs,androidDebouncerDelayMs=_ref2$androidDebounce===void 0?defaultThrottleDelayMs:_ref2$androidDebounce;throttleDelayMs=(_c=(_b=options===null||options===void 0?void 0:options.sessionReplayConfig)===null||_b===void 0?void 0:_b.throttleDelayMs)!==null&&_c!==void 0?_c:defaultThrottleDelayMs;if(throttleDelayMs===defaultThrottleDelayMs&&(iOSdebouncerDelayMs!==defaultThrottleDelayMs||androidDebouncerDelayMs!==defaultThrottleDelayMs)){throttleDelayMs=Math.max(iOSdebouncerDelayMs,androidDebouncerDelayMs);}sdkReplayConfig={maskAllTextInputs:maskAllTextInputs,maskAllImages:maskAllImages,maskAllSandboxedViews:maskAllSandboxedViews,captureLog:captureLog,captureNetworkTelemetry:captureNetworkTelemetry,iOSdebouncerDelayMs:iOSdebouncerDelayMs,androidDebouncerDelayMs:androidDebouncerDelayMs,throttleDelayMs:throttleDelayMs};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay SDK config: ".concat(JSON.stringify(sdkReplayConfig)));});sessionReplay=(_d=this.getPersistedProperty(_core.PostHogPersistedProperty.SessionReplay))!==null&&_d!==void 0?_d:{};featureFlags=(_e=this.getKnownFeatureFlags())!==null&&_e!==void 0?_e:{};cachedFeatureFlags=(_f=featureFlags)!==null&&_f!==void 0?_f:{};cachedSessionReplayConfig=(_g=sessionReplay)!==null&&_g!==void 0?_g:{};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=49;break;}if(!_OptionalSessionReplay.OptionalReactNativeSessionReplay){_context5.next=46;break;}sessionId=this.getSessionId();if(!(sessionId.length===0)){_context5.next=25;break;}this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but no sessionId found.');});return _context5.abrupt("return");case 25: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=27;_context5.next=30;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.isEnabled();case 30:if(_context5.sent){_context5.next=36;break;}_context5.next=33;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.start(String(sessionId),sdkOptions,sdkReplayConfig,cachedSessionReplayConfig);case 33:this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});_context5.next=38;break;case 36:this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,String(sessionId));this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay already started with sessionId ".concat(sessionId,"."));});case 38:this._currentSessionId=sessionId;_context5.next=44;break;case 41:_context5.prev=41;_context5.t0=_context5["catch"](27);this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start: ".concat(_context5.t0,"."));});case 44:_context5.next=47;break;case 46:this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but not installed.');});case 47:_context5.next=50;break;case 49:this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay disabled.');});case 50:case"end":return _context5.stop();}},_callee5,this,[[27,41]]);}));function startSessionReplay(_x7){return _startSessionReplay.apply(this,arguments);}return startSessionReplay;}()},{key:"captureAppLifecycleEvents",value:function(){var _captureAppLifecycleEvents=(0,_asyncToGenerator2["default"])(_regeneratorRuntime().mark(function _callee6(){var _this3=this;var _a,appBuild,appVersion,isMemoryPersistence,properties,prevAppBuild,prevAppVersion,initialUrl;return _regeneratorRuntime().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(_core.PostHogPersistedProperty.InstalledAppBuild);prevAppVersion=this.getPersistedProperty(_core.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,_core.maybeAdd)('previous_version',prevAppVersion)),(0,_core.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,_core.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"])(_regeneratorRuntime().mark(function _callee7(){var appBuild,appVersion;return _regeneratorRuntime().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(_core.PostHogPersistedProperty.InstalledAppBuild,appBuild);this.setPersistedProperty(_core.PostHogPersistedProperty.InstalledAppVersion,appVersion);case 4:case"end":return _context7.stop();}},_callee7,this);}));function persistAppVersion(){return _persistAppVersion.apply(this,arguments);}return persistAppVersion;}()}]);}(_core.PostHogCore);
|
package/dist/posthog-rn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posthog-rn.js","sourceRoot":"","sources":["../src/posthog-rn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAEtE,OAAO,EAGL,WAAW,EAKX,wBAAwB,EAExB,aAAa,EACb,QAAQ,GAET,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,M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AA2B,CAAC,CAAA;YAC3C,CAAC;iBAAM,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;gBAClC,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAA;YAC1C,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,iBAAiB;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAA;QAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,YAAY,CAAA;QACnD,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;QAC/E,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAA;IACrF,CAAC;CACF"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.6.
|
|
1
|
+
export declare const version = "4.6.1";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.6.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.version=void 0;var version=exports.version="4.6.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "posthog-react-native",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"directory": "packages/react-native"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@posthog/core": "1.0
|
|
16
|
+
"@posthog/core": "1.1.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@babel/cli": "^7.19.3",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"react-native-svg": "^15.0.0",
|
|
42
42
|
"ts-jest": "29.4.0",
|
|
43
43
|
"typescript": "^5.5.4",
|
|
44
|
-
"@posthog-tooling/
|
|
45
|
-
"@posthog-tooling/
|
|
44
|
+
"@posthog-tooling/rollup-utils": "1.0.0",
|
|
45
|
+
"@posthog-tooling/tsconfig-base": "1.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@react-native-async-storage/async-storage": ">=1.0.0",
|
|
@@ -100,6 +100,8 @@
|
|
|
100
100
|
"test:unit": "jest -c jest.config.js",
|
|
101
101
|
"prebuild": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts",
|
|
102
102
|
"build": "tsc -b && babel ./dist --out-dir dist --extensions '.js'",
|
|
103
|
-
"package": "pnpm pack --out $PACKAGE_DEST/%s.tgz"
|
|
103
|
+
"package": "pnpm pack --out $PACKAGE_DEST/%s.tgz",
|
|
104
|
+
"gen-specs": "pnpm exec tsc && pnpm exec api-extractor run --config ./api-extractor.json --local",
|
|
105
|
+
"parse-specs": "node scripts/generate-docs.js"
|
|
104
106
|
}
|
|
105
107
|
}
|