react-marketing-tools 0.2.8 → 0.3.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/dist/{lib/buildConfig → buildConfig}/index.d.ts +4 -4
- package/dist/index.d.ts +26 -5
- package/dist/react-marketing-tools.es.js +2535 -2532
- package/dist/react-marketing-tools.umd.js +8 -8
- package/dist/types.d.ts +104 -0
- package/package.json +3 -2
- package/dist/lib/buildConfig/types.d.ts +0 -28
- package/dist/lib/index.d.ts +0 -25
- package/dist/lib/types.d.ts +0 -14
- /package/dist/{lib/analytics → analytics}/analyticsEventService.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/ga4GoogleAnalyticsEventTracking.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/handleDataLayerPush.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/helpers.d.ts +0 -0
- /package/dist/{lib/analytics → analytics}/types.d.ts +0 -0
- /package/dist/{lib/ipInfo → ipInfo}/index.d.ts +0 -0
- /package/dist/{lib/ipInfo → ipInfo}/types.d.ts +0 -0
- /package/dist/{lib/utilities → utilities}/assertValueCheckers.d.ts +0 -0
- /package/dist/{lib/utilities → utilities}/commonFunctions.d.ts +0 -0
- /package/dist/{lib/utilities → utilities}/cookies.d.ts +0 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export declare type Event = {
|
|
2
|
+
name: string;
|
|
3
|
+
params: Record<AllowedTypes, AllowedTypes>;
|
|
4
|
+
};
|
|
5
|
+
export declare type GooglePayload = {
|
|
6
|
+
non_personalized_ads: boolean;
|
|
7
|
+
client_id: string;
|
|
8
|
+
user_id: string;
|
|
9
|
+
user_properties: {
|
|
10
|
+
user_id: string;
|
|
11
|
+
user_type: string;
|
|
12
|
+
client_id: string;
|
|
13
|
+
};
|
|
14
|
+
events: Event[];
|
|
15
|
+
};
|
|
16
|
+
export declare type EventNameInfo = {
|
|
17
|
+
eventName: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
actionPrefix: string;
|
|
20
|
+
globalAppEvent: string;
|
|
21
|
+
previousGlobalAppEvent?: string;
|
|
22
|
+
};
|
|
23
|
+
export declare type AllowedTypes = string | number;
|
|
24
|
+
export declare type TrackAnalyticsEventOptions = {
|
|
25
|
+
data: Record<AllowedTypes, AllowedTypes>;
|
|
26
|
+
eventNameInfo: EventNameInfo;
|
|
27
|
+
analyticsType: string;
|
|
28
|
+
userDataToHashKeyArray: Array<string> | null;
|
|
29
|
+
dataLayerCheck: boolean;
|
|
30
|
+
consoleLogData?: object;
|
|
31
|
+
};
|
|
32
|
+
export declare type GlobalVars = {
|
|
33
|
+
app: string;
|
|
34
|
+
device_category?: string | undefined;
|
|
35
|
+
device_os?: string | undefined;
|
|
36
|
+
device_browser?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
export declare type DataLayer = {
|
|
39
|
+
event: string;
|
|
40
|
+
globalVars: GlobalVars;
|
|
41
|
+
journeyProps: Record<any, any>;
|
|
42
|
+
userProps: Record<any, any>;
|
|
43
|
+
};
|
|
44
|
+
export declare type ConsoleLogData = {
|
|
45
|
+
showGlobalVars?: boolean;
|
|
46
|
+
showJourneyPropsPayload?: boolean;
|
|
47
|
+
showUserProps?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export interface AnalyticsTrackerDataOptions {
|
|
50
|
+
consoleLogData: ConsoleLogData | null;
|
|
51
|
+
data: Record<any, any>;
|
|
52
|
+
eventName: string;
|
|
53
|
+
globalAppEvent: string;
|
|
54
|
+
userDetails: Record<any, any>;
|
|
55
|
+
}
|
|
56
|
+
export interface HandleDataLayerPushOptions extends AnalyticsTrackerDataOptions {
|
|
57
|
+
dataLayerCheck: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare type Ga4GoogleAnalyticsEventTracking = AnalyticsTrackerDataOptions;
|
|
60
|
+
export declare type Platform = 'GOOGLE' | 'FACEBOOK' | 'DATALAYER_PUSH';
|
|
61
|
+
export declare type AnalyticsPlatform = {
|
|
62
|
+
[key in Platform]: Platform;
|
|
63
|
+
};
|
|
64
|
+
export declare type Tokens = {
|
|
65
|
+
IP_INFO_TOKEN?: string;
|
|
66
|
+
GA4_PUBLIC_API_SECRET?: string;
|
|
67
|
+
GA4_PUBLIC_MEASUREMENT_ID?: string;
|
|
68
|
+
};
|
|
69
|
+
export declare type Config = {
|
|
70
|
+
TOKENS?: Tokens;
|
|
71
|
+
appName: string;
|
|
72
|
+
appSessionCookieName: string;
|
|
73
|
+
withDeviceInfo?: boolean;
|
|
74
|
+
includeUserKeys: Array<string>;
|
|
75
|
+
showMissingUserAttributesInConsole: boolean | undefined;
|
|
76
|
+
withServerLocationInfo: boolean | undefined;
|
|
77
|
+
eventActionPrefixList: Record<string, string>;
|
|
78
|
+
analyticsGlobalEventActionList: Record<string, string>;
|
|
79
|
+
};
|
|
80
|
+
export declare type BuildConfigOptions = {
|
|
81
|
+
appName: string;
|
|
82
|
+
appSessionCookieName: string;
|
|
83
|
+
eventActionPrefix?: Record<string, string>;
|
|
84
|
+
globalEventActionList?: Record<string, string>;
|
|
85
|
+
includeUserKeys?: Array<string> | undefined;
|
|
86
|
+
showMissingUserAttributesInConsole?: boolean;
|
|
87
|
+
TOKENS?: Tokens;
|
|
88
|
+
withDeviceInfo?: boolean;
|
|
89
|
+
withServerLocationInfo?: boolean;
|
|
90
|
+
};
|
|
91
|
+
export declare let config: Config;
|
|
92
|
+
export declare type ProviderStateProps = {
|
|
93
|
+
appName: string;
|
|
94
|
+
appSessionCookieName: string;
|
|
95
|
+
analyticsPlatform: AnalyticsPlatform;
|
|
96
|
+
eventActionPrefixList: Record<string, string>;
|
|
97
|
+
analyticsGlobalEventActionList: Record<string, string>;
|
|
98
|
+
};
|
|
99
|
+
export declare type ProviderApiProps = {
|
|
100
|
+
trackAnalyticsEvent: (options: TrackAnalyticsEventOptions) => Promise<void>;
|
|
101
|
+
showMeBuildInAnalyticsPlatform: () => void;
|
|
102
|
+
showMeBuildInEventActionPrefixList: () => void;
|
|
103
|
+
showMeBuildInGlobalEventActionList: () => void;
|
|
104
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-marketing-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React Marketing Tools are a set of tools to make it easier for you to implement analytics and track user journeys, interactions throughout your App. using dataLayer/Google Tag Manager, GA4 fetch directly or coming soon facebook pixel.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "bronz3beard <exempli.gratia.webdesign@gmail.com> (https://www.heyrory.com/)",
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"build": "tsc && vite build",
|
|
44
44
|
"build:watch": "tsc && vite build --watch",
|
|
45
45
|
"preview": "vite preview",
|
|
46
|
-
"mock:publish": "npm pack --dry-run"
|
|
46
|
+
"mock:publish": "npm pack --dry-run",
|
|
47
|
+
"check-types": "tsc --noEmit --pretty"
|
|
47
48
|
},
|
|
48
49
|
"browserslist": {
|
|
49
50
|
"production": [
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare type Platform = Record<string, string>;
|
|
2
|
-
export declare type Tokens = {
|
|
3
|
-
IP_INFO_TOKEN?: string;
|
|
4
|
-
GA4_PUBLIC_API_SECRET?: string;
|
|
5
|
-
GA4_PUBLIC_MEASUREMENT_ID?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare type Config = {
|
|
8
|
-
TOKENS?: Tokens;
|
|
9
|
-
appName: string;
|
|
10
|
-
appSessionCookieName: string;
|
|
11
|
-
withDeviceInfo?: boolean;
|
|
12
|
-
includeUserKeys: Array<string>;
|
|
13
|
-
showMissingUserAttributesInConsole: boolean | undefined;
|
|
14
|
-
withServerLocationInfo: boolean | undefined;
|
|
15
|
-
eventActionPrefixList: Record<string, string>;
|
|
16
|
-
analyticsGlobalEventActionList: Record<string, string>;
|
|
17
|
-
};
|
|
18
|
-
export declare type BuildConfigOptions = {
|
|
19
|
-
appName: string;
|
|
20
|
-
appSessionCookieName: string;
|
|
21
|
-
eventActionPrefix: Record<string, string>;
|
|
22
|
-
globalEventActionList: Record<string, string>;
|
|
23
|
-
includeUserKeys: Array<string>;
|
|
24
|
-
showMissingUserAttributesInConsole: boolean | undefined;
|
|
25
|
-
TOKENS?: Tokens;
|
|
26
|
-
withDeviceInfo: boolean | undefined;
|
|
27
|
-
withServerLocationInfo: boolean | undefined;
|
|
28
|
-
};
|
package/dist/lib/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ReactNode, Context } from 'react';
|
|
2
|
-
import { ProviderApiProps, ProviderStateProps } from './types';
|
|
3
|
-
export { buildConfig, analyticsPlatform } from './buildConfig';
|
|
4
|
-
export { trackAnalyticsEvent } from './analytics/analyticsEventService';
|
|
5
|
-
export declare const ContextState: Context<ProviderStateProps>;
|
|
6
|
-
export declare const ContextApi: Context<ProviderApiProps>;
|
|
7
|
-
declare type ReactMarketingProviderProps = {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export declare const ReactMarketingProvider: ({ children, }: ReactMarketingProviderProps) => JSX.Element;
|
|
11
|
-
/**
|
|
12
|
-
* @property {string} appName
|
|
13
|
-
* @property {string} appSessionCookieName
|
|
14
|
-
* @property {object} analyticsPlatform
|
|
15
|
-
* @property {object} eventActionPrefixList
|
|
16
|
-
* @property {object} analyticsGlobalEventActionList
|
|
17
|
-
*/
|
|
18
|
-
export declare const useMarketingState: () => ProviderStateProps;
|
|
19
|
-
/**
|
|
20
|
-
* @property {function} trackAnalyticsEvent(options)
|
|
21
|
-
* @property {function} showMeBuildInAnalyticsPlatform
|
|
22
|
-
* @property {function} showMeBuildInEventActionPrefixList
|
|
23
|
-
* @property {function} showMeBuildInGlobalEventActionList
|
|
24
|
-
*/
|
|
25
|
-
export declare const useMarketingApi: () => ProviderApiProps;
|
package/dist/lib/types.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Platform, TrackAnalyticsEventOptions } from '..';
|
|
2
|
-
export declare type ProviderStateProps = {
|
|
3
|
-
appName: string;
|
|
4
|
-
appSessionCookieName: string;
|
|
5
|
-
analyticsPlatform: Platform;
|
|
6
|
-
eventActionPrefixList: Record<string, string>;
|
|
7
|
-
analyticsGlobalEventActionList: Record<string, string>;
|
|
8
|
-
};
|
|
9
|
-
export declare type ProviderApiProps = {
|
|
10
|
-
trackAnalyticsEvent: (options: TrackAnalyticsEventOptions) => Promise<void>;
|
|
11
|
-
showMeBuildInAnalyticsPlatform: () => void;
|
|
12
|
-
showMeBuildInEventActionPrefixList: () => void;
|
|
13
|
-
showMeBuildInGlobalEventActionList: () => void;
|
|
14
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|