@entrolytics/shared 2.2.1 → 2.3.1
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 +10 -6
- package/dist/index.cjs +630 -533
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +611 -607
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +611 -607
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +629 -532
- package/dist/index.js.map +1 -1
- package/package.json +24 -19
package/README.md
CHANGED
|
@@ -6,9 +6,13 @@ Shared utilities and constants for Entrolytics packages.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm install @entrolytics/shared
|
|
9
|
+
|
|
9
10
|
# or
|
|
11
|
+
|
|
10
12
|
pnpm add @entrolytics/shared
|
|
13
|
+
|
|
11
14
|
# or
|
|
15
|
+
|
|
12
16
|
yarn add @entrolytics/shared
|
|
13
17
|
```
|
|
14
18
|
|
|
@@ -19,20 +23,20 @@ import {
|
|
|
19
23
|
EVENT_TYPES,
|
|
20
24
|
DEFAULT_CONFIG,
|
|
21
25
|
validateWebsiteId,
|
|
22
|
-
formatAnalyticsQuery
|
|
23
|
-
} from
|
|
26
|
+
formatAnalyticsQuery,
|
|
27
|
+
} from "@entrolytics/shared";
|
|
24
28
|
|
|
25
29
|
// Use constants
|
|
26
30
|
console.log(EVENT_TYPES.PAGEVIEW); // 'pageview'
|
|
27
31
|
|
|
28
32
|
// Validate data
|
|
29
|
-
const isValid = validateWebsiteId(
|
|
33
|
+
const isValid = validateWebsiteId("abc123"); // true
|
|
30
34
|
|
|
31
35
|
// Format queries
|
|
32
36
|
const query = formatAnalyticsQuery({
|
|
33
|
-
websiteId:
|
|
34
|
-
startDate:
|
|
35
|
-
endDate:
|
|
37
|
+
websiteId: "abc123",
|
|
38
|
+
startDate: "2025-01-01",
|
|
39
|
+
endDate: "2025-01-31",
|
|
36
40
|
});
|
|
37
41
|
```
|
|
38
42
|
|