Skip to content

Commit

Permalink
Changed posthog to eu (#772)
Browse files Browse the repository at this point in the history
* Updated posthog url and key

* Create clean-plums-happen.md

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
  • Loading branch information
D-K-P and matt-aitken authored Jan 3, 2024
1 parent 86d6e10 commit aa97bf4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-plums-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli": patch
---

Updated the telemetry API key
2 changes: 1 addition & 1 deletion apps/webapp/app/hooks/usePostHog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const usePostHog = (apiKey?: string, logging = false, debug = false): voi
if (postHogInitialized.current === true) return;
if (logging) console.log("Initializing PostHog");
posthog.init(apiKey, {
api_host: "https://app.posthog.com",
api_host: "https://eu.posthog.com",
opt_in_site_apps: true,
debug,
loaded: function (posthog) {
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/services/telemetry.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Telemetry {

constructor({ postHogApiKey, trigger }: Options) {
if (postHogApiKey) {
this.#posthogClient = new PostHog(postHogApiKey, { host: "https://app.posthog.com" });
this.#posthogClient = new PostHog(postHogApiKey, { host: "https://eu.posthog.com" });
} else {
console.log("No PostHog API key, so analytics won't track");
}
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
"nanoid": "^3.3.4",
"ohash": "^1.1.3",
"postcss-import": "^14.1.0",
"posthog-js": "^1.83.0",
"posthog-node": "^3.1.1",
"posthog-js": "^1.93.3",
"posthog-node": "^3.1.3",
"prism-react-renderer": "^1.3.5",
"prismjs": "^1.29.0",
"random-words": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/telemetry/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getVersion } from "../utils/getVersion";
import { DevCommandOptions } from "../commands/dev";
import { ProjectInstallOptions } from "../frameworks";

const postHogApiKey = "phc_hwYmedO564b3Ik8nhA4Csrb5SueY0EwFJWCbseGwWW";
const postHogApiKey = "phc_9aSDbJCaDUMdZdHxxMPTvcj7A9fsl3mCgM1RBPmPsl7";

export class TelemetryClient {
#client: PostHog;
Expand All @@ -14,7 +14,7 @@ export class TelemetryClient {

constructor() {
this.#client = new PostHog(postHogApiKey, {
host: "https://app.posthog.com",
host: "https://eu.posthog.com",
flushAt: 1,
});
this.#sessionId = `cli-${nanoid()}`;
Expand Down
42 changes: 31 additions & 11 deletions pnpm-lock.yaml

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

0 comments on commit aa97bf4

Please sign in to comment.