@rpcbase/client 0.287.0 → 0.289.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.
@@ -0,0 +1,4 @@
1
+ export declare const instrument: ({ posthogKey }: {
2
+ posthogKey?: string;
3
+ }) => void;
4
+ //# sourceMappingURL=instrument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../src/instrument.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,GAAI,gBAAc;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC,SAqB7D,CAAA"}
@@ -0,0 +1,26 @@
1
+ import posthog from "posthog-js";
2
+ const instrument = ({ posthogKey }) => {
3
+ if (typeof posthogKey === "string" && posthogKey.length > 0) {
4
+ posthog.init(posthogKey, {
5
+ api_host: "/ingest",
6
+ ui_host: "https://eu.posthog.com",
7
+ person_profiles: "always",
8
+ session_recording: {
9
+ maskAllInputs: false
10
+ },
11
+ capture_exceptions: {
12
+ capture_unhandled_errors: true,
13
+ capture_unhandled_rejections: true,
14
+ capture_console_errors: true
15
+ },
16
+ capture_pageview: true,
17
+ autocapture: true,
18
+ disable_session_recording: false
19
+ });
20
+ } else {
21
+ console.warn("instrument: missing posthogKey");
22
+ }
23
+ };
24
+ export {
25
+ instrument
26
+ };
package/package.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.287.0",
3
+ "version": "0.289.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./instrument": {
17
+ "types": "./dist/instrument.d.ts",
18
+ "import": "./dist/instrument.js",
19
+ "default": "./dist/instrument.js"
20
+ }
21
+ },
10
22
  "scripts": {
11
23
  "build": "wireit",
12
24
  "release": "wireit"
@@ -16,7 +28,6 @@
16
28
  "command": "../../node_modules/.bin/vite build",
17
29
  "files": [
18
30
  "src/**/*",
19
- "instrument.ts",
20
31
  "../../tsconfig.json",
21
32
  "../../scripts/tsconfig.pkg.json",
22
33
  "./tsconfig.json",