@auspex-ai/react 1.4.1 → 1.4.2
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 +64 -0
- package/package.json +12 -2
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @auspex-ai/react
|
|
2
|
+
|
|
3
|
+
Auspex instrumentation for React single-page apps built with Vite (Vite 5 or later, React 18 or later).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @auspex-ai/core @auspex-ai/react
|
|
9
|
+
# or: npm install @auspex-ai/core @auspex-ai/react
|
|
10
|
+
# or: yarn add @auspex-ai/core @auspex-ai/react
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Add one `AuspexProvider` outside your router. This example uses React Router:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { AuspexProvider } from '@auspex-ai/react';
|
|
19
|
+
import { fromDataRouter } from '@auspex-ai/react/react-router';
|
|
20
|
+
import { createBrowserRouter, RouterProvider } from 'react-router';
|
|
21
|
+
|
|
22
|
+
const router = createBrowserRouter(routes);
|
|
23
|
+
|
|
24
|
+
export function App() {
|
|
25
|
+
return (
|
|
26
|
+
<AuspexProvider
|
|
27
|
+
publicKey={import.meta.env.VITE_AUSPEX_KEY}
|
|
28
|
+
host={import.meta.env.VITE_AUSPEX_HOST ?? ''}
|
|
29
|
+
buildId={import.meta.env.VITE_AUSPEX_BUILD_ID}
|
|
30
|
+
{...fromDataRouter(router)}
|
|
31
|
+
>
|
|
32
|
+
<RouterProvider router={router} />
|
|
33
|
+
</AuspexProvider>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If you don't use React Router, don't pass `fromDataRouter`.
|
|
39
|
+
|
|
40
|
+
Add the plugin to `vite.config` so that Auspex can name buttons and other elements. Put `auspex()` before `react()`. Set your build key in the `AUSPEX_BUILD_KEY` environment variable of the build, and don't add the `VITE_` prefix to it.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// vite.config.ts
|
|
44
|
+
import react from '@vitejs/plugin-react';
|
|
45
|
+
import { auspex } from '@auspex-ai/react/vite';
|
|
46
|
+
import { defineConfig } from 'vite';
|
|
47
|
+
|
|
48
|
+
export default defineConfig({
|
|
49
|
+
plugins: [auspex(), react()],
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For the write key, the build key, and all options, see the [quickstart](https://docs.auspex.blue/getting-started/quickstart/) and the [instrumentation reference](https://docs.auspex.blue/reference/instrumentation/).
|
|
54
|
+
|
|
55
|
+
## Documentation
|
|
56
|
+
|
|
57
|
+
See the [Auspex documentation](https://docs.auspex.blue).
|
|
58
|
+
|
|
59
|
+
- [Quickstart](https://docs.auspex.blue/getting-started/quickstart/)
|
|
60
|
+
- [Instrumentation reference](https://docs.auspex.blue/reference/instrumentation/)
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auspex-ai/react",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
|
+
"description": "Auspex instrumentation for React apps built with Vite",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"sideEffects": false,
|
|
6
7
|
"license": "Apache-2.0",
|
|
8
|
+
"homepage": "https://docs.auspex.blue/",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"auspex",
|
|
11
|
+
"react",
|
|
12
|
+
"vite",
|
|
13
|
+
"react-router",
|
|
14
|
+
"instrumentation",
|
|
15
|
+
"analytics"
|
|
16
|
+
],
|
|
7
17
|
"repository": {
|
|
8
18
|
"type": "git",
|
|
9
19
|
"url": "git+https://github.com/NA-LUDENS/auspex.git",
|
|
@@ -36,7 +46,7 @@
|
|
|
36
46
|
"module": "./dist/index.mjs",
|
|
37
47
|
"types": "./dist/index.d.mts",
|
|
38
48
|
"dependencies": {
|
|
39
|
-
"@auspex-ai/core": "^1.4.
|
|
49
|
+
"@auspex-ai/core": "^1.4.2",
|
|
40
50
|
"@babel/parser": "^7.29.8",
|
|
41
51
|
"magic-string": "^1.4.1"
|
|
42
52
|
},
|