@shware/analytics 3.5.0 → 3.5.2

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/index.cjs CHANGED
@@ -30,6 +30,7 @@ __export(index_exports, {
30
30
  createVisitorSchema: () => import_schema.createVisitorSchema,
31
31
  getLink: () => import_link.getLink,
32
32
  getVisitor: () => import_visitor.getVisitor,
33
+ sendBeacon: () => import_track.sendBeacon,
33
34
  sendFeedback: () => import_feedback.sendFeedback,
34
35
  setVisitor: () => import_visitor.setVisitor,
35
36
  setupAnalytics: () => import_setup.setupAnalytics,
@@ -60,6 +61,7 @@ var import_use_track_impression = require("./hooks/use-track-impression.cjs");
60
61
  createVisitorSchema,
61
62
  getLink,
62
63
  getVisitor,
64
+ sendBeacon,
63
65
  sendFeedback,
64
66
  setVisitor,
65
67
  setupAnalytics,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n ALL_PLATFORMS,\n ALL_ENVIRONMENTS,\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\nexport { useTrackImpression } from './hooks/use-track-impression';\n\nexport type {\n Platform,\n Environment,\n TrackTags,\n TrackProperties,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAkC;AAClC,qBAAuC;AACvC,sBAA6B;AAC7B,kBAA+C;AAC/C,oBAWO;AACP,oBAAiC;AACjC,kCAAmC;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync, sendBeacon } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n ALL_PLATFORMS,\n ALL_ENVIRONMENTS,\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\nexport { useTrackImpression } from './hooks/use-track-impression';\n\nexport type {\n Platform,\n Environment,\n TrackTags,\n TrackProperties,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAA8C;AAC9C,qBAAuC;AACvC,sBAA6B;AAC7B,kBAA+C;AAC/C,oBAWO;AACP,oBAAiC;AACjC,kCAAmC;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { setupAnalytics } from './setup/index.cjs';
2
- export { track, trackAsync } from './track/index.cjs';
2
+ export { sendBeacon, track, trackAsync } from './track/index.cjs';
3
3
  export { getVisitor, setVisitor } from './visitor/index.cjs';
4
4
  export { sendFeedback } from './feedback/index.cjs';
5
5
  export { Link, createLink, getLink } from './link/index.cjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { setupAnalytics } from './setup/index.js';
2
- export { track, trackAsync } from './track/index.js';
2
+ export { sendBeacon, track, trackAsync } from './track/index.js';
3
3
  export { getVisitor, setVisitor } from './visitor/index.js';
4
4
  export { sendFeedback } from './feedback/index.js';
5
5
  export { Link, createLink, getLink } from './link/index.js';
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/index.ts
2
2
  import { setupAnalytics } from "./setup/index.mjs";
3
- import { track, trackAsync } from "./track/index.mjs";
3
+ import { track, trackAsync, sendBeacon } from "./track/index.mjs";
4
4
  import { getVisitor, setVisitor } from "./visitor/index.mjs";
5
5
  import { sendFeedback } from "./feedback/index.mjs";
6
6
  import { createLink, getLink } from "./link/index.mjs";
@@ -27,6 +27,7 @@ export {
27
27
  createVisitorSchema,
28
28
  getLink,
29
29
  getVisitor,
30
+ sendBeacon,
30
31
  sendFeedback,
31
32
  setVisitor,
32
33
  setupAnalytics,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n ALL_PLATFORMS,\n ALL_ENVIRONMENTS,\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\nexport { useTrackImpression } from './hooks/use-track-impression';\n\nexport type {\n Platform,\n Environment,\n TrackTags,\n TrackProperties,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,OAAO,kBAAkB;AAClC,SAAS,YAAY,kBAAkB;AACvC,SAAS,oBAAoB;AAC7B,SAAS,YAAY,eAA0B;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { setupAnalytics } from './setup/index';\nexport { track, trackAsync, sendBeacon } from './track/index';\nexport { getVisitor, setVisitor } from './visitor/index';\nexport { sendFeedback } from './feedback/index';\nexport { createLink, getLink, type Link } from './link/index';\nexport {\n ALL_PLATFORMS,\n ALL_ENVIRONMENTS,\n createTrackEventSchemaV1,\n createTrackEventSchema,\n createVisitorSchema,\n updateVisitorSchema,\n createFeedbackSchema,\n createLinkSchema,\n type CreateFeedbackDTO,\n type CreateLinkDTO,\n} from './schema/index';\nexport { stripeMinorUnits } from './utils/stripe';\nexport { useTrackImpression } from './hooks/use-track-impression';\n\nexport type {\n Platform,\n Environment,\n TrackTags,\n TrackProperties,\n AllowedPropertyValues,\n UserProvidedData,\n} from './track/types';\nexport type { VisitorProperties } from './visitor/types';\n"],"mappings":";AAAA,SAAS,sBAAsB;AAC/B,SAAS,OAAO,YAAY,kBAAkB;AAC9C,SAAS,YAAY,kBAAkB;AACvC,SAAS,oBAAoB;AAC7B,SAAS,YAAY,eAA0B;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;","names":[]}
@@ -301,42 +301,15 @@ declare const createFeedbackSchema: z.ZodMiniObject<{
301
301
  * @see https://support.google.com/analytics/answer/10917952
302
302
  * */
303
303
  declare const createLinkSchema: z.ZodMiniObject<{
304
- /** The URL that the user is redirected to. */
305
304
  url: z.ZodMiniURL;
306
- /**
307
- * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4
308
- * data import. Use the same IDs that you use when uploading campaign cost data.
309
- */
310
305
  utm_id: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
311
- /** Referrer, for example: google, newsletter4, billboard */
312
306
  utm_source: z.ZodMiniString<string>;
313
- /** Marketing medium, for example: cpc, banner, email */
314
307
  utm_medium: z.ZodMiniString<string>;
315
- /** Product, slogan, promo code, for example: spring_sale */
316
308
  utm_campaign: z.ZodMiniString<string>;
317
- /** Paid keyword */
318
309
  utm_term: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
319
- /**
320
- * Use to differentiate creatives. For example, if you have two call-to-action links within the
321
- * same email message, you can use utm_content and set different values for each so you can tell
322
- * which version is more effective.
323
- */
324
310
  utm_content: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
325
- /**
326
- * The platform responsible for directing traffic to a given Analytics property (such as a buying
327
- * platform that sets budgets and targeting criteria or a platform that manages organic traffic
328
- * data). For example: Search Ads 360 or Display & Video 360.
329
- */
330
311
  utm_source_platform: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
331
- /**
332
- * Type of creative, for example: display, native, video, search, utm_creative_format is not
333
- * currently reported in Google Analytics 4 properties.
334
- */
335
312
  utm_creative_format: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
336
- /**
337
- * Targeting criteria applied to a campaign, for example: remarketing, prospecting,
338
- * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.
339
- * */
340
313
  utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
341
314
  }, z.core.$strip>;
342
315
  type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;
@@ -301,42 +301,15 @@ declare const createFeedbackSchema: z.ZodMiniObject<{
301
301
  * @see https://support.google.com/analytics/answer/10917952
302
302
  * */
303
303
  declare const createLinkSchema: z.ZodMiniObject<{
304
- /** The URL that the user is redirected to. */
305
304
  url: z.ZodMiniURL;
306
- /**
307
- * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4
308
- * data import. Use the same IDs that you use when uploading campaign cost data.
309
- */
310
305
  utm_id: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
311
- /** Referrer, for example: google, newsletter4, billboard */
312
306
  utm_source: z.ZodMiniString<string>;
313
- /** Marketing medium, for example: cpc, banner, email */
314
307
  utm_medium: z.ZodMiniString<string>;
315
- /** Product, slogan, promo code, for example: spring_sale */
316
308
  utm_campaign: z.ZodMiniString<string>;
317
- /** Paid keyword */
318
309
  utm_term: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
319
- /**
320
- * Use to differentiate creatives. For example, if you have two call-to-action links within the
321
- * same email message, you can use utm_content and set different values for each so you can tell
322
- * which version is more effective.
323
- */
324
310
  utm_content: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
325
- /**
326
- * The platform responsible for directing traffic to a given Analytics property (such as a buying
327
- * platform that sets budgets and targeting criteria or a platform that manages organic traffic
328
- * data). For example: Search Ads 360 or Display & Video 360.
329
- */
330
311
  utm_source_platform: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
331
- /**
332
- * Type of creative, for example: display, native, video, search, utm_creative_format is not
333
- * currently reported in Google Analytics 4 properties.
334
- */
335
312
  utm_creative_format: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
336
- /**
337
- * Targeting criteria applied to a campaign, for example: remarketing, prospecting,
338
- * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.
339
- * */
340
313
  utm_marketing_tactic: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<string | undefined, string>>>;
341
314
  }, z.core.$strip>;
342
315
  type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shware/analytics",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,34 +70,34 @@
70
70
  "dependencies": {
71
71
  "bowser": "^2.14.1",
72
72
  "cookie": "^1.1.1",
73
- "uuid": "^13.0.0",
73
+ "uuid": "^14.0.0",
74
74
  "web-vitals": "^5.2.0",
75
- "zod": "^4.3.6",
76
- "@shware/utils": "^1.3.0"
75
+ "zod": "^4.4.3",
76
+ "@shware/utils": "^1.4.3"
77
77
  },
78
78
  "devDependencies": {
79
- "@types/facebook-nodejs-business-sdk": "^23",
79
+ "@types/facebook-nodejs-business-sdk": "^24",
80
80
  "@types/node": "^25",
81
81
  "@types/react": "^19",
82
- "typescript": "^6.0.2",
83
- "vitest": "^4.1.2",
82
+ "typescript": "^6.0.3",
83
+ "vitest": "^4.1.7",
84
84
  "@repo/typescript-config": "0.0.0"
85
85
  },
86
86
  "peerDependencies": {
87
- "@react-native-firebase/analytics": "^23.8.8",
88
- "@tanstack/react-router": "^1.168.7",
89
- "expo-application": "^55.0.10",
90
- "expo-clipboard": "^55.0.9",
91
- "expo-crypto": "^55.0.10",
92
- "expo-device": "^55.0.10",
93
- "expo-localization": "^55.0.9",
94
- "expo-sqlite": "^55.0.11",
95
- "expo-tracking-transparency": "^55.0.9",
87
+ "@react-native-firebase/analytics": "^24.0.0",
88
+ "@tanstack/react-router": "^1.170.8",
89
+ "expo-application": "^56.0.3",
90
+ "expo-clipboard": "^56.0.3",
91
+ "expo-crypto": "^56.0.4",
92
+ "expo-device": "^56.0.4",
93
+ "expo-localization": "^56.0.6",
94
+ "expo-sqlite": "^56.0.4",
95
+ "expo-tracking-transparency": "^56.0.5",
96
96
  "facebook-nodejs-business-sdk": "^24",
97
97
  "next": "^16",
98
- "posthog-js": "^1.364.1",
98
+ "posthog-js": "^1.376.2",
99
99
  "react": "^19",
100
- "react-native": "^0.83.0",
100
+ "react-native": "^0.85.3",
101
101
  "react-native-fbsdk-next": "^13.4.3",
102
102
  "react-native-url-polyfill": "^3",
103
103
  "react-router": "^7"