Skip to content

Commit

Permalink
chore: adding network information (#17524)
Browse files Browse the repository at this point in the history
* chore: adding network information

* fix: revert linting issue

* Update index.ts
  • Loading branch information
agrim-deriv authored Nov 15, 2024
1 parent 048e867 commit 32e16c3
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 29 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
},
"dependencies": {
"@babel/preset-typescript": "^7.24.7",
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@sendbird/chat": "^4.9.7",
"@types/react-transition-group": "^4.4.4",
"babel-jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@binary-com/binary-document-uploader": "^2.4.8",
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/translations": "1.3.9",
"@deriv-com/utils": "^0.0.36",
"@deriv-com/ui": "1.36.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv/api-types": "1.0.172",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^7.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/appstore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"author": "Deriv",
"license": "Apache-2.0",
"dependencies": {
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/translations": "1.3.9",
"@deriv-com/ui": "1.36.4",
"@deriv/account": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cashier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"url": "https://github.com/deriv-com/deriv-app/issues"
},
"dependencies": {
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/ui": "1.36.4",
"@deriv/api": "^1.0.0",
"@deriv/api-types": "1.0.172",
Expand Down
2 changes: 1 addition & 1 deletion packages/cfd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
},
"dependencies": {
"@deriv-com/ui": "1.36.4",
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/translations": "1.3.9",
"@deriv-com/utils": "^0.0.36",
"@deriv/account": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
},
"dependencies": {
"@datadog/browser-rum": "^5.11.0",
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/quill-tokens": "2.0.4",
"@deriv-com/quill-ui": "1.21.0",
"@deriv-com/translations": "1.3.9",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/Utils/Analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export const AnalyticsInitializer = async () => {
utm_content: ppc_campaign_cookies?.utm_content,
domain: window.location.hostname,
url: window.location.href,
network_type: navigator.connection?.effectiveType,
network_rtt: navigator.connection?.rtt,
network_downlink: navigator.connection?.downlink,
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"sideEffects": false,
"dependencies": {
"@binary-com/binary-document-uploader": "^2.4.8",
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv/api": "^1.0.0",
"@deriv-com/auth-client": "1.0.29",
"@deriv/stores": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/p2p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"license": "ISC",
"dependencies": {
"@deriv-com/ui": "1.36.4",
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/utils": "^0.0.36",
"@deriv/api": "^1.0.0",
"@deriv/api-types": "1.0.172",
Expand Down
2 changes: 1 addition & 1 deletion packages/reports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
},
"dependencies": {
"@deriv-com/ui": "1.36.4",
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv/components": "^1.0.0",
"@deriv/deriv-api": "^1.0.15",
"@deriv/api-types": "1.0.172",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"typescript": "^4.6.3"
},
"dependencies": {
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv/quill-icons": "1.23.3",
"@deriv/api-types": "1.0.172",
"@deriv/translations": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/trader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"webpack-node-externals": "^2.5.2"
},
"dependencies": {
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/quill-tokens": "2.0.4",
"@deriv-com/quill-ui": "1.21.0",
"@deriv-com/utils": "^0.0.36",
Expand Down
2 changes: 1 addition & 1 deletion packages/wallets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"start": "rimraf dist && npm run test && npm run serve"
},
"dependencies": {
"@deriv-com/analytics": "1.26.1",
"@deriv-com/analytics": "1.26.2",
"@deriv-com/translations": "1.3.9",
"@deriv-com/ui": "1.36.4",
"@deriv-com/utils": "^0.0.36",
Expand Down
10 changes: 10 additions & 0 deletions types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,22 @@ declare global {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Analytics: any;
GrowthbookFeatures: { [key: string]: boolean };
navigator: Navigator;
}

interface FreshChatConfig {
token: string | null;
locale?: string;
hideButton?: boolean;
}
interface Navigator {
connection?: NetworkInformation;
}
interface NetworkInformation {
effectiveType?: 'slow-2g' | '2g' | '3g' | '4g';
rtt?: number;
downlink?: number;
}
}

export {};

0 comments on commit 32e16c3

Please sign in to comment.