@rpcbase/client 0.362.0 → 0.363.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.
- package/dist/instrument.d.ts +1 -1
- package/dist/instrument.d.ts.map +1 -1
- package/dist/instrument.js +27 -23
- package/dist/instrument.js.map +1 -1
- package/package.json +1 -1
package/dist/instrument.d.ts
CHANGED
package/dist/instrument.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../src/instrument.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../src/instrument.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,GAAU,gBAAc;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,kBAiCnE,CAAA"}
|
package/dist/instrument.js
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import posthog from "posthog-js";
|
|
2
1
|
import { s as setClientExceptionReporter } from "./errorReporting-CVoUUKxW.js";
|
|
3
|
-
const instrument = ({ posthogKey }) => {
|
|
2
|
+
const instrument = async ({ posthogKey }) => {
|
|
4
3
|
if (typeof posthogKey === "string" && posthogKey.length > 0) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
try {
|
|
5
|
+
const { default: posthog } = await import("posthog-js");
|
|
6
|
+
posthog.init(posthogKey, {
|
|
7
|
+
api_host: "/ingest",
|
|
8
|
+
ui_host: "https://eu.posthog.com",
|
|
9
|
+
person_profiles: "always",
|
|
10
|
+
session_recording: {
|
|
11
|
+
maskAllInputs: false
|
|
12
|
+
},
|
|
13
|
+
capture_exceptions: {
|
|
14
|
+
capture_unhandled_errors: true,
|
|
15
|
+
capture_unhandled_rejections: true,
|
|
16
|
+
capture_console_errors: true
|
|
17
|
+
},
|
|
18
|
+
capture_pageview: true,
|
|
19
|
+
autocapture: true,
|
|
20
|
+
disable_session_recording: false,
|
|
21
|
+
disable_surveys: true,
|
|
22
|
+
disable_surveys_automatic_display: true
|
|
23
|
+
});
|
|
24
|
+
setClientExceptionReporter((error, context) => {
|
|
25
|
+
posthog.captureException(error, context);
|
|
26
|
+
});
|
|
27
|
+
} catch (err) {
|
|
28
|
+
console.warn("instrument: failed to load posthog-js", err);
|
|
29
|
+
}
|
|
26
30
|
} else {
|
|
27
31
|
console.warn("instrument: missing posthogKey");
|
|
28
32
|
}
|
package/dist/instrument.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.js","sources":["../src/instrument.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"instrument.js","sources":["../src/instrument.ts"],"sourcesContent":["import { setClientExceptionReporter } from \"./errorReporting\"\n\n\nexport const instrument = async ({posthogKey}: {posthogKey?: string}) => {\n if (typeof posthogKey === \"string\" && posthogKey.length > 0) {\n try {\n const { default: posthog } = await import(\"posthog-js\")\n\n posthog.init(posthogKey, {\n api_host: \"/ingest\",\n ui_host: \"https://eu.posthog.com\",\n person_profiles: \"always\",\n session_recording: {\n maskAllInputs: false\n },\n capture_exceptions: {\n capture_unhandled_errors: true,\n capture_unhandled_rejections: true,\n capture_console_errors: true,\n },\n capture_pageview: true,\n autocapture: true,\n disable_session_recording: false,\n disable_surveys: true,\n disable_surveys_automatic_display: true,\n })\n\n setClientExceptionReporter((error, context) => {\n posthog.captureException(error, context)\n })\n } catch (err) {\n console.warn(\"instrument: failed to load posthog-js\", err)\n }\n } else {\n console.warn(\"instrument: missing posthogKey\")\n }\n}\n"],"names":[],"mappings":";AAGO,MAAM,aAAa,OAAO,EAAC,iBAAuC;AACvE,MAAI,OAAO,eAAe,YAAY,WAAW,SAAS,GAAG;AAC3D,QAAI;AACF,YAAM,EAAE,SAAS,YAAY,MAAM,OAAO,YAAY;AAEtD,cAAQ,KAAK,YAAY;AAAA,QACvB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,iBAAiB;AAAA,QACjB,mBAAmB;AAAA,UACjB,eAAe;AAAA,QAAA;AAAA,QAEjB,oBAAoB;AAAA,UAClB,0BAA0B;AAAA,UAC1B,8BAA8B;AAAA,UAC9B,wBAAwB;AAAA,QAAA;AAAA,QAE1B,kBAAkB;AAAA,QAClB,aAAa;AAAA,QACb,2BAA2B;AAAA,QAC3B,iBAAiB;AAAA,QACjB,mCAAmC;AAAA,MAAA,CACpC;AAED,iCAA2B,CAAC,OAAO,YAAY;AAC7C,gBAAQ,iBAAiB,OAAO,OAAO;AAAA,MACzC,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,cAAQ,KAAK,yCAAyC,GAAG;AAAA,IAC3D;AAAA,EACF,OAAO;AACL,YAAQ,KAAK,gCAAgC;AAAA,EAC/C;AACF;"}
|