@auspex-ai/next 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 +42 -34
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -1,50 +1,58 @@
|
|
|
1
1
|
# @auspex-ai/next
|
|
2
2
|
|
|
3
|
-
Next.js
|
|
3
|
+
Auspex instrumentation for Next.js apps (version 14 or later, app router and pages router).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export default withAuspex(nextConfig, { host: 'https://<受信口のドメイン>' });
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @auspex-ai/core @auspex-ai/next
|
|
9
|
+
# or: npm install @auspex-ai/core @auspex-ai/next
|
|
10
|
+
# or: yarn add @auspex-ai/core @auspex-ai/next
|
|
12
11
|
```
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Add one `AuspexProvider` to `app/layout.tsx` (app router) or `pages/_app.tsx` (pages router):
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { AuspexProvider } from '@auspex-ai/next';
|
|
19
|
+
|
|
20
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
21
|
+
return (
|
|
22
|
+
<html lang="en">
|
|
23
|
+
<body>
|
|
24
|
+
<AuspexProvider
|
|
25
|
+
publicKey={process.env.NEXT_PUBLIC_AUSPEX_KEY}
|
|
26
|
+
host={process.env.NEXT_PUBLIC_AUSPEX_HOST ?? ''}
|
|
27
|
+
>
|
|
28
|
+
{children}
|
|
29
|
+
</AuspexProvider>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
18
35
|
|
|
19
|
-
|
|
36
|
+
Wrap `next.config` with `withAuspex` so that Auspex can name buttons and other elements. Set your build key in the `AUSPEX_BUILD_KEY` environment variable of the build, and don't add the `NEXT_PUBLIC_` prefix to it.
|
|
20
37
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
4. セルフホスト版で IAP の背後に置いた internal へ登録するときだけ、ビルドの環境変数を足す: `AUSPEX_INTERNAL_HOST`(internal の https の URL。あれば登録だけそちらへ送る。`host` が無くてもよい)と `AUSPEX_IAP_SERVICE_ACCOUNT`(IAP を通すサービスアカウントのメール。CI に Google の認証情報、プロジェクトに `google-auth-library` が要る。任意の peer 依存)。
|
|
38
|
+
```js
|
|
39
|
+
// next.config.mjs
|
|
40
|
+
import { withAuspex } from '@auspex-ai/next/config';
|
|
25
41
|
|
|
26
|
-
|
|
42
|
+
const nextConfig = {};
|
|
27
43
|
|
|
28
|
-
|
|
44
|
+
export default withAuspex(nextConfig);
|
|
45
|
+
```
|
|
29
46
|
|
|
30
|
-
|
|
31
|
-
- hook が使えない Next(15.4.1 未満、版が判定できない、15.x の Turbopack)では `registerNames: 'cli'` を渡し、`next build` の後に CLI を流す:
|
|
47
|
+
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/).
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
export default withAuspex(nextConfig, { registerNames: 'cli' });
|
|
35
|
-
```
|
|
49
|
+
## Documentation
|
|
36
50
|
|
|
37
|
-
|
|
38
|
-
next build && AUSPEX_BUILD_KEY=... auspex-register-names --host https://<受信口のドメイン>
|
|
39
|
-
```
|
|
51
|
+
See the [Auspex documentation](https://docs.auspex.blue).
|
|
40
52
|
|
|
41
|
-
|
|
53
|
+
- [Quickstart](https://docs.auspex.blue/getting-started/quickstart/)
|
|
54
|
+
- [Instrumentation reference](https://docs.auspex.blue/reference/instrumentation/)
|
|
42
55
|
|
|
43
|
-
|
|
56
|
+
## License
|
|
44
57
|
|
|
45
|
-
|
|
46
|
-
| --- | --- | --- |
|
|
47
|
-
| `iconNames` | `true` | `false` でアイコン名の参照(`data-auspex-icon-ref`)を書かない。参照は要素名と同じビルド鍵で計算し、名前は同じ登録(`icons`)でビルドの終わりに Auspex へ送る。鍵が無い・strip のときは何も書かない(手書きの `data-auspex-icon` は消える)。ライブラリの class から取る名前は今のまま |
|
|
48
|
-
| `elementNames` | `true` | `false` で要素の参照を書かない |
|
|
49
|
-
| `registerNames` | なし | `'cli'` で hook ではなく CLI で登録する |
|
|
50
|
-
| `host` | `NEXT_PUBLIC_AUSPEX_HOST` | 登録の受け口 |
|
|
58
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auspex-ai/next",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
|
+
"description": "Auspex instrumentation for Next.js apps",
|
|
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
|
+
"nextjs",
|
|
12
|
+
"next",
|
|
13
|
+
"instrumentation",
|
|
14
|
+
"analytics"
|
|
15
|
+
],
|
|
7
16
|
"repository": {
|
|
8
17
|
"type": "git",
|
|
9
18
|
"url": "git+https://github.com/NA-LUDENS/auspex.git",
|
|
@@ -34,7 +43,7 @@
|
|
|
34
43
|
"module": "./dist/index.mjs",
|
|
35
44
|
"types": "./dist/index.d.mts",
|
|
36
45
|
"dependencies": {
|
|
37
|
-
"@auspex-ai/core": "^1.4.
|
|
46
|
+
"@auspex-ai/core": "^1.4.2",
|
|
38
47
|
"@babel/parser": "^7.29.8",
|
|
39
48
|
"magic-string": "^1.4.1"
|
|
40
49
|
},
|