@rpcbase/client 0.250.0 → 0.252.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
+ posthog.init(import.meta.env.RB_PUBLIC_POSTHOG_KEY, {
20
+ api_host: "/ingest",
21
+ // request_
22
+ ui_host: "https://eu.posthog.com",
23
+ person_profiles: "always",
24
+ session_recording: {
25
+ maskAllInputs: false
26
+ },
27
+ capture_pageview: isProduction,
28
+ autocapture: isProduction,
29
+ disable_session_recording: !isProduction,
30
+ })
31
+ } else {
32
+ console.warn("missing POSTHOG_KEY")
33
+ }
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.252.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "scripts": {