Skip to content

Commit 2d525d2

Browse files
author
FalkWolsky
committed
Enabling Posthog on localhost and app.lowcoder.cloud
1 parent 6981d58 commit 2d525d2

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"chalk": "4",
8181
"flag-icons": "^7.2.1",
8282
"number-precision": "^1.6.0",
83+
"posthog-js": "^1.144.1",
8384
"react-countup": "^6.5.3",
8485
"react-player": "^2.11.0",
8586
"resize-observer-polyfill": "^1.5.1",

client/packages/lowcoder/src/app.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { SystemWarning } from "./components/SystemWarning";
5353
import { getBrandingConfig } from "./redux/selectors/configSelectors";
5454
import { buildMaterialPreviewURL } from "./util/materialUtils";
5555
import GlobalInstances from 'components/GlobalInstances';
56+
import posthog from 'posthog-js'
5657

5758
const LazyUserAuthComp = React.lazy(() => import("pages/userAuth"));
5859
const LazyInviteLanding = React.lazy(() => import("pages/common/inviteLanding"));
@@ -105,6 +106,9 @@ class AppIndex extends React.Component<AppIndexProps, any> {
105106

106107
// we check if we are on the public cloud
107108
const isLowCoderDomain = window.location.hostname === 'app.lowcoder.cloud';
109+
const isLocalhost = window.location.hostname === 'localhost';
110+
111+
isLocalhost || isLowCoderDomain && posthog.init('phc_lD36OXeppUehLgI33YFhioTpXqThZ5QqR8IWeKvXP7f', { api_host: 'https://eu.i.posthog.com', person_profiles: 'always' });
108112

109113
// make sure all users in this app have checked login info
110114
if (!this.props.isFetchUserFinished) {

client/yarn.lock

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10298,6 +10298,13 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1029810298
languageName: node
1029910299
linkType: hard
1030010300

10301+
"fflate@npm:^0.4.8":
10302+
version: 0.4.8
10303+
resolution: "fflate@npm:0.4.8"
10304+
checksum: 29d8cbe44d5e7f53e7f5a160ac7f9cc025480c7b3bfd85c5f898cbe20dfa2dad4732daa534982664bf30b35896a90af44ea33ede5d94c5ffd1b8b0c0a0a56ca2
10305+
languageName: node
10306+
linkType: hard
10307+
1030110308
"file-entry-cache@npm:^6.0.1":
1030210309
version: 6.0.1
1030310310
resolution: "file-entry-cache@npm:6.0.1"
@@ -13726,6 +13733,7 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1372613733
lowcoder-cli: "workspace:^"
1372713734
mq-polyfill: ^1.1.8
1372813735
number-precision: ^1.6.0
13736+
posthog-js: ^1.144.1
1372913737
prettier: ^3.1.0
1373013738
react-countup: ^6.5.3
1373113739
react-player: ^2.11.0
@@ -16028,6 +16036,24 @@ coolshapes-react@lowcoder-org/coolshapes-react:
1602816036
languageName: node
1602916037
linkType: hard
1603016038

16039+
"posthog-js@npm:^1.144.1":
16040+
version: 1.144.1
16041+
resolution: "posthog-js@npm:1.144.1"
16042+
dependencies:
16043+
fflate: ^0.4.8
16044+
preact: ^10.19.3
16045+
web-vitals: ^4.0.1
16046+
checksum: ecbd0c9f2bff18ebf866aa5c0f133e0726d8095fe0a6dea6956626670efca8f87824c05057e2de50a2600479beeba13422e95588f7fb0ec6a57f2eb64203c329
16047+
languageName: node
16048+
linkType: hard
16049+
16050+
"preact@npm:^10.19.3":
16051+
version: 10.22.1
16052+
resolution: "preact@npm:10.22.1"
16053+
checksum: 8762645766b1c057eaf9a58ff904b6659ffa7a7d33eb94dc2b96ff1ba08743855c3ade913dfbe9e8da994777aa9f4f5e9f23d39886340f23eaebcd98f5e107e5
16054+
languageName: node
16055+
linkType: hard
16056+
1603116057
"preact@npm:~10.12.1":
1603216058
version: 10.12.1
1603316059
resolution: "preact@npm:10.12.1"
@@ -21081,6 +21107,13 @@ coolshapes-react@lowcoder-org/coolshapes-react:
2108121107
languageName: node
2108221108
linkType: hard
2108321109

21110+
"web-vitals@npm:^4.0.1":
21111+
version: 4.2.1
21112+
resolution: "web-vitals@npm:4.2.1"
21113+
checksum: 556989af90814c6a88eaeea57f778414b26e39d8857173a03e240f62e9cf732090acc97fba38f34f760bde086fef5ee90969920ff1ab3a185518176723589cb8
21114+
languageName: node
21115+
linkType: hard
21116+
2108421117
"web-worker@npm:^1.2.0":
2108521118
version: 1.3.0
2108621119
resolution: "web-worker@npm:1.3.0"

0 commit comments

Comments
 (0)