@appxiom/4react 0.1.9 → 0.1.11
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/README.md +20 -20
- package/core/ax-react.js +1 -1
- package/index.d.ts +1 -1
- package/lifecycle/patch.js +1 -1
- package/memory/ax-react-useref-leak.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Appxiom React SDK (`@appxiom/4react`)
|
|
2
2
|
|
|
3
|
-
`@appxiom/4react` initializes the Appxiom browser SDK and adds React-aware instrumentation for application lifecycle activity and `useRef` leak detection. It depends on `@appxiom/
|
|
3
|
+
`@appxiom/4react` initializes the Appxiom browser SDK and adds React-aware instrumentation for application lifecycle activity and `useRef` leak detection. It depends on `@appxiom/web`, which npm installs automatically.
|
|
4
4
|
|
|
5
5
|
## Table of Contents
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
|
-
Install the React integration and React. `@appxiom/
|
|
26
|
+
Install the React integration and React. `@appxiom/web` is installed automatically as a dependency.
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
npm install @appxiom/4react react
|
|
@@ -41,8 +41,8 @@ import init from '@appxiom/4react';
|
|
|
41
41
|
const ax = await init(
|
|
42
42
|
'YOUR_APP_KEY',
|
|
43
43
|
'YOUR_PLATFORM_KEY',
|
|
44
|
-
'
|
|
45
|
-
'
|
|
44
|
+
'YOUR_APP_VERSION',
|
|
45
|
+
'YOUR_BUILD_IDENTIFIER',
|
|
46
46
|
);
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -54,24 +54,24 @@ import init, { type AXReact } from '@appxiom/4react';
|
|
|
54
54
|
const ax: AXReact = await init(
|
|
55
55
|
'YOUR_APP_KEY',
|
|
56
56
|
'YOUR_PLATFORM_KEY',
|
|
57
|
-
'
|
|
58
|
-
'
|
|
57
|
+
'YOUR_APP_VERSION',
|
|
58
|
+
'YOUR_BUILD_IDENTIFIER',
|
|
59
59
|
);
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
## TypeScript
|
|
63
63
|
|
|
64
|
-
`@appxiom/4react` ships first-party TypeScript declarations. No separate `@types` package is required. `init(...)` returns `Promise<AXReact>`, and `AXReact` extends the public `AX` API from `@appxiom/
|
|
64
|
+
`@appxiom/4react` ships first-party TypeScript declarations. No separate `@types` package is required. `init(...)` returns `Promise<AXReact>`, and `AXReact` extends the public `AX` API from `@appxiom/web`.
|
|
65
65
|
|
|
66
66
|
```typescript
|
|
67
67
|
import init, { type AXReact } from '@appxiom/4react';
|
|
68
|
-
import type { IssueSeverity } from '@appxiom/
|
|
68
|
+
import type { IssueSeverity } from '@appxiom/web';
|
|
69
69
|
|
|
70
70
|
const ax: AXReact = await init(
|
|
71
71
|
'YOUR_APP_KEY',
|
|
72
72
|
'YOUR_PLATFORM_KEY',
|
|
73
|
-
'
|
|
74
|
-
'
|
|
73
|
+
'YOUR_APP_VERSION',
|
|
74
|
+
'YOUR_BUILD_IDENTIFIER',
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
const severity: IssueSeverity = 1;
|
|
@@ -94,7 +94,7 @@ Initialize the package before rendering the application so the instrumentation i
|
|
|
94
94
|
|
|
95
95
|
## Vite
|
|
96
96
|
|
|
97
|
-
`@appxiom/4react` depends on `@appxiom/
|
|
97
|
+
`@appxiom/4react` depends on `@appxiom/web`, which includes a WebAssembly binary. During local development, exclude both packages from Vite dependency optimization so Vite preserves the binary's source-relative URL:
|
|
98
98
|
|
|
99
99
|
### JavaScript
|
|
100
100
|
|
|
@@ -105,7 +105,7 @@ import react from '@vitejs/plugin-react';
|
|
|
105
105
|
export default defineConfig({
|
|
106
106
|
plugins: [react()],
|
|
107
107
|
optimizeDeps: {
|
|
108
|
-
exclude: ['@appxiom/4react', '@appxiom/
|
|
108
|
+
exclude: ['@appxiom/4react', '@appxiom/web'],
|
|
109
109
|
},
|
|
110
110
|
});
|
|
111
111
|
```
|
|
@@ -119,7 +119,7 @@ import react from '@vitejs/plugin-react';
|
|
|
119
119
|
export default defineConfig({
|
|
120
120
|
plugins: [react()],
|
|
121
121
|
optimizeDeps: {
|
|
122
|
-
exclude: ['@appxiom/4react', '@appxiom/
|
|
122
|
+
exclude: ['@appxiom/4react', '@appxiom/web'],
|
|
123
123
|
},
|
|
124
124
|
});
|
|
125
125
|
```
|
|
@@ -146,8 +146,8 @@ if (typeof window !== 'undefined') {
|
|
|
146
146
|
const ax = await init(
|
|
147
147
|
'YOUR_APP_KEY',
|
|
148
148
|
'YOUR_PLATFORM_KEY',
|
|
149
|
-
'
|
|
150
|
-
'
|
|
149
|
+
'YOUR_APP_VERSION',
|
|
150
|
+
'YOUR_BUILD_IDENTIFIER',
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
153
|
```
|
|
@@ -161,8 +161,8 @@ if (typeof window !== 'undefined') {
|
|
|
161
161
|
const ax = await init(
|
|
162
162
|
'YOUR_APP_KEY',
|
|
163
163
|
'YOUR_PLATFORM_KEY',
|
|
164
|
-
'
|
|
165
|
-
'
|
|
164
|
+
'YOUR_APP_VERSION',
|
|
165
|
+
'YOUR_BUILD_IDENTIFIER',
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
```
|
|
@@ -202,7 +202,7 @@ Initializes the core SDK, installs the React instrumentation, and returns `Promi
|
|
|
202
202
|
|
|
203
203
|
### Inherited `AX` methods
|
|
204
204
|
|
|
205
|
-
The returned `AXReact` instance inherits these supported methods from `@appxiom/
|
|
205
|
+
The returned `AXReact` instance inherits these supported methods from `@appxiom/web`:
|
|
206
206
|
|
|
207
207
|
- `setCustomId(customId)`: associates telemetry with an application user or account identifier.
|
|
208
208
|
- `startGoal(name)`: starts a named goal.
|
|
@@ -222,7 +222,7 @@ ax.endGoal('checkout', { orderId: 'ORD-10023' }, 120);
|
|
|
222
222
|
#### TypeScript
|
|
223
223
|
|
|
224
224
|
```typescript
|
|
225
|
-
import type { IssueSeverity } from '@appxiom/
|
|
225
|
+
import type { IssueSeverity } from '@appxiom/web';
|
|
226
226
|
|
|
227
227
|
const severity: IssueSeverity = 1;
|
|
228
228
|
|
|
@@ -235,7 +235,7 @@ ax.reportCustomIssue('Payment failed', 'Gateway timed out.', severity, {
|
|
|
235
235
|
ax.endGoal('checkout', { orderId: 'ORD-10023' }, 120);
|
|
236
236
|
```
|
|
237
237
|
|
|
238
|
-
For the complete core API and deployment details, see the `@appxiom/
|
|
238
|
+
For the complete core API and deployment details, see the `@appxiom/web` package documentation.
|
|
239
239
|
|
|
240
240
|
## Troubleshooting
|
|
241
241
|
|
package/core/ax-react.js
CHANGED
package/index.d.ts
CHANGED
package/lifecycle/patch.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// React 18 / 19 compatible – dispatcher-based interception
|
|
3
3
|
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { AX } from '@appxiom/
|
|
5
|
+
import { AX } from '@appxiom/web';
|
|
6
6
|
import { useRefLeakTracker } from '../memory/ax-react-useref-leak.js';
|
|
7
7
|
import { getDispatcherSlot, getReactInternals } from './react-internals.js';
|
|
8
8
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "BasilGregory Software Labs Private Limited",
|
|
6
6
|
"homepage": "https://www.appxiom.com",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.11",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"main": "index.js",
|
|
40
40
|
"module": "index.js",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@appxiom/
|
|
42
|
+
"@appxiom/web": "^0.1.11"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.9.3"
|