posthog-react-native 3.11.1 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/posthog-core/src/index.d.ts +28 -6
- package/lib/posthog-core/src/index.js +1 -1
- package/lib/posthog-core/src/index.js.map +1 -1
- package/lib/posthog-core/src/surveys-types.d.ts +197 -0
- package/lib/posthog-core/src/surveys-types.js +1 -0
- package/lib/posthog-core/src/surveys-types.js.map +1 -0
- package/lib/posthog-core/src/types.d.ts +36 -11
- package/lib/posthog-core/src/types.js +1 -1
- package/lib/posthog-core/src/types.js.map +1 -1
- package/lib/posthog-react-native/index.d.ts +1 -0
- package/lib/posthog-react-native/index.js +1 -1
- package/lib/posthog-react-native/index.js.map +1 -1
- package/lib/posthog-react-native/src/native-deps.d.ts +1 -0
- package/lib/posthog-react-native/src/native-deps.js +1 -1
- package/lib/posthog-react-native/src/native-deps.js.map +1 -1
- package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.d.ts +2 -0
- package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js +1 -0
- package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js.map +1 -0
- package/lib/posthog-react-native/src/posthog-rn.d.ts +4 -0
- 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/surveys/PostHogSurveyProvider.d.ts +16 -0
- package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js +1 -0
- package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/components/BottomSection.d.ts +9 -0
- package/lib/posthog-react-native/src/surveys/components/BottomSection.js +1 -0
- package/lib/posthog-react-native/src/surveys/components/BottomSection.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/components/Cancel.d.ts +6 -0
- package/lib/posthog-react-native/src/surveys/components/Cancel.js +1 -0
- package/lib/posthog-react-native/src/surveys/components/Cancel.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.d.ts +13 -0
- package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js +1 -0
- package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/components/QuestionHeader.d.ts +7 -0
- package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js +1 -0
- package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/components/QuestionTypes.d.ts +27 -0
- package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js +1 -0
- package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/components/SurveyModal.d.ts +10 -0
- package/lib/posthog-react-native/src/surveys/components/SurveyModal.js +1 -0
- package/lib/posthog-react-native/src/surveys/components/SurveyModal.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/components/Surveys.d.ts +14 -0
- package/lib/posthog-react-native/src/surveys/components/Surveys.js +1 -0
- package/lib/posthog-react-native/src/surveys/components/Surveys.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.d.ts +2 -0
- package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js +1 -0
- package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/icons.d.ts +8 -0
- package/lib/posthog-react-native/src/surveys/icons.js +1 -0
- package/lib/posthog-react-native/src/surveys/icons.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/index.d.ts +6 -0
- package/lib/posthog-react-native/src/surveys/index.js +1 -0
- package/lib/posthog-react-native/src/surveys/index.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/surveys-utils.d.ts +13 -0
- package/lib/posthog-react-native/src/surveys/surveys-utils.js +1 -0
- package/lib/posthog-react-native/src/surveys/surveys-utils.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/useActivatedSurveys.d.ts +3 -0
- package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js +1 -0
- package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js.map +1 -0
- package/lib/posthog-react-native/src/surveys/useSurveyStorage.d.ts +8 -0
- package/lib/posthog-react-native/src/surveys/useSurveyStorage.js +1 -0
- package/lib/posthog-react-native/src/surveys/useSurveyStorage.js.map +1 -0
- 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/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -6
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
export interface SurveyAppearance {
|
|
2
|
+
backgroundColor?: string;
|
|
3
|
+
submitButtonColor?: string;
|
|
4
|
+
submitButtonText?: string;
|
|
5
|
+
submitButtonTextColor?: string;
|
|
6
|
+
ratingButtonColor?: string;
|
|
7
|
+
ratingButtonActiveColor?: string;
|
|
8
|
+
autoDisappear?: boolean;
|
|
9
|
+
displayThankYouMessage?: boolean;
|
|
10
|
+
thankYouMessageHeader?: string;
|
|
11
|
+
thankYouMessageDescription?: string;
|
|
12
|
+
thankYouMessageDescriptionContentType?: SurveyQuestionDescriptionContentType;
|
|
13
|
+
thankYouMessageCloseButtonText?: string;
|
|
14
|
+
borderColor?: string;
|
|
15
|
+
position?: SurveyPosition;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
shuffleQuestions?: boolean;
|
|
18
|
+
surveyPopupDelaySeconds?: number;
|
|
19
|
+
widgetType?: SurveyWidgetType;
|
|
20
|
+
widgetSelector?: string;
|
|
21
|
+
widgetLabel?: string;
|
|
22
|
+
widgetColor?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare enum SurveyPosition {
|
|
25
|
+
Left = "left",
|
|
26
|
+
Right = "right",
|
|
27
|
+
Center = "center"
|
|
28
|
+
}
|
|
29
|
+
export declare enum SurveyWidgetType {
|
|
30
|
+
Button = "button",
|
|
31
|
+
Tab = "tab",
|
|
32
|
+
Selector = "selector"
|
|
33
|
+
}
|
|
34
|
+
export declare enum SurveyType {
|
|
35
|
+
Popover = "popover",
|
|
36
|
+
API = "api",
|
|
37
|
+
Widget = "widget"
|
|
38
|
+
}
|
|
39
|
+
export type SurveyQuestion = BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion;
|
|
40
|
+
export declare enum SurveyQuestionDescriptionContentType {
|
|
41
|
+
Html = "html",
|
|
42
|
+
Text = "text"
|
|
43
|
+
}
|
|
44
|
+
interface SurveyQuestionBase {
|
|
45
|
+
question: string;
|
|
46
|
+
id?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
descriptionContentType?: SurveyQuestionDescriptionContentType;
|
|
49
|
+
optional?: boolean;
|
|
50
|
+
buttonText?: string;
|
|
51
|
+
originalQuestionIndex: number;
|
|
52
|
+
branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;
|
|
53
|
+
}
|
|
54
|
+
export interface BasicSurveyQuestion extends SurveyQuestionBase {
|
|
55
|
+
type: SurveyQuestionType.Open;
|
|
56
|
+
}
|
|
57
|
+
export interface LinkSurveyQuestion extends SurveyQuestionBase {
|
|
58
|
+
type: SurveyQuestionType.Link;
|
|
59
|
+
link?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface RatingSurveyQuestion extends SurveyQuestionBase {
|
|
62
|
+
type: SurveyQuestionType.Rating;
|
|
63
|
+
display: SurveyRatingDisplay;
|
|
64
|
+
scale: 3 | 5 | 7 | 10;
|
|
65
|
+
lowerBoundLabel: string;
|
|
66
|
+
upperBoundLabel: string;
|
|
67
|
+
}
|
|
68
|
+
export declare enum SurveyRatingDisplay {
|
|
69
|
+
Number = "number",
|
|
70
|
+
Emoji = "emoji"
|
|
71
|
+
}
|
|
72
|
+
export interface MultipleSurveyQuestion extends SurveyQuestionBase {
|
|
73
|
+
type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;
|
|
74
|
+
choices: string[];
|
|
75
|
+
hasOpenChoice?: boolean;
|
|
76
|
+
shuffleOptions?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export declare enum SurveyQuestionType {
|
|
79
|
+
Open = "open",
|
|
80
|
+
MultipleChoice = "multiple_choice",
|
|
81
|
+
SingleChoice = "single_choice",
|
|
82
|
+
Rating = "rating",
|
|
83
|
+
Link = "link"
|
|
84
|
+
}
|
|
85
|
+
export declare enum SurveyQuestionBranchingType {
|
|
86
|
+
NextQuestion = "next_question",
|
|
87
|
+
End = "end",
|
|
88
|
+
ResponseBased = "response_based",
|
|
89
|
+
SpecificQuestion = "specific_question"
|
|
90
|
+
}
|
|
91
|
+
interface NextQuestionBranching {
|
|
92
|
+
type: SurveyQuestionBranchingType.NextQuestion;
|
|
93
|
+
}
|
|
94
|
+
interface EndBranching {
|
|
95
|
+
type: SurveyQuestionBranchingType.End;
|
|
96
|
+
}
|
|
97
|
+
interface ResponseBasedBranching {
|
|
98
|
+
type: SurveyQuestionBranchingType.ResponseBased;
|
|
99
|
+
responseValues: Record<string, any>;
|
|
100
|
+
}
|
|
101
|
+
interface SpecificQuestionBranching {
|
|
102
|
+
type: SurveyQuestionBranchingType.SpecificQuestion;
|
|
103
|
+
index: number;
|
|
104
|
+
}
|
|
105
|
+
export interface SurveyResponse {
|
|
106
|
+
surveys: Survey[];
|
|
107
|
+
}
|
|
108
|
+
export type SurveyCallback = (surveys: Survey[]) => void;
|
|
109
|
+
export declare enum SurveyMatchType {
|
|
110
|
+
Regex = "regex",
|
|
111
|
+
NotRegex = "not_regex",
|
|
112
|
+
Exact = "exact",
|
|
113
|
+
IsNot = "is_not",
|
|
114
|
+
Icontains = "icontains",
|
|
115
|
+
NotIcontains = "not_icontains"
|
|
116
|
+
}
|
|
117
|
+
export interface SurveyElement {
|
|
118
|
+
text?: string;
|
|
119
|
+
$el_text?: string;
|
|
120
|
+
tag_name?: string;
|
|
121
|
+
href?: string;
|
|
122
|
+
attr_id?: string;
|
|
123
|
+
attr_class?: string[];
|
|
124
|
+
nth_child?: number;
|
|
125
|
+
nth_of_type?: number;
|
|
126
|
+
attributes?: Record<string, any>;
|
|
127
|
+
event_id?: number;
|
|
128
|
+
order?: number;
|
|
129
|
+
group_id?: number;
|
|
130
|
+
}
|
|
131
|
+
export interface SurveyRenderReason {
|
|
132
|
+
visible: boolean;
|
|
133
|
+
disabledReason?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface Survey {
|
|
136
|
+
id: string;
|
|
137
|
+
name: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
type: SurveyType;
|
|
140
|
+
feature_flag_keys?: {
|
|
141
|
+
key: string;
|
|
142
|
+
value?: string;
|
|
143
|
+
}[];
|
|
144
|
+
linked_flag_key?: string;
|
|
145
|
+
targeting_flag_key?: string;
|
|
146
|
+
internal_targeting_flag_key?: string;
|
|
147
|
+
questions: SurveyQuestion[];
|
|
148
|
+
appearance?: SurveyAppearance;
|
|
149
|
+
conditions?: {
|
|
150
|
+
url?: string;
|
|
151
|
+
selector?: string;
|
|
152
|
+
seenSurveyWaitPeriodInDays?: number;
|
|
153
|
+
urlMatchType?: SurveyMatchType;
|
|
154
|
+
events?: {
|
|
155
|
+
repeatedActivation?: boolean;
|
|
156
|
+
values?: {
|
|
157
|
+
name: string;
|
|
158
|
+
}[];
|
|
159
|
+
};
|
|
160
|
+
actions?: {
|
|
161
|
+
values: SurveyActionType[];
|
|
162
|
+
};
|
|
163
|
+
deviceTypes?: string[];
|
|
164
|
+
deviceTypesMatchType?: SurveyMatchType;
|
|
165
|
+
};
|
|
166
|
+
start_date?: string;
|
|
167
|
+
end_date?: string;
|
|
168
|
+
current_iteration?: number;
|
|
169
|
+
current_iteration_start_date?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface SurveyActionType {
|
|
172
|
+
id: number;
|
|
173
|
+
name?: string;
|
|
174
|
+
steps?: ActionStepType[];
|
|
175
|
+
}
|
|
176
|
+
/** Sync with plugin-server/src/types.ts */
|
|
177
|
+
export declare enum ActionStepStringMatching {
|
|
178
|
+
Contains = "contains",
|
|
179
|
+
Exact = "exact",
|
|
180
|
+
Regex = "regex"
|
|
181
|
+
}
|
|
182
|
+
export interface ActionStepType {
|
|
183
|
+
event?: string;
|
|
184
|
+
selector?: string;
|
|
185
|
+
/** @deprecated Only `selector` should be used now. */
|
|
186
|
+
tag_name?: string;
|
|
187
|
+
text?: string;
|
|
188
|
+
/** @default StringMatching.Exact */
|
|
189
|
+
text_matching?: ActionStepStringMatching;
|
|
190
|
+
href?: string;
|
|
191
|
+
/** @default ActionStepStringMatching.Exact */
|
|
192
|
+
href_matching?: ActionStepStringMatching;
|
|
193
|
+
url?: string;
|
|
194
|
+
/** @default StringMatching.Contains */
|
|
195
|
+
url_matching?: ActionStepStringMatching;
|
|
196
|
+
}
|
|
197
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SurveyWidgetType=exports.SurveyType=exports.SurveyRatingDisplay=exports.SurveyQuestionType=exports.SurveyQuestionDescriptionContentType=exports.SurveyQuestionBranchingType=exports.SurveyPosition=exports.SurveyMatchType=exports.ActionStepStringMatching=void 0;var SurveyPosition;(function(SurveyPosition){SurveyPosition["Left"]="left";SurveyPosition["Right"]="right";SurveyPosition["Center"]="center";})(SurveyPosition||(exports.SurveyPosition=SurveyPosition={}));var SurveyWidgetType;(function(SurveyWidgetType){SurveyWidgetType["Button"]="button";SurveyWidgetType["Tab"]="tab";SurveyWidgetType["Selector"]="selector";})(SurveyWidgetType||(exports.SurveyWidgetType=SurveyWidgetType={}));var SurveyType;(function(SurveyType){SurveyType["Popover"]="popover";SurveyType["API"]="api";SurveyType["Widget"]="widget";})(SurveyType||(exports.SurveyType=SurveyType={}));var SurveyQuestionDescriptionContentType;(function(SurveyQuestionDescriptionContentType){SurveyQuestionDescriptionContentType["Html"]="html";SurveyQuestionDescriptionContentType["Text"]="text";})(SurveyQuestionDescriptionContentType||(exports.SurveyQuestionDescriptionContentType=SurveyQuestionDescriptionContentType={}));var SurveyRatingDisplay;(function(SurveyRatingDisplay){SurveyRatingDisplay["Number"]="number";SurveyRatingDisplay["Emoji"]="emoji";})(SurveyRatingDisplay||(exports.SurveyRatingDisplay=SurveyRatingDisplay={}));var SurveyQuestionType;(function(SurveyQuestionType){SurveyQuestionType["Open"]="open";SurveyQuestionType["MultipleChoice"]="multiple_choice";SurveyQuestionType["SingleChoice"]="single_choice";SurveyQuestionType["Rating"]="rating";SurveyQuestionType["Link"]="link";})(SurveyQuestionType||(exports.SurveyQuestionType=SurveyQuestionType={}));var SurveyQuestionBranchingType;(function(SurveyQuestionBranchingType){SurveyQuestionBranchingType["NextQuestion"]="next_question";SurveyQuestionBranchingType["End"]="end";SurveyQuestionBranchingType["ResponseBased"]="response_based";SurveyQuestionBranchingType["SpecificQuestion"]="specific_question";})(SurveyQuestionBranchingType||(exports.SurveyQuestionBranchingType=SurveyQuestionBranchingType={}));var SurveyMatchType;(function(SurveyMatchType){SurveyMatchType["Regex"]="regex";SurveyMatchType["NotRegex"]="not_regex";SurveyMatchType["Exact"]="exact";SurveyMatchType["IsNot"]="is_not";SurveyMatchType["Icontains"]="icontains";SurveyMatchType["NotIcontains"]="not_icontains";})(SurveyMatchType||(exports.SurveyMatchType=SurveyMatchType={}));var ActionStepStringMatching;(function(ActionStepStringMatching){ActionStepStringMatching["Contains"]="contains";ActionStepStringMatching["Exact"]="exact";ActionStepStringMatching["Regex"]="regex";})(ActionStepStringMatching||(exports.ActionStepStringMatching=ActionStepStringMatching={}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surveys-types.js","sourceRoot":"","sources":["../../../../posthog-core/src/surveys-types.ts"],"names":[],"mappings":"AA2BA,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,iCAAe,CAAA;IACf,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,KAAd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IX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,2CAAe,CAAA;IACf,2CAAe,CAAA;AACjB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Survey } from './surveys-types';
|
|
1
2
|
export type PostHogCoreOptions = {
|
|
2
3
|
/** PostHog API host, usually 'https://us.i.posthog.com' or 'https://eu.i.posthog.com' */
|
|
3
4
|
host?: string;
|
|
@@ -19,6 +20,18 @@ export type PostHogCoreOptions = {
|
|
|
19
20
|
sendFeatureFlagEvent?: boolean;
|
|
20
21
|
/** Whether to load feature flags when initialized or not */
|
|
21
22
|
preloadFeatureFlags?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to load remote config when initialized or not
|
|
25
|
+
* Experimental support
|
|
26
|
+
* Default: false - Remote config is loaded by default
|
|
27
|
+
*/
|
|
28
|
+
disableRemoteConfig?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to load surveys when initialized or not
|
|
31
|
+
* Experimental support
|
|
32
|
+
* Default: false - Surveys are loaded by default, but requires the `PostHogSurveyProvider` to be used
|
|
33
|
+
*/
|
|
34
|
+
disableSurveys?: boolean;
|
|
22
35
|
/** Option to bootstrap the library with given distinctId and feature flags */
|
|
23
36
|
bootstrap?: {
|
|
24
37
|
distinctId?: string;
|
|
@@ -34,6 +47,8 @@ export type PostHogCoreOptions = {
|
|
|
34
47
|
requestTimeout?: number;
|
|
35
48
|
/** Timeout in milliseconds for feature flag calls. Defaults to 10 seconds for stateful clients, and 3 seconds for stateless. */
|
|
36
49
|
featureFlagsRequestTimeoutMs?: number;
|
|
50
|
+
/** Timeout in milliseconds for remote config calls. Defaults to 3 seconds. */
|
|
51
|
+
remoteConfigRequestTimeoutMs?: number;
|
|
37
52
|
/** For Session Analysis how long before we expire a session (defaults to 30 mins) */
|
|
38
53
|
sessionExpirationTimeSeconds?: number;
|
|
39
54
|
/** Whether to post events to PostHog in JSON or compressed format. Defaults to 'json' */
|
|
@@ -60,7 +75,11 @@ export declare enum PostHogPersistedProperty {
|
|
|
60
75
|
InstalledAppBuild = "installed_app_build",
|
|
61
76
|
InstalledAppVersion = "installed_app_version",
|
|
62
77
|
SessionReplay = "session_replay",
|
|
63
|
-
DecideEndpointWasHit = "decide_endpoint_was_hit"
|
|
78
|
+
DecideEndpointWasHit = "decide_endpoint_was_hit",
|
|
79
|
+
SurveyLastSeenDate = "survey_last_seen_date",
|
|
80
|
+
SurveysSeen = "surveys_seen",
|
|
81
|
+
Surveys = "surveys",
|
|
82
|
+
RemoteConfig = "remote_config"
|
|
64
83
|
}
|
|
65
84
|
export type PostHogFetchOptions = {
|
|
66
85
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH';
|
|
@@ -101,16 +120,20 @@ export type PostHogAutocaptureElement = {
|
|
|
101
120
|
} & {
|
|
102
121
|
[key: string]: any;
|
|
103
122
|
};
|
|
104
|
-
export
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
editorParams: {
|
|
109
|
-
toolbarVersion: string;
|
|
110
|
-
jsURL: string;
|
|
123
|
+
export interface PostHogRemoteConfig {
|
|
124
|
+
sessionRecording?: boolean | {
|
|
125
|
+
[key: string]: JsonType;
|
|
111
126
|
};
|
|
112
|
-
|
|
113
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Whether surveys are enabled
|
|
129
|
+
*/
|
|
130
|
+
surveys?: boolean | Survey[];
|
|
131
|
+
/**
|
|
132
|
+
* Indicates if the team has any flags enabled (if not we don't need to load them)
|
|
133
|
+
*/
|
|
134
|
+
hasFeatureFlags?: boolean;
|
|
135
|
+
}
|
|
136
|
+
export interface PostHogDecideResponse extends Omit<PostHogRemoteConfig, 'surveys' | 'hasFeatureFlags'> {
|
|
114
137
|
featureFlags: {
|
|
115
138
|
[key: string]: string | boolean;
|
|
116
139
|
};
|
|
@@ -121,7 +144,9 @@ export type PostHogDecideResponse = {
|
|
|
121
144
|
sessionRecording?: boolean | {
|
|
122
145
|
[key: string]: JsonType;
|
|
123
146
|
};
|
|
124
|
-
|
|
147
|
+
quotaLimited?: string[];
|
|
148
|
+
requestId?: string;
|
|
149
|
+
}
|
|
125
150
|
export type PostHogFlagsAndPayloadsResponse = {
|
|
126
151
|
featureFlags: PostHogDecideResponse['featureFlags'];
|
|
127
152
|
featureFlagPayloads: PostHogDecideResponse['featureFlagPayloads'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogPersistedProperty=void 0;var PostHogPersistedProperty;(function(PostHogPersistedProperty){PostHogPersistedProperty["AnonymousId"]="anonymous_id";PostHogPersistedProperty["DistinctId"]="distinct_id";PostHogPersistedProperty["Props"]="props";PostHogPersistedProperty["FeatureFlags"]="feature_flags";PostHogPersistedProperty["FeatureFlagPayloads"]="feature_flag_payloads";PostHogPersistedProperty["BootstrapFeatureFlags"]="bootstrap_feature_flags";PostHogPersistedProperty["BootstrapFeatureFlagPayloads"]="bootstrap_feature_flag_payloads";PostHogPersistedProperty["OverrideFeatureFlags"]="override_feature_flags";PostHogPersistedProperty["Queue"]="queue";PostHogPersistedProperty["OptedOut"]="opted_out";PostHogPersistedProperty["SessionId"]="session_id";PostHogPersistedProperty["SessionLastTimestamp"]="session_timestamp";PostHogPersistedProperty["PersonProperties"]="person_properties";PostHogPersistedProperty["GroupProperties"]="group_properties";PostHogPersistedProperty["InstalledAppBuild"]="installed_app_build";PostHogPersistedProperty["InstalledAppVersion"]="installed_app_version";PostHogPersistedProperty["SessionReplay"]="session_replay";PostHogPersistedProperty["DecideEndpointWasHit"]="decide_endpoint_was_hit";})(PostHogPersistedProperty||(exports.PostHogPersistedProperty=PostHogPersistedProperty={}));
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogPersistedProperty=void 0;var PostHogPersistedProperty;(function(PostHogPersistedProperty){PostHogPersistedProperty["AnonymousId"]="anonymous_id";PostHogPersistedProperty["DistinctId"]="distinct_id";PostHogPersistedProperty["Props"]="props";PostHogPersistedProperty["FeatureFlags"]="feature_flags";PostHogPersistedProperty["FeatureFlagPayloads"]="feature_flag_payloads";PostHogPersistedProperty["BootstrapFeatureFlags"]="bootstrap_feature_flags";PostHogPersistedProperty["BootstrapFeatureFlagPayloads"]="bootstrap_feature_flag_payloads";PostHogPersistedProperty["OverrideFeatureFlags"]="override_feature_flags";PostHogPersistedProperty["Queue"]="queue";PostHogPersistedProperty["OptedOut"]="opted_out";PostHogPersistedProperty["SessionId"]="session_id";PostHogPersistedProperty["SessionLastTimestamp"]="session_timestamp";PostHogPersistedProperty["PersonProperties"]="person_properties";PostHogPersistedProperty["GroupProperties"]="group_properties";PostHogPersistedProperty["InstalledAppBuild"]="installed_app_build";PostHogPersistedProperty["InstalledAppVersion"]="installed_app_version";PostHogPersistedProperty["SessionReplay"]="session_replay";PostHogPersistedProperty["DecideEndpointWasHit"]="decide_endpoint_was_hit";PostHogPersistedProperty["SurveyLastSeenDate"]="survey_last_seen_date";PostHogPersistedProperty["SurveysSeen"]="surveys_seen";PostHogPersistedProperty["Surveys"]="surveys";PostHogPersistedProperty["RemoteConfig"]="remote_config";})(PostHogPersistedProperty||(exports.PostHogPersistedProperty=PostHogPersistedProperty={}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../posthog-core/src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../posthog-core/src/types.ts"],"names":[],"mappings":"AA6DA,MAAM,CAAN,IAAY,wBAuBX;AAvBD,WAAY,wBAAwB;IAClC,wDAA4B,CAAA;IAC5B,sDAA0B,CAAA;IAC1B,2CAAe,CAAA;IACf,0DAA8B,CAAA;IAC9B,yEAA6C,CAAA;IAC7C,6EAAiD,CAAA;IACjD,4FAAgE,CAAA;IAChE,2EAA+C,CAAA;IAC/C,2CAAe,CAAA;IACf,kDAAsB,CAAA;IACtB,oDAAwB,CAAA;IACxB,sEAA0C,CAAA;IAC1C,kEAAsC,CAAA;IACtC,gEAAoC,CAAA;IACpC,qEAAyC,CAAA;IACzC,yEAA6C,CAAA;IAC7C,4DAAgC,CAAA;IAChC,4EAAgD,CAAA;IAChD,wEAA4C,CAAA;IAC5C,wDAA4B,CAAA;IAC5B,+CAAmB,CAAA;IACnB,0DAA8B,CAAA;AAChC,CAAC,EAvBW,wBAAwB,KAAxB,wBAAwB,QAuBnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={};exports["default"]=void 0;var _posthogRn=require("./src/posthog-rn");Object.keys(_posthogRn).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_posthogRn[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _posthogRn[key];}});});var _useNavigationTracker=require("./src/hooks/useNavigationTracker");Object.keys(_useNavigationTracker).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useNavigationTracker[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useNavigationTracker[key];}});});var _useFeatureFlags=require("./src/hooks/useFeatureFlags");Object.keys(_useFeatureFlags).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useFeatureFlags[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useFeatureFlags[key];}});});var _useFeatureFlag=require("./src/hooks/useFeatureFlag");Object.keys(_useFeatureFlag).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useFeatureFlag[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useFeatureFlag[key];}});});var _usePostHog=require("./src/hooks/usePostHog");Object.keys(_usePostHog).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_usePostHog[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _usePostHog[key];}});});var _PostHogProvider=require("./src/PostHogProvider");Object.keys(_PostHogProvider).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_PostHogProvider[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _PostHogProvider[key];}});});var _types=require("./src/types");Object.keys(_types).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_types[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _types[key];}});});var _default=exports["default"]=_posthogRn.PostHog;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={};exports["default"]=void 0;var _posthogRn=require("./src/posthog-rn");Object.keys(_posthogRn).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_posthogRn[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _posthogRn[key];}});});var _useNavigationTracker=require("./src/hooks/useNavigationTracker");Object.keys(_useNavigationTracker).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useNavigationTracker[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useNavigationTracker[key];}});});var _useFeatureFlags=require("./src/hooks/useFeatureFlags");Object.keys(_useFeatureFlags).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useFeatureFlags[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useFeatureFlags[key];}});});var _useFeatureFlag=require("./src/hooks/useFeatureFlag");Object.keys(_useFeatureFlag).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useFeatureFlag[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useFeatureFlag[key];}});});var _usePostHog=require("./src/hooks/usePostHog");Object.keys(_usePostHog).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_usePostHog[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _usePostHog[key];}});});var _PostHogProvider=require("./src/PostHogProvider");Object.keys(_PostHogProvider).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_PostHogProvider[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _PostHogProvider[key];}});});var _types=require("./src/types");Object.keys(_types).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_types[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _types[key];}});});var _surveys=require("./src/surveys");Object.keys(_surveys).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_surveys[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _surveys[key];}});});var _default=exports["default"]=_posthogRn.PostHog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,eAAe,OAAO,CAAA;AACtB,cAAc,kBAAkB,CAAA;AAChC,cAAc,kCAAkC,CAAA;AAChD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,eAAe,OAAO,CAAA;AACtB,cAAc,kBAAkB,CAAA;AAChC,cAAc,kCAAkC,CAAA;AAChD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { PostHogCustomAppProperties, PostHogCustomStorage } from './types';
|
|
2
|
+
export declare const currentDeviceType: string;
|
|
2
3
|
export declare const getAppProperties: () => PostHogCustomAppProperties;
|
|
3
4
|
export declare const buildOptimisiticAsyncStorage: () => PostHogCustomStorage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getAppProperties=exports.buildOptimisiticAsyncStorage=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _OptionalAsyncStorage=require("./optional/OptionalAsyncStorage");var _OptionalExpoApplication=require("./optional/OptionalExpoApplication");var _OptionalExpoDevice=require("./optional/OptionalExpoDevice");var _OptionalExpoFileSystem=require("./optional/OptionalExpoFileSystem");var _OptionalExpoLocalization=require("./optional/OptionalExpoLocalization");var _OptionalReactNativeDeviceInfo=require("./optional/OptionalReactNativeDeviceInfo");var _OptionalReactNativeLocalize=require("./optional/OptionalReactNativeLocalize");var
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getAppProperties=exports.currentDeviceType=exports.buildOptimisiticAsyncStorage=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _reactNative=require("react-native");var _OptionalAsyncStorage=require("./optional/OptionalAsyncStorage");var _OptionalExpoApplication=require("./optional/OptionalExpoApplication");var _OptionalExpoDevice=require("./optional/OptionalExpoDevice");var _OptionalExpoFileSystem=require("./optional/OptionalExpoFileSystem");var _OptionalExpoLocalization=require("./optional/OptionalExpoLocalization");var _OptionalReactNativeDeviceInfo=require("./optional/OptionalReactNativeDeviceInfo");var _OptionalReactNativeLocalize=require("./optional/OptionalReactNativeLocalize");var getDeviceType=function getDeviceType(){var deviceType='Mobile';if(_reactNative.Platform.OS==='macos'||_reactNative.Platform.OS==='windows'){deviceType='Desktop';}else if(_reactNative.Platform.OS==='web'){deviceType='Web';}return deviceType;};var currentDeviceType=exports.currentDeviceType=getDeviceType();var getAppProperties=exports.getAppProperties=function getAppProperties(){var properties={$device_type:currentDeviceType};if(_OptionalExpoApplication.OptionalExpoApplication){properties.$app_build=_OptionalExpoApplication.OptionalExpoApplication.nativeBuildVersion;properties.$app_name=_OptionalExpoApplication.OptionalExpoApplication.applicationName;properties.$app_namespace=_OptionalExpoApplication.OptionalExpoApplication.applicationId;properties.$app_version=_OptionalExpoApplication.OptionalExpoApplication.nativeApplicationVersion;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$app_build=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBuildNumber());properties.$app_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getApplicationName());properties.$app_namespace=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getBundleId());properties.$app_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getVersion());}if(_OptionalExpoDevice.OptionalExpoDevice){properties.$device_manufacturer=_OptionalExpoDevice.OptionalExpoDevice.manufacturer;properties.$device_name=_OptionalExpoDevice.OptionalExpoDevice.modelName;if(_reactNative.Platform.OS==='android'){properties.$os_name='Android';}else{properties.$os_name=_OptionalExpoDevice.OptionalExpoDevice.osName;}properties.$os_version=_OptionalExpoDevice.OptionalExpoDevice.osVersion;}else if(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo){properties.$device_manufacturer=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getManufacturerSync());properties.$device_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getModel());properties.$os_name=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemName());properties.$os_version=returnPropertyIfNotUnknown(_OptionalReactNativeDeviceInfo.OptionalReactNativeDeviceInfo.getSystemVersion());}if(_OptionalExpoLocalization.OptionalExpoLocalization){properties.$locale=_OptionalExpoLocalization.OptionalExpoLocalization.locale;properties.$timezone=_OptionalExpoLocalization.OptionalExpoLocalization.timezone;}else if(_OptionalReactNativeLocalize.OptionalReactNativeLocalize){var localesFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getLocales;if(localesFn){var locales=localesFn();if(locales&&locales.length>0){var languageTag=locales[0].languageTag;if(languageTag){properties.$locale=languageTag;}}}var timezoneFn=_OptionalReactNativeLocalize.OptionalReactNativeLocalize.getTimeZone;if(timezoneFn){var timezone=timezoneFn();if(timezone){properties.$timezone=timezone;}}}return properties;};var returnPropertyIfNotUnknown=function returnPropertyIfNotUnknown(value){if(value!=='unknown'){return value;}return null;};var buildOptimisiticAsyncStorage=exports.buildOptimisiticAsyncStorage=function buildOptimisiticAsyncStorage(){if(_OptionalExpoFileSystem.OptionalExpoFileSystem){var filesystem=_OptionalExpoFileSystem.OptionalExpoFileSystem;return{getItem:function getItem(key){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var uri,stringContent;return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:uri=(filesystem.documentDirectory||'')+key;_context.prev=1;_context.next=4;return filesystem.readAsStringAsync(uri);case 4:stringContent=_context.sent;return _context.abrupt("return",stringContent);case 8:_context.prev=8;_context.t0=_context["catch"](1);return _context.abrupt("return",null);case 11:case"end":return _context.stop();}},_callee,null,[[1,8]]);}))();},setItem:function setItem(key,value){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(){var uri;return _regenerator["default"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:uri=(filesystem.documentDirectory||'')+key;_context2.next=3;return filesystem.writeAsStringAsync(uri,value);case 3:case"end":return _context2.stop();}},_callee2);}))();}};}if(_OptionalAsyncStorage.OptionalAsyncStorage){return _OptionalAsyncStorage.OptionalAsyncStorage;}throw new Error('PostHog: No storage available. Please install expo-filesystem or react-native-async-storage OR implement a custom storage provider.');};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-deps.js","sourceRoot":"","sources":["../../../src/native-deps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAA;AAExF,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAA;AAEpF,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AiB,CAAC,GAAG,CAAC,CAAA;oBAC7D,OAAO,aAAa,CAAA;iBACrB;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,IAAI,CAAA;iBACZ;YACH,CAAC;YAED,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,KAAa;gBACtC,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,iBAAiB,IAAI,EAAE,CAAC,GAAG,GAAG,CAAA;gBACtD,MAAM,UAAU,CAAC,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YACjD,CAAC;SACF,CAAA;KACF;IAED,IAAI,oBAAoB,EAAE;QACxB,OAAO,oBAAoB,CAAA;KAC5B;IAED,MAAM,IAAI,KAAK,CACb,qIAAqI,CACtI,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.useOptionalSafeAreaInsets=void 0;var OptionalRNSafeArea=undefined;try{OptionalRNSafeArea=require('react-native-safe-area-context');}catch(e){}function createDefaultInsets(){return{top:60,bottom:30,left:0,right:0};}var useOptionalSafeAreaInsets=exports.useOptionalSafeAreaInsets=function useOptionalSafeAreaInsets(){var _a;var useSafeAreaInsets=(_a=OptionalRNSafeArea===null||OptionalRNSafeArea===void 0?void 0:OptionalRNSafeArea.useSafeAreaInsets)!==null&&_a!==void 0?_a:createDefaultInsets;try{return useSafeAreaInsets();}catch(err){return createDefaultInsets();}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionalReactNativeSafeArea.js","sourceRoot":"","sources":["../../../../src/optional/OptionalReactNativeSafeArea.ts"],"names":[],"mappings":"AAEA,IAAI,kBAAkB,GAAyC,SAAS,CAAA;AAExE,IAAI;IACF,kBAAkB,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAA;CAC/D;AAAC,OAAO,CAAC,EAAE,GAAE;AAEd,SAAS,mBAAmB;IAC1B,yFAAyF;IACzF,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AACnD,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAiC,EAAE;;IAC1E,MAAM,iBAAiB,GAAG,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,iBAAiB,mCAAI,mBAAmB,CAAA;IACtF,IAAI;QACF,OAAO,iBAAiB,EAAE,CAAA;KAC3B;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,mBAAmB,EAAE,CAAA;KAC7B;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PostHogCaptureOptions, PostHogCore, PostHogCoreOptions, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty } from '../../posthog-core/src';
|
|
2
2
|
import { PostHogAutocaptureOptions, PostHogCustomAppProperties, PostHogCustomStorage, PostHogSessionReplayConfig } from './types';
|
|
3
3
|
import { OptionalReactNativeSessionReplay } from './optional/OptionalSessionReplay';
|
|
4
|
+
import { SurveyResponse } from '../../posthog-core/src/surveys-types';
|
|
4
5
|
export type PostHogOptions = PostHogCoreOptions & {
|
|
5
6
|
/** Allows you to provide the storage type. By default 'file'.
|
|
6
7
|
* 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage.
|
|
@@ -44,6 +45,8 @@ export declare class PostHog extends PostHogCore {
|
|
|
44
45
|
private _appProperties;
|
|
45
46
|
private _currentSessionId?;
|
|
46
47
|
private _enableSessionReplay?;
|
|
48
|
+
private _disableSurveys;
|
|
49
|
+
private _disableRemoteConfig;
|
|
47
50
|
constructor(apiKey: string, options?: PostHogOptions);
|
|
48
51
|
ready(): Promise<void>;
|
|
49
52
|
getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
|
|
@@ -62,6 +65,7 @@ export declare class PostHog extends PostHogCore {
|
|
|
62
65
|
resetSessionId(): void;
|
|
63
66
|
identify(distinctId?: string, properties?: PostHogEventProperties, options?: PostHogCaptureOptions): void;
|
|
64
67
|
initReactNativeNavigation(options: PostHogAutocaptureOptions): boolean;
|
|
68
|
+
getSurveys(): Promise<SurveyResponse['surveys']>;
|
|
65
69
|
private startSessionReplay;
|
|
66
70
|
private captureNativeAppLifecycleEvents;
|
|
67
71
|
private persistAppVersion;
|
|
@@ -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;_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._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(){void _this.flush();});var storagePromise;if(_this._persistence==='file'){_this._storage=new _storage.PostHogRNStorage((_b=options===null||options===void 0?void 0:options.customStorage)!==null&&_b!==void 0?_b:(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.setupBootstrap(options);_this._isInitialized=true;if((options===null||options===void 0?void 0:options.preloadFeatureFlags)!==false){_this.reloadFeatureFlags();}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 _callee(){return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return this._initPromise;case 2:case"end":return _context.stop();}},_callee,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 _callee2(name,properties,options){return _regenerator["default"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this._initPromise;case 2:this.registerForSession({$screen_name:name});return _context2.abrupt("return",this.capture('$screen',_objectSpread(_objectSpread({},properties),{},{$screen_name:name}),options));case 4:case"end":return _context2.stop();}},_callee2,this);}));function screen(_x3,_x4,_x5){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',"Session replay started with sessionId ".concat(sessionId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start with sessionId: ".concat(e,"."));});}}this._currentSessionId=sessionId;}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay session id 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:"startSessionReplay",value:function(){var _startSessionReplay=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(options){var _a,_b,_c,_d,_e,_ref,_ref$maskAllTextInput,maskAllTextInputs,_ref$maskAllImages,maskAllImages,_ref$maskAllSandboxed,maskAllSandboxedViews,_ref$maskPhotoLibrary,maskPhotoLibraryImages,_ref$captureLog,captureLog,_ref$captureNetworkTe,captureNetworkTelemetry,_ref$iOSdebouncerDela,iOSdebouncerDelayMs,_ref$androidDebouncer,androidDebouncerDelayMs,sdkReplayConfig,sessionReplay,featureFlags,decideFeatureFlags,decideReplayConfig,recordingActive,linkedFlag,value,flag,variant,_value,sessionId,sdkOptions;return _regenerator["default"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:this._enableSessionReplay=options===null||options===void 0?void 0:options.enableSessionReplay;if(this._isEnableSessionReplay()){_context3.next=4;break;}this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay is not enabled.');});return _context3.abrupt("return");case 4:_ref=(_a=options===null||options===void 0?void 0:options.sessionReplayConfig)!==null&&_a!==void 0?_a:{},_ref$maskAllTextInput=_ref.maskAllTextInputs,maskAllTextInputs=_ref$maskAllTextInput===void 0?true:_ref$maskAllTextInput,_ref$maskAllImages=_ref.maskAllImages,maskAllImages=_ref$maskAllImages===void 0?true:_ref$maskAllImages,_ref$maskAllSandboxed=_ref.maskAllSandboxedViews,maskAllSandboxedViews=_ref$maskAllSandboxed===void 0?true:_ref$maskAllSandboxed,_ref$maskPhotoLibrary=_ref.maskPhotoLibraryImages,maskPhotoLibraryImages=_ref$maskPhotoLibrary===void 0?false:_ref$maskPhotoLibrary,_ref$captureLog=_ref.captureLog,captureLog=_ref$captureLog===void 0?true:_ref$captureLog,_ref$captureNetworkTe=_ref.captureNetworkTelemetry,captureNetworkTelemetry=_ref$captureNetworkTe===void 0?true:_ref$captureNetworkTe,_ref$iOSdebouncerDela=_ref.iOSdebouncerDelayMs,iOSdebouncerDelayMs=_ref$iOSdebouncerDela===void 0?1000:_ref$iOSdebouncerDela,_ref$androidDebouncer=_ref.androidDebouncerDelayMs,androidDebouncerDelayMs=_ref$androidDebouncer===void 0?1000:_ref$androidDebouncer;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.getPersistedProperty(_src.PostHogPersistedProperty.FeatureFlags))!==null&&_c!==void 0?_c:{};decideFeatureFlags=(_d=featureFlags)!==null&&_d!==void 0?_d:{};decideReplayConfig=(_e=sessionReplay)!==null&&_e!==void 0?_e:{};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay decide cached config: ".concat(JSON.stringify(decideReplayConfig)));});recordingActive=true;linkedFlag=decideReplayConfig['linkedFlag'];if(typeof linkedFlag==='string'){value=decideFeatureFlags[linkedFlag];if(typeof value==='boolean'){recordingActive=value;}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=decideFeatureFlags[flag];if(_value){recordingActive=_value===variant;this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay ".concat(flag," linked flag variant: ").concat(variant," and value ").concat(_value));});}}}if(!recordingActive){_context3.next=45;break;}if(!_OptionalSessionReplay.OptionalReactNativeSessionReplay){_context3.next=42;break;}sessionId=this.getSessionId();if(!(sessionId.length===0)){_context3.next=21;break;}this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but no sessionId found.');});return _context3.abrupt("return");case 21: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)));});_context3.prev=23;_context3.next=26;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.isEnabled();case 26:if(_context3.sent){_context3.next=32;break;}_context3.next=29;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.start(sessionId,sdkOptions,sdkReplayConfig,decideReplayConfig);case 29:this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});_context3.next=34;break;case 32:this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay already started with sessionId ".concat(sessionId,"."));});case 34:this._currentSessionId=sessionId;_context3.next=40;break;case 37:_context3.prev=37;_context3.t0=_context3["catch"](23);this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start: ".concat(_context3.t0,"."));});case 40:_context3.next=43;break;case 42:this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but not installed.');});case 43:_context3.next=46;break;case 45:this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay disabled.');});case 46:case"end":return _context3.stop();}},_callee3,this,[[23,37]]);}));function startSessionReplay(_x6){return _startSessionReplay.apply(this,arguments);}return startSessionReplay;}()},{key:"captureNativeAppLifecycleEvents",value:function(){var _captureNativeAppLifecycleEvents=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(){var _this3=this;var _a,appBuild,appVersion,isMemoryPersistence,properties,prevAppBuild,prevAppVersion,initialUrl;return _regenerator["default"].wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;isMemoryPersistence=this._persistence==='memory';properties={version:appVersion,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({previous_version:prevAppVersion,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.');});}_context4.next=7;return _reactNative.Linking.getInitialURL();case 7:_context4.t1=_a=_context4.sent;_context4.t0=_context4.t1!==null;if(!_context4.t0){_context4.next=11;break;}_context4.t0=_a!==void 0;case 11:if(!_context4.t0){_context4.next=15;break;}_context4.t2=_a;_context4.next=16;break;case 15:_context4.t2=undefined;case 16:initialUrl=_context4.t2;this.capture('Application Opened',_objectSpread(_objectSpread({},properties),{},{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 _context4.stop();}},_callee4,this);}));function captureNativeAppLifecycleEvents(){return _captureNativeAppLifecycleEvents.apply(this,arguments);}return captureNativeAppLifecycleEvents;}()},{key:"persistAppVersion",value:function(){var _persistAppVersion=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5(){var appBuild,appVersion;return _regenerator["default"].wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.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 _context5.stop();}},_callee5,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(){void _this.flush();});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.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 _callee(){return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return this._initPromise;case 2:case"end":return _context.stop();}},_callee,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 _callee2(name,properties,options){return _regenerator["default"].wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return this._initPromise;case 2:this.registerForSession({$screen_name:name});return _context2.abrupt("return",this.capture('$screen',_objectSpread(_objectSpread({},properties),{},{$screen_name:name}),options));case 4:case"end":return _context2.stop();}},_callee2,this);}));function screen(_x3,_x4,_x5){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',"Session replay started with sessionId ".concat(sessionId,"."));});}catch(e){this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start with sessionId: ".concat(e,"."));});}}this._currentSessionId=sessionId;}else{this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay session id 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 _callee3(){var surveys,surveysFromApi;return _regenerator["default"].wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(this._disableSurveys===true)){_context3.next=4;break;}this.logMsgIfDebug(function(){return console.log('Loading surveys is disabled.');});this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,null);return _context3.abrupt("return",[]);case 4:surveys=this.getPersistedProperty(_src.PostHogPersistedProperty.Surveys);if(!(surveys&&surveys.length>0)){_context3.next=10;break;}this.logMsgIfDebug(function(){return console.log('PostHog Debug','Surveys fetched from storage: ',JSON.stringify(surveys));});return _context3.abrupt("return",surveys);case 10:this.logMsgIfDebug(function(){return console.log('PostHog Debug','No surveys found in storage');});case 11:if(!(this._disableRemoteConfig===true)){_context3.next=18;break;}_context3.next=14;return _superPropGet(PostHog,"getSurveysStateless",this,3)([]);case 14:surveysFromApi=_context3.sent;if(!(surveysFromApi&&surveysFromApi.length>0)){_context3.next=18;break;}this.setPersistedProperty(_src.PostHogPersistedProperty.Surveys,surveysFromApi);return _context3.abrupt("return",surveysFromApi);case 18:return _context3.abrupt("return",[]);case 19:case"end":return _context3.stop();}},_callee3,this);}));function getSurveys(){return _getSurveys.apply(this,arguments);}return getSurveys;}()},{key:"startSessionReplay",value:function(){var _startSessionReplay=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(options){var _a,_b,_c,_d,_e,_ref,_ref$maskAllTextInput,maskAllTextInputs,_ref$maskAllImages,maskAllImages,_ref$maskAllSandboxed,maskAllSandboxedViews,_ref$maskPhotoLibrary,maskPhotoLibraryImages,_ref$captureLog,captureLog,_ref$captureNetworkTe,captureNetworkTelemetry,_ref$iOSdebouncerDela,iOSdebouncerDelayMs,_ref$androidDebouncer,androidDebouncerDelayMs,sdkReplayConfig,sessionReplay,featureFlags,decideFeatureFlags,decideReplayConfig,recordingActive,linkedFlag,value,flag,variant,_value,sessionId,sdkOptions;return _regenerator["default"].wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:this._enableSessionReplay=options===null||options===void 0?void 0:options.enableSessionReplay;if(this._isEnableSessionReplay()){_context4.next=4;break;}this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay is not enabled.');});return _context4.abrupt("return");case 4:_ref=(_a=options===null||options===void 0?void 0:options.sessionReplayConfig)!==null&&_a!==void 0?_a:{},_ref$maskAllTextInput=_ref.maskAllTextInputs,maskAllTextInputs=_ref$maskAllTextInput===void 0?true:_ref$maskAllTextInput,_ref$maskAllImages=_ref.maskAllImages,maskAllImages=_ref$maskAllImages===void 0?true:_ref$maskAllImages,_ref$maskAllSandboxed=_ref.maskAllSandboxedViews,maskAllSandboxedViews=_ref$maskAllSandboxed===void 0?true:_ref$maskAllSandboxed,_ref$maskPhotoLibrary=_ref.maskPhotoLibraryImages,maskPhotoLibraryImages=_ref$maskPhotoLibrary===void 0?false:_ref$maskPhotoLibrary,_ref$captureLog=_ref.captureLog,captureLog=_ref$captureLog===void 0?true:_ref$captureLog,_ref$captureNetworkTe=_ref.captureNetworkTelemetry,captureNetworkTelemetry=_ref$captureNetworkTe===void 0?true:_ref$captureNetworkTe,_ref$iOSdebouncerDela=_ref.iOSdebouncerDelayMs,iOSdebouncerDelayMs=_ref$iOSdebouncerDela===void 0?1000:_ref$iOSdebouncerDela,_ref$androidDebouncer=_ref.androidDebouncerDelayMs,androidDebouncerDelayMs=_ref$androidDebouncer===void 0?1000:_ref$androidDebouncer;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.getPersistedProperty(_src.PostHogPersistedProperty.FeatureFlags))!==null&&_c!==void 0?_c:{};decideFeatureFlags=(_d=featureFlags)!==null&&_d!==void 0?_d:{};decideReplayConfig=(_e=sessionReplay)!==null&&_e!==void 0?_e:{};this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay decide cached config: ".concat(JSON.stringify(decideReplayConfig)));});recordingActive=true;linkedFlag=decideReplayConfig['linkedFlag'];if(typeof linkedFlag==='string'){value=decideFeatureFlags[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=decideFeatureFlags[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{recordingActive=false;}}if(!recordingActive){_context4.next=45;break;}if(!_OptionalSessionReplay.OptionalReactNativeSessionReplay){_context4.next=42;break;}sessionId=this.getSessionId();if(!(sessionId.length===0)){_context4.next=21;break;}this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but no sessionId found.');});return _context4.abrupt("return");case 21: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)));});_context4.prev=23;_context4.next=26;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.isEnabled();case 26:if(_context4.sent){_context4.next=32;break;}_context4.next=29;return _OptionalSessionReplay.OptionalReactNativeSessionReplay.start(sessionId,sdkOptions,sdkReplayConfig,decideReplayConfig);case 29:this.logMsgIfDebug(function(){return console.info('PostHog Debug',"Session replay started with sessionId ".concat(sessionId,"."));});_context4.next=34;break;case 32:this._resetSessionId(_OptionalSessionReplay.OptionalReactNativeSessionReplay,sessionId);this.logMsgIfDebug(function(){return console.log('PostHog Debug',"Session replay already started with sessionId ".concat(sessionId,"."));});case 34:this._currentSessionId=sessionId;_context4.next=40;break;case 37:_context4.prev=37;_context4.t0=_context4["catch"](23);this.logMsgIfDebug(function(){return console.error('PostHog Debug',"Session replay failed to start: ".concat(_context4.t0,"."));});case 40:_context4.next=43;break;case 42:this.logMsgIfDebug(function(){return console.warn('PostHog Debug','Session replay enabled but not installed.');});case 43:_context4.next=46;break;case 45:this.logMsgIfDebug(function(){return console.info('PostHog Debug','Session replay disabled.');});case 46:case"end":return _context4.stop();}},_callee4,this,[[23,37]]);}));function startSessionReplay(_x6){return _startSessionReplay.apply(this,arguments);}return startSessionReplay;}()},{key:"captureNativeAppLifecycleEvents",value:function(){var _captureNativeAppLifecycleEvents=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee5(){var _this3=this;var _a,appBuild,appVersion,isMemoryPersistence,properties,prevAppBuild,prevAppVersion,initialUrl;return _regenerator["default"].wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:appBuild=this._appProperties.$app_build;appVersion=this._appProperties.$app_version;isMemoryPersistence=this._persistence==='memory';properties={version:appVersion,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({previous_version:prevAppVersion,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.');});}_context5.next=7;return _reactNative.Linking.getInitialURL();case 7:_context5.t1=_a=_context5.sent;_context5.t0=_context5.t1!==null;if(!_context5.t0){_context5.next=11;break;}_context5.t0=_a!==void 0;case 11:if(!_context5.t0){_context5.next=15;break;}_context5.t2=_a;_context5.next=16;break;case 15:_context5.t2=undefined;case 16:initialUrl=_context5.t2;this.capture('Application Opened',_objectSpread(_objectSpread({},properties),{},{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 _context5.stop();}},_callee5,this);}));function captureNativeAppLifecycleEvents(){return _captureNativeAppLifecycleEvents.apply(this,arguments);}return captureNativeAppLifecycleEvents;}()},{key:"persistAppVersion",value:function(){var _persistAppVersion=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee6(){var appBuild,appVersion;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;this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppBuild,appBuild);this.setPersistedProperty(_src.PostHogPersistedProperty.InstalledAppVersion,appVersion);case 4:case"end":return _context6.stop();}},_callee6,this);}));function persistAppVersion(){return _persistAppVersion.apply(this,arguments);}return persistAppVersion;}()}]);}(_src.PostHogCore);
|
|
@@ -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,GACzB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAO9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAA;AA8CnF,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAOtC,YAAY,MAAc,EAAE,OAAwB;;QAClD,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QALhB,mBAAc,GAA+B,EAAE,CAAA;QAMrD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAA;QAC3B,IAAI,CAAC,YAAY,GAA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AAC,CAAA;aACzC;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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SurveyAppearance } from '../../../posthog-core/src/surveys-types';
|
|
3
|
+
import { PostHog } from '../posthog-rn';
|
|
4
|
+
export type PostHogSurveyProviderProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The default appearance for surveys when not specified in PostHog.
|
|
7
|
+
*/
|
|
8
|
+
defaultSurveyAppearance?: SurveyAppearance;
|
|
9
|
+
/**
|
|
10
|
+
* If true, PosHog appearance will be ignored and defaultSurveyAppearance is always used.
|
|
11
|
+
*/
|
|
12
|
+
overrideAppearanceWithDefault?: boolean;
|
|
13
|
+
client?: PostHog;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export declare function PostHogSurveyProvider(props: PostHogSurveyProviderProps): JSX.Element;
|