@aacigroup/aaci_shared 2.4.0 → 2.6.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/README.md +191 -14
- package/dist/TrackingContext.d.ts +19 -0
- package/dist/TrackingContext.d.ts.map +1 -0
- package/dist/TrackingContext.js +58 -0
- package/dist/TrackingContext.js.map +1 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +9 -0
- package/dist/react.js.map +1 -0
- package/package.json +21 -3
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm install @aacigroup/aaci_shared
|
|
|
15
15
|
```javascript
|
|
16
16
|
import { LeadTracker } from '@aacigroup/aaci_shared';
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const tracker = new LeadTracker({
|
|
19
19
|
apiUrl: 'https://your-api.com/leads',
|
|
20
20
|
apiKey: 'your-api-key',
|
|
21
21
|
projectName: 'MyProject',
|
|
@@ -23,27 +23,172 @@ const leadTracker = new LeadTracker({
|
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
// Track lead only
|
|
26
|
-
await
|
|
27
|
-
lead_type: '
|
|
26
|
+
await tracker.trackLeadAndAddress({
|
|
27
|
+
lead_type: 'contact',
|
|
28
28
|
email: 'user@example.com'
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
// Track address only
|
|
32
|
-
await
|
|
32
|
+
await tracker.trackLeadAndAddress(undefined, {
|
|
33
33
|
full_address: '123 Main St, New York, NY 10001',
|
|
34
34
|
source: 'address_check'
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
// Track both together
|
|
38
|
-
await
|
|
39
|
-
lead_type: '
|
|
38
|
+
await tracker.trackLeadAndAddress({
|
|
39
|
+
lead_type: 'policy_review',
|
|
40
40
|
email: 'user@example.com'
|
|
41
41
|
}, {
|
|
42
42
|
full_address: '123 Main St, New York, NY 10001',
|
|
43
|
+
source: 'policy_review'
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Lead Types
|
|
48
|
+
|
|
49
|
+
Use these values for `lead_type` and `source`:
|
|
50
|
+
- `'policy_review'` - Insurance policy review
|
|
51
|
+
- `'address_check'` - Property address verification
|
|
52
|
+
- `'contact'` - General contact forms
|
|
53
|
+
- `'signup'` - User registration
|
|
54
|
+
- `'consultation'` - Service consultation
|
|
55
|
+
- `'quote'` - Price quote requests
|
|
56
|
+
|
|
57
|
+
## Validation (Optional)
|
|
58
|
+
|
|
59
|
+
Install Zod for input validation:
|
|
60
|
+
```bash
|
|
61
|
+
npm install zod
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
import { validateTrackLeadParams, validateAddress } from '@aacigroup/aaci_shared';
|
|
66
|
+
|
|
67
|
+
// Validate before tracking
|
|
68
|
+
const validLead = validateTrackLeadParams({
|
|
69
|
+
lead_type: 'contact',
|
|
70
|
+
email: 'user@example.com'
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const validAddress = validateAddress({
|
|
74
|
+
full_address: '123 Main St',
|
|
43
75
|
source: 'contact'
|
|
44
76
|
});
|
|
77
|
+
|
|
78
|
+
await tracker.trackLeadAndAddress(validLead, validAddress);
|
|
45
79
|
```
|
|
46
80
|
|
|
81
|
+
## Other Components
|
|
82
|
+
|
|
83
|
+
### React Context (Optional)
|
|
84
|
+
|
|
85
|
+
For React projects, you can use the provided context for easier integration:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm install react # Peer dependency
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```javascript
|
|
92
|
+
// App.tsx
|
|
93
|
+
import { TrackingProvider, createTrackingConfigFromEnv } from '@aacigroup/aaci_shared/react';
|
|
94
|
+
|
|
95
|
+
// Option 1: Use environment variables (in Vite projects)
|
|
96
|
+
function App() {
|
|
97
|
+
return (
|
|
98
|
+
<TrackingProvider config={createTrackingConfigFromEnv()}>
|
|
99
|
+
<YourApp />
|
|
100
|
+
</TrackingProvider>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Option 2: Manual configuration
|
|
105
|
+
function App() {
|
|
106
|
+
const trackingConfig = {
|
|
107
|
+
apiUrl: 'https://your-api.com/leads',
|
|
108
|
+
apiKey: 'your-api-key',
|
|
109
|
+
projectName: 'MyProject',
|
|
110
|
+
posthogKey: 'phc_your_key',
|
|
111
|
+
productionDomains: ['myproject.com']
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<TrackingProvider config={trackingConfig}>
|
|
116
|
+
<YourApp />
|
|
117
|
+
</TrackingProvider>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Component.tsx - Use tracking in any component
|
|
122
|
+
import { useLeadTracker, usePostHog } from '@aacigroup/aaci_shared/react';
|
|
123
|
+
|
|
124
|
+
function ContactForm() {
|
|
125
|
+
const tracker = useLeadTracker();
|
|
126
|
+
const analytics = usePostHog();
|
|
127
|
+
|
|
128
|
+
const handleSubmit = async (formData) => {
|
|
129
|
+
// Track lead submission
|
|
130
|
+
await tracker.trackLeadAndAddress({
|
|
131
|
+
lead_type: 'contact',
|
|
132
|
+
email: formData.email
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
// Track analytics event
|
|
136
|
+
analytics.trackEvent('form_submitted', { form_type: 'contact' });
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return <form onSubmit={handleSubmit}>...</form>;
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Environment Variables (for createTrackingConfigFromEnv):**
|
|
144
|
+
```env
|
|
145
|
+
VITE_LEAD_CAPTURE_API_URL=https://your-api.com/leads
|
|
146
|
+
VITE_LEAD_CAPTURE_API_KEY=your-api-key
|
|
147
|
+
VITE_PROJECT_NAME=MyProject
|
|
148
|
+
VITE_POSTHOG_KEY=phc_your_key
|
|
149
|
+
VITE_PRODUCTION_DOMAINS=myproject.com,www.myproject.com
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### PostHog Analytics
|
|
153
|
+
```javascript
|
|
154
|
+
import { PostHog } from '@aacigroup/aaci_shared';
|
|
155
|
+
|
|
156
|
+
const analytics = new PostHog({
|
|
157
|
+
apiKey: 'phc_your_key',
|
|
158
|
+
projectName: 'MyProject',
|
|
159
|
+
productionDomains: ['myproject.com']
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
await analytics.init();
|
|
163
|
+
analytics.trackEvent('user_signup', { plan: 'premium' });
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Google Tag Manager
|
|
167
|
+
```javascript
|
|
168
|
+
import { GTM } from '@aacigroup/aaci_shared';
|
|
169
|
+
|
|
170
|
+
const gtm = new GTM({
|
|
171
|
+
productionDomains: ['myproject.com']
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
gtm.trackEvent('purchase', { value: 100, currency: 'USD' });
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## TypeScript Types
|
|
178
|
+
|
|
179
|
+
```javascript
|
|
180
|
+
import type { Lead, AddressCapture, TrackLeadParams, Address } from '@aacigroup/aaci_shared';
|
|
181
|
+
|
|
182
|
+
// Use types in your application
|
|
183
|
+
function processLead(lead: Lead): void {
|
|
184
|
+
console.log(`Processing ${lead.email}`);
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## License
|
|
189
|
+
|
|
190
|
+
ISC
|
|
191
|
+
|
|
47
192
|
## Core API Reference
|
|
48
193
|
|
|
49
194
|
### LeadTracker
|
|
@@ -305,7 +450,35 @@ console.log('Current domain:', env.getCurrentDomain());
|
|
|
305
450
|
|
|
306
451
|
## Data Types Reference
|
|
307
452
|
|
|
308
|
-
###
|
|
453
|
+
### Input Types (for tracking methods)
|
|
454
|
+
|
|
455
|
+
```typescript
|
|
456
|
+
// Lead data for tracking
|
|
457
|
+
interface TrackLeadParams {
|
|
458
|
+
lead_type: string; // Required: Type of lead
|
|
459
|
+
first_name?: string; // Optional: First name
|
|
460
|
+
last_name?: string; // Optional: Last name
|
|
461
|
+
email?: string; // Optional: Email address
|
|
462
|
+
phone?: string; // Optional: Phone number
|
|
463
|
+
extra_data?: Record<string, any>; // Optional: Additional custom data
|
|
464
|
+
session_data?: SessionData; // Optional: Session tracking data (auto-populated)
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// Address data for tracking
|
|
468
|
+
interface Address {
|
|
469
|
+
full_address: string; // Required: Complete address string
|
|
470
|
+
source: string; // Required: Lead type that generated this address
|
|
471
|
+
street_address?: string; // Optional: Street address component
|
|
472
|
+
city?: string; // Optional: City
|
|
473
|
+
state?: string; // Optional: State/Province
|
|
474
|
+
zip_code?: string; // Optional: ZIP/Postal code
|
|
475
|
+
county?: string; // Optional: County
|
|
476
|
+
country?: string; // Optional: Country
|
|
477
|
+
extra_data?: Record<string, any>; // Optional: Additional address data
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Database Types (complete records)
|
|
309
482
|
|
|
310
483
|
```typescript
|
|
311
484
|
// Complete lead record (from database)
|
|
@@ -342,15 +515,19 @@ interface AddressCapture {
|
|
|
342
515
|
created_at: string;
|
|
343
516
|
updated_at: string;
|
|
344
517
|
}
|
|
518
|
+
```
|
|
345
519
|
|
|
346
|
-
**Common `
|
|
347
|
-
- `'policy_review'` -
|
|
348
|
-
- `'address_check'` -
|
|
349
|
-
- `'contact'` -
|
|
350
|
-
- `'signup'` -
|
|
351
|
-
- `'consultation'` -
|
|
352
|
-
- `'quote'` -
|
|
520
|
+
**Common `lead_type` and `source` values:**
|
|
521
|
+
- `'policy_review'` - Insurance policy review requests
|
|
522
|
+
- `'address_check'` - Property address verification
|
|
523
|
+
- `'contact'` - General contact form submissions
|
|
524
|
+
- `'signup'` - User registration/signup
|
|
525
|
+
- `'consultation'` - Service consultation requests
|
|
526
|
+
- `'quote'` - Price quote requests
|
|
527
|
+
|
|
528
|
+
### Session Data
|
|
353
529
|
|
|
530
|
+
```typescript
|
|
354
531
|
// Session tracking data
|
|
355
532
|
interface SessionData {
|
|
356
533
|
ip?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LeadTracker, PostHog } from './index';
|
|
3
|
+
interface TrackingConfig {
|
|
4
|
+
apiUrl: string;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
projectName: string;
|
|
7
|
+
posthogKey: string;
|
|
8
|
+
productionDomains: string[];
|
|
9
|
+
}
|
|
10
|
+
export type { TrackingConfig };
|
|
11
|
+
interface TrackingProviderProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
config: TrackingConfig;
|
|
14
|
+
}
|
|
15
|
+
export declare const TrackingProvider: ({ children, config }: TrackingProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const useLeadTracker: () => LeadTracker;
|
|
17
|
+
export declare const usePostHog: () => PostHog;
|
|
18
|
+
export declare const createTrackingConfigFromEnv: () => TrackingConfig;
|
|
19
|
+
//# sourceMappingURL=TrackingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackingContext.d.ts","sourceRoot":"","sources":["../src/TrackingContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAW,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAS/C,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,GAAI,sBAAsB,qBAAqB,4CA4B3E,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,WAMjC,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,OAM7B,CAAC;AAGF,eAAO,MAAM,2BAA2B,QAAO,cAc9C,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTrackingConfigFromEnv = exports.usePostHog = exports.useLeadTracker = exports.TrackingProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const index_1 = require("./index");
|
|
7
|
+
const TrackingContext = (0, react_1.createContext)(undefined);
|
|
8
|
+
const TrackingProvider = ({ children, config }) => {
|
|
9
|
+
const trackers = (0, react_1.useMemo)(() => {
|
|
10
|
+
const leadTracker = new index_1.LeadTracker({
|
|
11
|
+
apiUrl: config.apiUrl,
|
|
12
|
+
apiKey: config.apiKey,
|
|
13
|
+
projectName: config.projectName,
|
|
14
|
+
productionDomains: config.productionDomains,
|
|
15
|
+
});
|
|
16
|
+
const posthog = new index_1.PostHog({
|
|
17
|
+
apiKey: config.posthogKey,
|
|
18
|
+
projectName: config.projectName,
|
|
19
|
+
productionDomains: config.productionDomains,
|
|
20
|
+
});
|
|
21
|
+
posthog.init();
|
|
22
|
+
return { leadTracker, posthog };
|
|
23
|
+
}, [config]);
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(TrackingContext.Provider, { value: trackers, children: children }));
|
|
25
|
+
};
|
|
26
|
+
exports.TrackingProvider = TrackingProvider;
|
|
27
|
+
const useLeadTracker = () => {
|
|
28
|
+
const context = (0, react_1.useContext)(TrackingContext);
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error('useLeadTracker must be used within TrackingProvider');
|
|
31
|
+
}
|
|
32
|
+
return context.leadTracker;
|
|
33
|
+
};
|
|
34
|
+
exports.useLeadTracker = useLeadTracker;
|
|
35
|
+
const usePostHog = () => {
|
|
36
|
+
const context = (0, react_1.useContext)(TrackingContext);
|
|
37
|
+
if (!context) {
|
|
38
|
+
throw new Error('usePostHog must be used within TrackingProvider');
|
|
39
|
+
}
|
|
40
|
+
return context.posthog;
|
|
41
|
+
};
|
|
42
|
+
exports.usePostHog = usePostHog;
|
|
43
|
+
const createTrackingConfigFromEnv = () => {
|
|
44
|
+
var _a;
|
|
45
|
+
if (typeof window !== 'undefined' && 'import' in window && 'meta' in window.import) {
|
|
46
|
+
const env = window.import.meta.env;
|
|
47
|
+
return {
|
|
48
|
+
apiUrl: env.VITE_LEAD_CAPTURE_API_URL,
|
|
49
|
+
apiKey: env.VITE_LEAD_CAPTURE_API_KEY,
|
|
50
|
+
projectName: env.VITE_PROJECT_NAME,
|
|
51
|
+
posthogKey: env.VITE_POSTHOG_KEY,
|
|
52
|
+
productionDomains: ((_a = env.VITE_PRODUCTION_DOMAINS) === null || _a === void 0 ? void 0 : _a.split(',').map((d) => d.trim()).filter(Boolean)) || [],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
throw new Error('Environment variables not available. Please provide config manually.');
|
|
56
|
+
};
|
|
57
|
+
exports.createTrackingConfigFromEnv = createTrackingConfigFromEnv;
|
|
58
|
+
//# sourceMappingURL=TrackingContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackingContext.js","sourceRoot":"","sources":["../src/TrackingContext.tsx"],"names":[],"mappings":";;;;AAAA,iCAAsE;AACtE,mCAA+C;AAO/C,MAAM,eAAe,GAAG,IAAA,qBAAa,EAAkC,SAAS,CAAC,CAAC;AAiB3E,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAyB,EAAE,EAAE;IAC9E,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAE5B,MAAM,WAAW,GAAG,IAAI,mBAAW,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;SAC5C,CAAC,CAAC;QAGH,MAAM,OAAO,GAAG,IAAI,eAAO,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,UAAU;YACzB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;SAC5C,CAAC,CAAC;QAGH,OAAO,CAAC,IAAI,EAAE,CAAC;QAEf,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,CACL,uBAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YACtC,QAAQ,GACgB,CAC5B,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,gBAAgB,oBA4B3B;AAEK,MAAM,cAAc,GAAG,GAAgB,EAAE;IAC9C,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,eAAe,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC,WAAW,CAAC;AAC7B,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB;AAEK,MAAM,UAAU,GAAG,GAAY,EAAE;IACtC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,eAAe,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC;AACzB,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAGK,MAAM,2BAA2B,GAAG,GAAmB,EAAE;;IAE9D,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,QAAQ,IAAI,MAAM,IAAI,MAAM,IAAK,MAAc,CAAC,MAAM,EAAE,CAAC;QAC5F,MAAM,GAAG,GAAI,MAAc,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;QAC5C,OAAO;YACL,MAAM,EAAE,GAAG,CAAC,yBAAyB;YACrC,MAAM,EAAE,GAAG,CAAC,yBAAyB;YACrC,WAAW,EAAE,GAAG,CAAC,iBAAiB;YAClC,UAAU,EAAE,GAAG,CAAC,gBAAgB;YAChC,iBAAiB,EAAE,CAAA,MAAA,GAAG,CAAC,uBAAuB,0CAAE,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,KAAI,EAAE;SAC9G,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;AAC1F,CAAC,CAAC;AAdW,QAAA,2BAA2B,+BActC"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,2BAA2B,EAC5B,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,cAAc,EACf,MAAM,mBAAmB,CAAC"}
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTrackingConfigFromEnv = exports.usePostHog = exports.useLeadTracker = exports.TrackingProvider = void 0;
|
|
4
|
+
var TrackingContext_1 = require("./TrackingContext");
|
|
5
|
+
Object.defineProperty(exports, "TrackingProvider", { enumerable: true, get: function () { return TrackingContext_1.TrackingProvider; } });
|
|
6
|
+
Object.defineProperty(exports, "useLeadTracker", { enumerable: true, get: function () { return TrackingContext_1.useLeadTracker; } });
|
|
7
|
+
Object.defineProperty(exports, "usePostHog", { enumerable: true, get: function () { return TrackingContext_1.usePostHog; } });
|
|
8
|
+
Object.defineProperty(exports, "createTrackingConfigFromEnv", { enumerable: true, get: function () { return TrackingContext_1.createTrackingConfigFromEnv; } });
|
|
9
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":";;;AAGA,qDAK2B;AAJzB,mHAAA,gBAAgB,OAAA;AAChB,iHAAA,cAAc,OAAA;AACd,6GAAA,UAAU,OAAA;AACV,8HAAA,2BAA2B,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aacigroup/aaci_shared",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Shared tracking utilities for AACI Group projects",
|
|
3
|
+
"version": "2.6.0",
|
|
4
|
+
"description": "Shared tracking utilities for AACI Group projects with React Context support",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
"posthog",
|
|
23
23
|
"gtm",
|
|
24
24
|
"lead-capture",
|
|
25
|
-
"error-tracking"
|
|
25
|
+
"error-tracking",
|
|
26
|
+
"react",
|
|
27
|
+
"context",
|
|
28
|
+
"hooks"
|
|
26
29
|
],
|
|
27
30
|
"author": "AACI Group",
|
|
28
31
|
"license": "ISC",
|
|
@@ -32,8 +35,18 @@
|
|
|
32
35
|
},
|
|
33
36
|
"homepage": "https://github.com/AACI-Group/aaci_shared#readme",
|
|
34
37
|
"devDependencies": {
|
|
38
|
+
"@types/react": "^19.2.0",
|
|
39
|
+
"react": "^19.2.0",
|
|
35
40
|
"typescript": "^5.9.3"
|
|
36
41
|
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": ">=16.8.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"react": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
37
50
|
"publishConfig": {
|
|
38
51
|
"access": "public",
|
|
39
52
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -48,6 +61,11 @@
|
|
|
48
61
|
"require": "./dist/index.js",
|
|
49
62
|
"types": "./dist/index.d.ts"
|
|
50
63
|
},
|
|
64
|
+
"./react": {
|
|
65
|
+
"import": "./dist/react.js",
|
|
66
|
+
"require": "./dist/react.js",
|
|
67
|
+
"types": "./dist/react.d.ts"
|
|
68
|
+
},
|
|
51
69
|
"./track/*": {
|
|
52
70
|
"import": "./dist/track/*.js",
|
|
53
71
|
"require": "./dist/track/*.js",
|