Skip to content

Commit

Permalink
send application platform in envelope
Browse files Browse the repository at this point in the history
  • Loading branch information
alaamegahed committed Jan 9, 2025
1 parent 66587aa commit 2756307
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "0.7.60",
"version": "0.7.61",
"npmClient": "yarn",
"useWorkspaces": true
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "clarity",
"private": true,
"version": "0.7.60",
"version": "0.7.61",
"repository": "https://github.com/microsoft/clarity.git",
"author": "Sarvesh Nagpal <[email protected]>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions packages/clarity-decode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clarity-decode",
"version": "0.7.60",
"version": "0.7.61",
"description": "An analytics library that uses web page interactions to generate aggregated insights",
"author": "Microsoft Corp.",
"license": "MIT",
Expand All @@ -26,7 +26,7 @@
"url": "https://github.com/Microsoft/clarity/issues"
},
"dependencies": {
"clarity-js": "^0.7.60"
"clarity-js": "^0.7.61"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/clarity-decode/src/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export function envelope(tokens: Data.Token[]): Data.Envelope {
pageNum: tokens[7] as number,
upload: tokens[8] as Data.Upload,
end: tokens[9] as Data.BooleanFlag,
url: tokens[10] as string
applicationPlatform: tokens[10] as Data.ApplicationPlatform,
url: tokens[11] as string
};
}
8 changes: 4 additions & 4 deletions packages/clarity-devtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clarity-devtools",
"version": "0.7.60",
"version": "0.7.61",
"private": true,
"description": "Adds Clarity debugging support to browser devtools",
"author": "Microsoft Corp.",
Expand All @@ -24,9 +24,9 @@
"url": "https://github.com/Microsoft/clarity/issues"
},
"dependencies": {
"clarity-decode": "^0.7.60",
"clarity-js": "^0.7.60",
"clarity-visualize": "^0.7.60"
"clarity-decode": "^0.7.61",
"clarity-js": "^0.7.61",
"clarity-visualize": "^0.7.61"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/clarity-devtools/static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"manifest_version": 2,
"name": "Microsoft Clarity Developer Tools",
"description": "Clarity helps you understand how users are interacting with your website.",
"version": "0.7.60",
"version_name": "0.7.60",
"version": "0.7.61",
"version_name": "0.7.61",
"minimum_chrome_version": "50",
"devtools_page": "devtools.html",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion packages/clarity-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clarity-js",
"version": "0.7.60",
"version": "0.7.61",
"description": "An analytics library that uses web page interactions to generate aggregated insights",
"author": "Microsoft Corp.",
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion packages/clarity-js/src/data/envelope.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BooleanFlag, Token, Upload, Envelope } from "@clarity-types/data";
import { BooleanFlag, Token, Upload, Envelope, ApplicationPlatform } from "@clarity-types/data";
import { time } from "@src/core/time";
import version from "@src/core/version";
import * as metadata from "@src/data/metadata";
Expand All @@ -19,6 +19,7 @@ export function start(): void {
pageNum: m.pageNum,
upload: Upload.Async,
end: BooleanFlag.False,
applicationPlatform: ApplicationPlatform.WebApp,
url: ''
};
}
Expand All @@ -33,6 +34,7 @@ export function envelope(last: boolean): Token[] {
data.sequence++;
data.upload = last && "sendBeacon" in navigator ? Upload.Beacon : Upload.Async;
data.end = last ? BooleanFlag.True : BooleanFlag.False;
data.applicationPlatform = ApplicationPlatform.WebApp;
data.url = scrub.url(location.href, false, true);
return [
data.version,
Expand All @@ -45,6 +47,7 @@ export function envelope(last: boolean): Token[] {
data.pageNum,
data.upload,
data.end,
data.applicationPlatform,
data.url
];
}
8 changes: 8 additions & 0 deletions packages/clarity-js/types/data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ export const enum Upload {
Beacon = 1
}

export const enum ApplicationPlatform {
WebApp = 0,
AndroidApp = 1,
IOSApp = 2
}

export const enum BooleanFlag {
False = 0,
True = 1
Expand Down Expand Up @@ -346,6 +352,7 @@ export const enum XMLReadyState {
Done = 4
}


/* Helper Interfaces */

export interface Payload {
Expand Down Expand Up @@ -390,6 +397,7 @@ export interface Envelope extends Metadata {
version: string;
upload: Upload;
end: BooleanFlag;
applicationPlatform: ApplicationPlatform;
url: string;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/clarity-visualize/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clarity-visualize",
"version": "0.7.60",
"version": "0.7.61",
"description": "An analytics library that uses web page interactions to generate aggregated insights",
"author": "Microsoft Corp.",
"license": "MIT",
Expand Down

0 comments on commit 2756307

Please sign in to comment.