@rpcbase/client 0.250.0 → 0.251.0

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.
Files changed (2) hide show
  1. package/instrument.ts +22 -12
  2. package/package.json +1 -1
package/instrument.ts CHANGED
@@ -14,15 +14,25 @@ if (isProduction) {
14
14
  }
15
15
 
16
16
 
17
- posthog.init(import.meta.env.RB_PUBLIC_POSTHOG_KEY, {
18
- api_host: "/ingest",
19
- // request_
20
- ui_host: "https://eu.posthog.com",
21
- person_profiles: "always",
22
- session_recording: {
23
- maskAllInputs: false
24
- },
25
- capture_pageview: isProduction,
26
- autocapture: isProduction,
27
- disable_session_recording: !isProduction,
28
- })
17
+ if (isProduction) {
18
+ if (!import.meta.env.RB_PUBLIC_POSTHOG_KEY) {
19
+ console.warn("missing POSTHOG_KEY")
20
+ return
21
+ }
22
+
23
+ posthog.init(import.meta.env.RB_PUBLIC_POSTHOG_KEY, {
24
+ api_host: "/ingest",
25
+ // request_
26
+ ui_host: "https://eu.posthog.com",
27
+ person_profiles: "always",
28
+ session_recording: {
29
+ maskAllInputs: false
30
+ },
31
+ capture_pageview: isProduction,
32
+ autocapture: isProduction,
33
+ disable_session_recording: !isProduction,
34
+ })
35
+
36
+ } else {
37
+ console.info("ℹ️ Not initializing posthog in development")
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.250.0",
3
+ "version": "0.251.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "scripts": {