@appcues/segment-react-native 3.1.1 → 3.1.3
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.
|
@@ -26,20 +26,14 @@ class AppcuesPlugin extends _analyticsReactNative.DestinationPlugin {
|
|
|
26
26
|
if (appcuesSettings === undefined) {
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId
|
|
29
|
+
Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {
|
|
30
|
+
additionalAutoProperties: {
|
|
31
|
+
_segmentVersion: require('@segment/analytics-react-native/package.json').version
|
|
32
|
+
}
|
|
33
|
+
}).then(() => {
|
|
30
34
|
this.isInitialized = true;
|
|
31
35
|
});
|
|
32
|
-
|
|
33
|
-
// TODO: once the 3.0.0 react native plugin is released, apply the additionalAutoProperties
|
|
34
|
-
// here to denote in the data which usage is from this segment plugin
|
|
35
|
-
//
|
|
36
|
-
// Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {
|
|
37
|
-
// additionalAutoProperties: {
|
|
38
|
-
// _segmentVersion: require('@segment/analytics-react-native/package.json').version
|
|
39
|
-
// }
|
|
40
|
-
// }).then(() => { this.isInitialized = true; });
|
|
41
36
|
}
|
|
42
|
-
|
|
43
37
|
identify(event) {
|
|
44
38
|
if (this.isInitialized && event.userId != null) {
|
|
45
39
|
Appcues.identify(event.userId, event.traits);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_analyticsReactNative","require","Appcues","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","AppcuesPlugin","DestinationPlugin","constructor","arguments","PluginType","destination","update","settings","_","isInitialized","appcuesSettings","integrations","setup","accountId","applicationId","then","identify","event","userId","traits","track","properties","screen","name","group","groupId","reset","exports"],"sources":["AppcuesPlugin.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"names":["_analyticsReactNative","require","Appcues","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","AppcuesPlugin","DestinationPlugin","constructor","arguments","PluginType","destination","update","settings","_","isInitialized","appcuesSettings","integrations","setup","accountId","applicationId","additionalAutoProperties","_segmentVersion","version","then","identify","event","userId","traits","track","properties","screen","name","group","groupId","reset","exports"],"sources":["AppcuesPlugin.ts"],"sourcesContent":["import {\n DestinationPlugin,\n PluginType,\n TrackEventType,\n ScreenEventType,\n SegmentAPISettings,\n UpdateType,\n IdentifyEventType,\n GroupEventType,\n} from '@segment/analytics-react-native';\nimport type { SegmentAppcuesSettings } from './types';\nimport * as Appcues from '@appcues/react-native';\n\nexport class AppcuesPlugin extends DestinationPlugin {\n type = PluginType.destination;\n key = 'Appcues Mobile';\n\n private isInitialized: boolean = false;\n\n async update(settings: SegmentAPISettings, _: UpdateType) {\n if (this.isInitialized) {\n return;\n }\n\n const appcuesSettings = settings.integrations[\n this.key\n ] as SegmentAppcuesSettings;\n\n if (appcuesSettings === undefined) {\n return;\n }\n\n Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {\n additionalAutoProperties: {\n _segmentVersion: require('@segment/analytics-react-native/package.json')\n .version,\n },\n }).then(() => {\n this.isInitialized = true;\n });\n }\n\n identify(event: IdentifyEventType) {\n if (this.isInitialized && event.userId != null) {\n Appcues.identify(event.userId, event.traits);\n }\n return event;\n }\n\n track(event: TrackEventType) {\n if (this.isInitialized) {\n Appcues.track(event.event, event.properties);\n }\n return event;\n }\n\n screen(event: ScreenEventType) {\n if (this.isInitialized) {\n Appcues.screen(event.name, event.properties);\n }\n return event;\n }\n\n group(event: GroupEventType) {\n if (this.isInitialized) {\n Appcues.group(event.groupId, event.traits);\n }\n return event;\n }\n\n reset(): void {\n if (this.isInitialized) {\n Appcues.reset();\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAWA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAiD,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU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d;EAEAS,KAAKA,CAAA,EAAS;IACZ,IAAI,IAAI,CAACpB,aAAa,EAAE;MACtBnD,OAAO,CAACuE,KAAK,CAAC,CAAC;IACjB;EACF;AACF;AAACC,OAAA,CAAA9B,aAAA,GAAAA,aAAA"}
|
|
@@ -18,20 +18,14 @@ export class AppcuesPlugin extends DestinationPlugin {
|
|
|
18
18
|
if (appcuesSettings === undefined) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId
|
|
21
|
+
Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {
|
|
22
|
+
additionalAutoProperties: {
|
|
23
|
+
_segmentVersion: require('@segment/analytics-react-native/package.json').version
|
|
24
|
+
}
|
|
25
|
+
}).then(() => {
|
|
22
26
|
this.isInitialized = true;
|
|
23
27
|
});
|
|
24
|
-
|
|
25
|
-
// TODO: once the 3.0.0 react native plugin is released, apply the additionalAutoProperties
|
|
26
|
-
// here to denote in the data which usage is from this segment plugin
|
|
27
|
-
//
|
|
28
|
-
// Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {
|
|
29
|
-
// additionalAutoProperties: {
|
|
30
|
-
// _segmentVersion: require('@segment/analytics-react-native/package.json').version
|
|
31
|
-
// }
|
|
32
|
-
// }).then(() => { this.isInitialized = true; });
|
|
33
28
|
}
|
|
34
|
-
|
|
35
29
|
identify(event) {
|
|
36
30
|
if (this.isInitialized && event.userId != null) {
|
|
37
31
|
Appcues.identify(event.userId, event.traits);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DestinationPlugin","PluginType","Appcues","AppcuesPlugin","constructor","arguments","_defineProperty","destination","update","settings","_","isInitialized","appcuesSettings","integrations","key","undefined","setup","accountId","applicationId","then","identify","event","userId","traits","track","properties","screen","name","group","groupId","reset"],"sources":["AppcuesPlugin.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"names":["DestinationPlugin","PluginType","Appcues","AppcuesPlugin","constructor","arguments","_defineProperty","destination","update","settings","_","isInitialized","appcuesSettings","integrations","key","undefined","setup","accountId","applicationId","additionalAutoProperties","_segmentVersion","require","version","then","identify","event","userId","traits","track","properties","screen","name","group","groupId","reset"],"sources":["AppcuesPlugin.ts"],"sourcesContent":["import {\n DestinationPlugin,\n PluginType,\n TrackEventType,\n ScreenEventType,\n SegmentAPISettings,\n UpdateType,\n IdentifyEventType,\n GroupEventType,\n} from '@segment/analytics-react-native';\nimport type { SegmentAppcuesSettings } from './types';\nimport * as Appcues from '@appcues/react-native';\n\nexport class AppcuesPlugin extends DestinationPlugin {\n type = PluginType.destination;\n key = 'Appcues Mobile';\n\n private isInitialized: boolean = false;\n\n async update(settings: SegmentAPISettings, _: UpdateType) {\n if (this.isInitialized) {\n return;\n }\n\n const appcuesSettings = settings.integrations[\n this.key\n ] as SegmentAppcuesSettings;\n\n if (appcuesSettings === undefined) {\n return;\n }\n\n Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {\n additionalAutoProperties: {\n _segmentVersion: require('@segment/analytics-react-native/package.json')\n .version,\n },\n }).then(() => {\n this.isInitialized = true;\n });\n }\n\n identify(event: IdentifyEventType) {\n if (this.isInitialized && event.userId != null) {\n Appcues.identify(event.userId, event.traits);\n }\n return event;\n }\n\n track(event: TrackEventType) {\n if (this.isInitialized) {\n Appcues.track(event.event, event.properties);\n }\n return event;\n }\n\n screen(event: ScreenEventType) {\n if (this.isInitialized) {\n Appcues.screen(event.name, event.properties);\n }\n return event;\n }\n\n group(event: GroupEventType) {\n if (this.isInitialized) {\n Appcues.group(event.groupId, event.traits);\n }\n return event;\n }\n\n reset(): void {\n if (this.isInitialized) {\n Appcues.reset();\n }\n }\n}\n"],"mappings":";;;AAAA,SACEA,iBAAiB,EACjBC,UAAU,QAOL,iCAAiC;AAExC,OAAO,KAAKC,OAAO,MAAM,uBAAuB;AAEhD,OAAO,MAAMC,aAAa,SAASH,iBAAiB,CAAC;EAAAI,YAAA;IAAA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;IAC3B,IAAI,IAAI,CAACd,aAAa,EAAE;MACtBT,OAAO,CAAC8B,KAAK,CAACP,KAAK,CAACQ,OAAO,EAAER,KAAK,CAACE,MAAM,CAAC;IAC5C;IACA,OAAOF,KAAK;EACd;EAEAS,KAAKA,CAAA,EAAS;IACZ,IAAI,IAAI,CAACvB,aAAa,EAAE;MACtBT,OAAO,CAACgC,KAAK,CAAC,CAAC;IACjB;EACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcues/segment-react-native",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "Segment destination plugin for Appcues.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@segment/analytics-react-native": "*",
|
|
45
|
-
"@appcues/react-native": "^3.1.
|
|
45
|
+
"@appcues/react-native": "^3.1.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/core": "^7.12.10",
|
package/src/AppcuesPlugin.ts
CHANGED
|
@@ -1,79 +1,76 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export class AppcuesPlugin extends DestinationPlugin {
|
|
15
|
-
type = PluginType.destination;
|
|
16
|
-
key = 'Appcues Mobile';
|
|
2
|
+
DestinationPlugin,
|
|
3
|
+
PluginType,
|
|
4
|
+
TrackEventType,
|
|
5
|
+
ScreenEventType,
|
|
6
|
+
SegmentAPISettings,
|
|
7
|
+
UpdateType,
|
|
8
|
+
IdentifyEventType,
|
|
9
|
+
GroupEventType,
|
|
10
|
+
} from '@segment/analytics-react-native';
|
|
11
|
+
import type { SegmentAppcuesSettings } from './types';
|
|
12
|
+
import * as Appcues from '@appcues/react-native';
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (this.isInitialized) {
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const appcuesSettings = settings.integrations[
|
|
26
|
-
this.key
|
|
27
|
-
] as SegmentAppcuesSettings;
|
|
28
|
-
|
|
29
|
-
if (appcuesSettings === undefined) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
14
|
+
export class AppcuesPlugin extends DestinationPlugin {
|
|
15
|
+
type = PluginType.destination;
|
|
16
|
+
key = 'Appcues Mobile';
|
|
32
17
|
|
|
33
|
-
|
|
34
|
-
.then(() => { this.isInitialized = true; });
|
|
18
|
+
private isInitialized: boolean = false;
|
|
35
19
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {
|
|
40
|
-
// additionalAutoProperties: {
|
|
41
|
-
// _segmentVersion: require('@segment/analytics-react-native/package.json').version
|
|
42
|
-
// }
|
|
43
|
-
// }).then(() => { this.isInitialized = true; });
|
|
20
|
+
async update(settings: SegmentAPISettings, _: UpdateType) {
|
|
21
|
+
if (this.isInitialized) {
|
|
22
|
+
return;
|
|
44
23
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
|
|
25
|
+
const appcuesSettings = settings.integrations[
|
|
26
|
+
this.key
|
|
27
|
+
] as SegmentAppcuesSettings;
|
|
28
|
+
|
|
29
|
+
if (appcuesSettings === undefined) {
|
|
30
|
+
return;
|
|
51
31
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
32
|
+
|
|
33
|
+
Appcues.setup(appcuesSettings.accountId, appcuesSettings.applicationId, {
|
|
34
|
+
additionalAutoProperties: {
|
|
35
|
+
_segmentVersion: require('@segment/analytics-react-native/package.json')
|
|
36
|
+
.version,
|
|
37
|
+
},
|
|
38
|
+
}).then(() => {
|
|
39
|
+
this.isInitialized = true;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
identify(event: IdentifyEventType) {
|
|
44
|
+
if (this.isInitialized && event.userId != null) {
|
|
45
|
+
Appcues.identify(event.userId, event.traits);
|
|
58
46
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
return event;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
track(event: TrackEventType) {
|
|
51
|
+
if (this.isInitialized) {
|
|
52
|
+
Appcues.track(event.event, event.properties);
|
|
65
53
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
return event;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
screen(event: ScreenEventType) {
|
|
58
|
+
if (this.isInitialized) {
|
|
59
|
+
Appcues.screen(event.name, event.properties);
|
|
60
|
+
}
|
|
61
|
+
return event;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
group(event: GroupEventType) {
|
|
65
|
+
if (this.isInitialized) {
|
|
66
|
+
Appcues.group(event.groupId, event.traits);
|
|
72
67
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
return event;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
reset(): void {
|
|
72
|
+
if (this.isInitialized) {
|
|
73
|
+
Appcues.reset();
|
|
78
74
|
}
|
|
75
|
+
}
|
|
79
76
|
}
|