@amplitude/plugin-engagement-react-native 1.0.0-beta.5 → 1.0.0-beta.6

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.
Files changed (16) hide show
  1. package/PluginEngagementReactNative.podspec +1 -1
  2. package/android/build.gradle +1 -1
  3. package/lib/module/build-version.json +1 -1
  4. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/AmplitudeEngagement.d.ts +17 -0
  5. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/AmplitudeEngagement.d.ts.map +1 -0
  6. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/AmplitudeEngagementPlugin.d.ts +20 -0
  7. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/AmplitudeEngagementPlugin.d.ts.map +1 -0
  8. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/NativePluginEngagementReactNative.d.ts +29 -0
  9. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/NativePluginEngagementReactNative.d.ts.map +1 -0
  10. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/index.d.ts +14 -0
  11. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/index.d.ts.map +1 -0
  12. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/logger.d.ts +28 -0
  13. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/logger.d.ts.map +1 -0
  14. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/types.d.ts +20 -0
  15. package/lib/typescript/__npmjs__@amplitude_plugin-engagement-react-native/package/src/types.d.ts.map +1 -0
  16. package/package.json +1 -1
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
17
  s.private_header_files = "ios/**/*.h"
18
18
 
19
- s.dependency "AmplitudeEngagementSwift", "1.0.11"
19
+ s.dependency "AmplitudeEngagementSwift", "1.0.13"
20
20
 
21
21
  install_modules_dependencies(s)
22
22
  end
@@ -76,7 +76,7 @@ dependencies {
76
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
77
 
78
78
  // Amplitude Engagement SDK
79
- implementation "com.amplitude:amplitude-engagement-android:1.0.22"
79
+ implementation "com.amplitude:amplitude-engagement-android:1.0.24"
80
80
 
81
81
  // Amplitude Analytics SDK (required dependency)
82
82
  implementation "com.amplitude:analytics-android:1.+"
@@ -1 +1 @@
1
- {"version":"1.0.0-beta.5"}
1
+ {"version":"1.0.0-beta.6"}
@@ -0,0 +1,17 @@
1
+ import type { GuideOrSurvey, ThemeMode } from './types';
2
+ import type { BaseEvent } from '@amplitude/analytics-core';
3
+ export declare class AmplitudeEngagement {
4
+ id: number;
5
+ constructor(apiKey: string);
6
+ boot(user_id?: string, device_id?: string): void;
7
+ setThemeMode(themeMode: ThemeMode): void;
8
+ reset(key: string, stepIndex: number): void;
9
+ list(): GuideOrSurvey[];
10
+ show(key: string, stepIndex: number): void;
11
+ screen(screenName: string): void;
12
+ closeAll(): void;
13
+ forwardEvent(event: BaseEvent): void;
14
+ addCallback(key: string, func: () => void): () => void;
15
+ handleURL(url: string): boolean;
16
+ }
17
+ //# sourceMappingURL=AmplitudeEngagement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AmplitudeEngagement.d.ts","sourceRoot":"","sources":["../../../../../__npmjs__@amplitude_plugin-engagement-react-native/package/src/AmplitudeEngagement.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAW3D,qBAAa,mBAAmB;IAC9B,EAAE,EAAE,MAAM,CAAC;gBAEC,MAAM,EAAE,MAAM;IAK1B,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAIhD,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAIxC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAI3C,IAAI,IAAI,aAAa,EAAE;IAIvB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAI1C,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIhC,QAAQ,IAAI,IAAI;IAIhB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIpC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IActD,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAGhC"}
@@ -0,0 +1,20 @@
1
+ import type { EnrichmentPlugin, Event, AnalyticsClient, AmplitudeContext } from '@amplitude/analytics-core';
2
+ import { type AmplitudeLogger } from './logger';
3
+ import type { EventSubscription } from 'react-native';
4
+ export declare class AmplitudeEngagementPlugin implements EnrichmentPlugin<AnalyticsClient, AmplitudeContext> {
5
+ name: string;
6
+ type: "enrichment";
7
+ client?: AnalyticsClient;
8
+ userId?: string;
9
+ deviceId?: string;
10
+ sessionId?: number;
11
+ userProperties?: Record<string, any>;
12
+ logger: AmplitudeLogger;
13
+ private static readonly SDK_LIBRARY;
14
+ private static readonly SDK_VERSION;
15
+ trackEventSubscription: EventSubscription | null;
16
+ setup(config: AmplitudeContext, client: AnalyticsClient): Promise<void>;
17
+ boot(user_id?: string, device_id?: string): void;
18
+ execute(context: Event): Promise<Event | null>;
19
+ }
20
+ //# sourceMappingURL=AmplitudeEngagementPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AmplitudeEngagementPlugin.d.ts","sourceRoot":"","sources":["../../../../../__npmjs__@amplitude_plugin-engagement-react-native/package/src/AmplitudeEngagementPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,eAAe,EACf,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAU,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD,qBAAa,yBAA0B,YAAW,gBAAgB,CAAC,eAAe,EAAE,gBAAgB,CAAC;IACnG,IAAI,SAA+B;IACnC,IAAI,EAAG,YAAY,CAAU;IAE7B,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAErC,MAAM,EAAE,eAAe,CAA2C;IAGlE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAuC;IAC1E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAW;IAE9C,sBAAsB,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAElD,KAAK,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB7E,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAuB1C,OAAO,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAmBrD"}
@@ -0,0 +1,29 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import type { GuideOrSurvey } from './types';
3
+ import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
4
+ export type AnalyticsEvent = {
5
+ event_type: string;
6
+ event_properties: Object;
7
+ };
8
+ export type CallbackInvocation = {
9
+ id: number;
10
+ key: string;
11
+ };
12
+ export interface Spec extends TurboModule {
13
+ newInstance(apiKey: string): number;
14
+ boot(id: number, user_id?: string, device_id?: string): void;
15
+ setThemeMode(id: number, themeMode: string): void;
16
+ reset(id: number, key: string, stepIndex: number): void;
17
+ list(id: number): GuideOrSurvey[];
18
+ show(id: number, key: string, stepIndex: number): void;
19
+ screen(id: number, screenName: string): void;
20
+ closeAll(id: number): void;
21
+ forwardEvent(id: number, event: Object): void;
22
+ addCallback(id: number, key: string): void;
23
+ handleURL(id: number, url: string): boolean;
24
+ readonly onTrackEvent: EventEmitter<AnalyticsEvent>;
25
+ readonly onInvokeCallback: EventEmitter<CallbackInvocation>;
26
+ }
27
+ declare const _default: Spec;
28
+ export default _default;
29
+ //# sourceMappingURL=NativePluginEngagementReactNative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativePluginEngagementReactNative.d.ts","sourceRoot":"","sources":["../../../../../__npmjs__@amplitude_plugin-engagement-react-native/package/src/NativePluginEngagementReactNative.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAE9E,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7D,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAmB,IAAI,CAAC;IAClE,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAExD,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,EAAE,CAAC;IAElC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAmB,IAAI,CAAC;IAC9D,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3C,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE5C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IACpD,QAAQ,CAAC,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;CAC7D;;AAED,wBAEE"}
@@ -0,0 +1,14 @@
1
+ import { AmplitudeEngagementPlugin } from './AmplitudeEngagementPlugin';
2
+ import type { GuideOrSurvey } from './types';
3
+ import type { BaseEvent } from '@amplitude/analytics-core';
4
+ export declare function init(apiKey: string): void;
5
+ export declare function boot(user_id?: string, device_id?: string): Promise<void>;
6
+ export declare function list(): Promise<GuideOrSurvey[]>;
7
+ export declare function show(key: string, stepIndex: number): Promise<void>;
8
+ export declare function screen(screenName: string): Promise<void>;
9
+ export declare function closeAll(): Promise<void>;
10
+ export declare function forwardEvent(event: BaseEvent): Promise<void>;
11
+ export declare function addCallback(key: string, func: () => void): () => void;
12
+ export declare function handleURL(url: string): Promise<boolean>;
13
+ export declare function getPlugin(): AmplitudeEngagementPlugin;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../__npmjs__@amplitude_plugin-engagement-react-native/package/src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAiB3D,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAUzC;AAED,wBAAsB,IAAI,CACxB,OAAO,CAAC,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,wBAAsB,IAAI,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAGrD;AAED,wBAAsB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxE;AAED,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG9D;AAED,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAG9C;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAQrE;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG7D;AAGD,wBAAgB,SAAS,IAAI,yBAAyB,CAMrD"}
@@ -0,0 +1,28 @@
1
+ export declare enum AmplitudeLogLevel {
2
+ verbose = 0,
3
+ debug = 1,
4
+ warn = 2,
5
+ error = 3,
6
+ none = 4
7
+ }
8
+ export interface AmplitudeLogger {
9
+ disable(): void;
10
+ enable(logLevel: AmplitudeLogLevel): void;
11
+ log(...args: any[]): void;
12
+ warn(...args: any[]): void;
13
+ error(...args: any[]): void;
14
+ debug(...args: any[]): void;
15
+ }
16
+ export declare class Logger implements AmplitudeLogger {
17
+ private prefix;
18
+ private currentLogLevel;
19
+ constructor(name?: string);
20
+ disable(): void;
21
+ enable(logLevel: AmplitudeLogLevel): void;
22
+ log(...args: any[]): void;
23
+ warn(...args: any[]): void;
24
+ error(...args: any[]): void;
25
+ debug(...args: any[]): void;
26
+ private format;
27
+ }
28
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../../../__npmjs__@amplitude_plugin-engagement-react-native/package/src/logger.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,OAAO,IAAI;IACX,KAAK,IAAI;IACT,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,IAAI;CACT;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC1C,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;CAC7B;AAED,qBAAa,MAAO,YAAW,eAAe;IAC5C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,eAAe,CAA8C;gBAEzD,IAAI,GAAE,MAAmC;IAIrD,OAAO,IAAI,IAAI;IAIf,MAAM,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAIzC,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAMzB,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM1B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM3B,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAM3B,OAAO,CAAC,MAAM;CAcf"}
@@ -0,0 +1,20 @@
1
+ export type GuideOrSurvey = {
2
+ id: number;
3
+ step: number;
4
+ title: string;
5
+ };
6
+ export type ThemeMode = 'auto' | 'dark_mode' | 'light_mode';
7
+ export type AmplitudeEndUser = {
8
+ user_id?: string;
9
+ device_id?: string;
10
+ user_properties: {
11
+ [key: string]: any;
12
+ };
13
+ };
14
+ export type AmplitudeBootOptions = {
15
+ user: AmplitudeEndUser;
16
+ integrations: ((eventType: string, eventProperties: {
17
+ [key: string]: any;
18
+ }) => void)[];
19
+ };
20
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../__npmjs__@amplitude_plugin-engagement-react-native/package/src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,YAAY,CAAC;AAE5D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,YAAY,EAAE,CAAC,CACb,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KACpC,IAAI,CAAC,EAAE,CAAC;CACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/plugin-engagement-react-native",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.0-beta.6",
4
4
  "description": "Amplitude Engagement plugin for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",