@serge-ai/nextjs 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Superstellar LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @serge-ai/nextjs
2
+
3
+ > **No cookies. No localStorage by default. No consent banner required.** ePrivacy Art. 5(3) compliant by construction.
4
+
5
+ Next.js App Router integration for [Serge](https://serge.ai). Drop-in `<Analytics />` + `<DetectionPixel />` with automatic pageview emission on every route change via `usePathname` / `useSearchParams`.
6
+
7
+ ```sh
8
+ pnpm add @serge-ai/nextjs
9
+ # or
10
+ npm install @serge-ai/nextjs
11
+ ```
12
+
13
+ If you're not using the App Router → use **[`@serge-ai/react`](https://www.npmjs.com/package/@serge-ai/react)** instead. Pages Router's `next/router` events handle what we'd need.
14
+
15
+ ## Quick start
16
+
17
+ ```tsx
18
+ // app/layout.tsx
19
+ import { Analytics, DetectionPixel } from '@serge-ai/nextjs'
20
+
21
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
22
+ return (
23
+ <html>
24
+ <body>
25
+ {children}
26
+ <Analytics token="srg_pub_xxxxxxxxxxxxxxxxxxxxxxxxxx" />
27
+ <DetectionPixel token="srg_pub_xxxxxxxxxxxxxxxxxxxxxxxxxx" />
28
+ </body>
29
+ </html>
30
+ )
31
+ }
32
+ ```
33
+
34
+ That's it. Every route change in your app fires a `pageview` automatically; non-JS agents get caught by the pixel.
35
+
36
+ To emit a custom event from any client component:
37
+
38
+ ```tsx
39
+ 'use client'
40
+ import { track } from '@serge-ai/nextjs'
41
+
42
+ export function CheckoutButton() {
43
+ return (
44
+ <button onClick={() => track('checkout_started', { plan: 'pro' })}>
45
+ Check out
46
+ </button>
47
+ )
48
+ }
49
+ ```
50
+
51
+ ## What this does that `@serge-ai/react` doesn't
52
+
53
+ - Listens to `usePathname()` + `useSearchParams()` to fire `pageview()` on every App Router navigation. The plain React `<Analytics />` relies on the History API, which Next.js intercepts in ways that can hide route changes from a generic listener.
54
+ - Wraps the search-params listener in `<Suspense>` as Next.js requires — `useSearchParams` forces dynamic rendering of its non-Suspense parent, which would defeat static rendering for the entire layout. The internal Suspense fallback is `null`, so the page tree is visually identical.
55
+
56
+ ## API re-exports
57
+
58
+ ```tsx
59
+ import { init, track, consent, pageview, DetectionPixel } from '@serge-ai/nextjs'
60
+ ```
61
+
62
+ These are re-exports from `@serge-ai/js` and `@serge-ai/react` so consumers can import everything from one path. See **[`@serge-ai/js` docs](https://www.npmjs.com/package/@serge-ai/js)** for the full reference.
63
+
64
+ ## SSR safety
65
+
66
+ Every browser-API access is guarded inside `useEffect`. The component is marked `'use client'`. Safe to import from a server component layout — the `Suspense` wrapper isolates the dynamic-rendering bailout to the inner zero-DOM component.
67
+
68
+ ## Next.js + React versions
69
+
70
+ - `next@>=14` (peer dependency)
71
+ - `react@^18 || ^19` (peer dependency)
72
+
73
+ Works in App Router projects. Pages Router → use [`@serge-ai/react`](https://www.npmjs.com/package/@serge-ai/react).
74
+
75
+ ## Bundle size
76
+
77
+ Under 6 KB gzipped (excluding `react`, `next`, `@serge-ai/js`, and `@serge-ai/react`, which the host already provides). [`size-limit`](https://github.com/ai/size-limit) enforces this in CI.
78
+
79
+ ## License
80
+
81
+ MIT © Superstellar LLC. See [LICENSE](./LICENSE).
package/dist/index.cjs ADDED
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ 'use strict';var react$1=require('react'),navigation_js=require('next/navigation.js'),js=require('@serge-ai/js'),react=require('@serge-ai/react'),jsxRuntime=require('react/jsx-runtime');function u({token:e,...o}){let i=navigation_js.usePathname(),r=navigation_js.useSearchParams();return react$1.useEffect(()=>{js.init(e,o);},[e]),react$1.useEffect(()=>{typeof window>"u"||js.pageview();},[i,r?.toString()]),null}function h(e){return jsxRuntime.jsx(react$1.Suspense,{fallback:null,children:jsxRuntime.jsx(u,{...e})})}Object.defineProperty(exports,"consent",{enumerable:true,get:function(){return js.consent}});Object.defineProperty(exports,"init",{enumerable:true,get:function(){return js.init}});Object.defineProperty(exports,"pageview",{enumerable:true,get:function(){return js.pageview}});Object.defineProperty(exports,"track",{enumerable:true,get:function(){return js.track}});Object.defineProperty(exports,"DetectionPixel",{enumerable:true,get:function(){return react.DetectionPixel}});exports.Analytics=h;//# sourceMappingURL=index.cjs.map
3
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":["AnalyticsInner","token","options","pathname","usePathname","search","useSearchParams","useEffect","init","pageview","Analytics","props","jsx","Suspense"],"mappings":"0LA4DA,SAASA,CAAAA,CAAe,CAAE,MAAAC,CAAAA,CAAO,GAAGC,CAAQ,CAAA,CAAyB,CACnE,IAAMC,CAAAA,CAAWC,yBAAAA,GACXC,CAAAA,CAASC,6BAAAA,GAGf,OAAAC,iBAAAA,CAAU,IAAM,CACdC,OAAAA,CAAKP,EAAOC,CAAO,EAErB,EAAG,CAACD,CAAK,CAAC,CAAA,CASVM,iBAAAA,CAAU,IAAM,CACV,OAAO,OAAW,GAAA,EACtBE,WAAAA,GAEF,CAAA,CAAG,CAACN,EAAUE,CAAAA,EAAQ,QAAA,EAAU,CAAC,CAAA,CAE1B,IACT,CAcO,SAASK,EAAUC,CAAAA,CAA6B,CACrD,OACEC,cAAAA,CAACC,gBAAAA,CAAA,CAAS,QAAA,CAAU,IAAA,CAClB,SAAAD,cAAAA,CAACZ,CAAAA,CAAA,CAAgB,GAAGW,CAAAA,CAAO,EAC7B,CAEJ","file":"index.cjs","sourcesContent":["/**\n * @serge-ai/nextjs — Next.js App Router integration.\n *\n * Drop both into `app/layout.tsx` once:\n *\n * import { Analytics, DetectionPixel } from '@serge-ai/nextjs'\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <Analytics token=\"srg_pub_xxx\" />\n * <DetectionPixel token=\"srg_pub_xxx\" />\n * </body>\n * </html>\n * )\n * }\n *\n * What `<Analytics />` does that the plain React component doesn't:\n * - Listens to `usePathname()` + `useSearchParams()` to fire a\n * manual `pageview()` on every App Router navigation. The plain\n * React component relies on the History API, which Next.js\n * intercepts in ways that can hide route changes from a generic\n * listener.\n * - Wraps the search-params listener in `<Suspense>` as Next.js\n * requires — `useSearchParams` forces dynamic rendering of its\n * non-Suspense parent, which would defeat static rendering for\n * the entire layout. The fallback is `null` so the page tree is\n * visually identical.\n *\n * `<DetectionPixel />` is the same pixel from `@serge-ai/react`\n * — re-exported here so consumers only need a single import path.\n *\n * Pages Router users should keep using `@serge-ai/react`'s\n * `<Analytics />`; Next's `<Router>` events handle what we'd need.\n */\n\n'use client'\n\nimport { Suspense, useEffect } from 'react'\nimport { usePathname, useSearchParams } from 'next/navigation.js'\nimport {\n init,\n pageview,\n track,\n consent,\n type InitOptions,\n type ConsentValue,\n} from '@serge-ai/js'\nimport { DetectionPixel, type DetectionPixelProps } from '@serge-ai/react'\n\nexport { init, track, consent, pageview, DetectionPixel }\nexport type { InitOptions, ConsentValue, DetectionPixelProps }\n\nexport interface AnalyticsProps extends InitOptions {\n /** Public token from the Serge dashboard (`srg_pub_*`). */\n token: string\n}\n\nfunction AnalyticsInner({ token, ...options }: AnalyticsProps): null {\n const pathname = usePathname()\n const search = useSearchParams()\n\n /* One-time init on mount. Same pattern as the plain React component. */\n useEffect(() => {\n init(token, options)\n /* eslint-disable-next-line react-hooks/exhaustive-deps */\n }, [token])\n\n /* App Router fires usePathname/useSearchParams updates on every\n * navigation. Emit a pageview event so the timeline is accurate.\n * The core `pageview()` is a no-op until init() finishes; the\n * effect order here (init mounted before navigation effects)\n * means the first navigation after mount is captured by the\n * regular session_start path, not by this effect. Subsequent\n * navigations route through here. */\n useEffect(() => {\n if (typeof window === 'undefined') return\n pageview()\n /* eslint-disable-next-line react-hooks/exhaustive-deps */\n }, [pathname, search?.toString()])\n\n return null\n}\n\n/**\n * Next.js App Router wrapper. Wraps the inner component in `<Suspense>`\n * because `useSearchParams` triggers dynamic-rendering bailout on its\n * nearest non-Suspense parent, which would force the whole layout into\n * dynamic rendering on every request. With Suspense it only bails out\n * the (zero-DOM) inner component, preserving static rendering for the\n * rest of the page.\n *\n * The component returns null at runtime — the React 19 / 18 ReactNode\n * incompatibility around children typing is sidestepped by a single\n * cast (Vercel uses the same trick in @vercel/analytics/next).\n */\nexport function Analytics(props: AnalyticsProps): null {\n return (\n <Suspense fallback={null}>\n <AnalyticsInner {...props} />\n </Suspense>\n ) as never\n}\n"]}
@@ -0,0 +1,61 @@
1
+ import { InitOptions } from '@serge-ai/js';
2
+ export { ConsentValue, InitOptions, consent, init, pageview, track } from '@serge-ai/js';
3
+ export { DetectionPixel, DetectionPixelProps } from '@serge-ai/react';
4
+
5
+ /**
6
+ * @serge-ai/nextjs — Next.js App Router integration.
7
+ *
8
+ * Drop both into `app/layout.tsx` once:
9
+ *
10
+ * import { Analytics, DetectionPixel } from '@serge-ai/nextjs'
11
+ *
12
+ * export default function RootLayout({ children }) {
13
+ * return (
14
+ * <html>
15
+ * <body>
16
+ * {children}
17
+ * <Analytics token="srg_pub_xxx" />
18
+ * <DetectionPixel token="srg_pub_xxx" />
19
+ * </body>
20
+ * </html>
21
+ * )
22
+ * }
23
+ *
24
+ * What `<Analytics />` does that the plain React component doesn't:
25
+ * - Listens to `usePathname()` + `useSearchParams()` to fire a
26
+ * manual `pageview()` on every App Router navigation. The plain
27
+ * React component relies on the History API, which Next.js
28
+ * intercepts in ways that can hide route changes from a generic
29
+ * listener.
30
+ * - Wraps the search-params listener in `<Suspense>` as Next.js
31
+ * requires — `useSearchParams` forces dynamic rendering of its
32
+ * non-Suspense parent, which would defeat static rendering for
33
+ * the entire layout. The fallback is `null` so the page tree is
34
+ * visually identical.
35
+ *
36
+ * `<DetectionPixel />` is the same pixel from `@serge-ai/react`
37
+ * — re-exported here so consumers only need a single import path.
38
+ *
39
+ * Pages Router users should keep using `@serge-ai/react`'s
40
+ * `<Analytics />`; Next's `<Router>` events handle what we'd need.
41
+ */
42
+
43
+ interface AnalyticsProps extends InitOptions {
44
+ /** Public token from the Serge dashboard (`srg_pub_*`). */
45
+ token: string;
46
+ }
47
+ /**
48
+ * Next.js App Router wrapper. Wraps the inner component in `<Suspense>`
49
+ * because `useSearchParams` triggers dynamic-rendering bailout on its
50
+ * nearest non-Suspense parent, which would force the whole layout into
51
+ * dynamic rendering on every request. With Suspense it only bails out
52
+ * the (zero-DOM) inner component, preserving static rendering for the
53
+ * rest of the page.
54
+ *
55
+ * The component returns null at runtime — the React 19 / 18 ReactNode
56
+ * incompatibility around children typing is sidestepped by a single
57
+ * cast (Vercel uses the same trick in @vercel/analytics/next).
58
+ */
59
+ declare function Analytics(props: AnalyticsProps): null;
60
+
61
+ export { Analytics, type AnalyticsProps };
@@ -0,0 +1,61 @@
1
+ import { InitOptions } from '@serge-ai/js';
2
+ export { ConsentValue, InitOptions, consent, init, pageview, track } from '@serge-ai/js';
3
+ export { DetectionPixel, DetectionPixelProps } from '@serge-ai/react';
4
+
5
+ /**
6
+ * @serge-ai/nextjs — Next.js App Router integration.
7
+ *
8
+ * Drop both into `app/layout.tsx` once:
9
+ *
10
+ * import { Analytics, DetectionPixel } from '@serge-ai/nextjs'
11
+ *
12
+ * export default function RootLayout({ children }) {
13
+ * return (
14
+ * <html>
15
+ * <body>
16
+ * {children}
17
+ * <Analytics token="srg_pub_xxx" />
18
+ * <DetectionPixel token="srg_pub_xxx" />
19
+ * </body>
20
+ * </html>
21
+ * )
22
+ * }
23
+ *
24
+ * What `<Analytics />` does that the plain React component doesn't:
25
+ * - Listens to `usePathname()` + `useSearchParams()` to fire a
26
+ * manual `pageview()` on every App Router navigation. The plain
27
+ * React component relies on the History API, which Next.js
28
+ * intercepts in ways that can hide route changes from a generic
29
+ * listener.
30
+ * - Wraps the search-params listener in `<Suspense>` as Next.js
31
+ * requires — `useSearchParams` forces dynamic rendering of its
32
+ * non-Suspense parent, which would defeat static rendering for
33
+ * the entire layout. The fallback is `null` so the page tree is
34
+ * visually identical.
35
+ *
36
+ * `<DetectionPixel />` is the same pixel from `@serge-ai/react`
37
+ * — re-exported here so consumers only need a single import path.
38
+ *
39
+ * Pages Router users should keep using `@serge-ai/react`'s
40
+ * `<Analytics />`; Next's `<Router>` events handle what we'd need.
41
+ */
42
+
43
+ interface AnalyticsProps extends InitOptions {
44
+ /** Public token from the Serge dashboard (`srg_pub_*`). */
45
+ token: string;
46
+ }
47
+ /**
48
+ * Next.js App Router wrapper. Wraps the inner component in `<Suspense>`
49
+ * because `useSearchParams` triggers dynamic-rendering bailout on its
50
+ * nearest non-Suspense parent, which would force the whole layout into
51
+ * dynamic rendering on every request. With Suspense it only bails out
52
+ * the (zero-DOM) inner component, preserving static rendering for the
53
+ * rest of the page.
54
+ *
55
+ * The component returns null at runtime — the React 19 / 18 ReactNode
56
+ * incompatibility around children typing is sidestepped by a single
57
+ * cast (Vercel uses the same trick in @vercel/analytics/next).
58
+ */
59
+ declare function Analytics(props: AnalyticsProps): null;
60
+
61
+ export { Analytics, type AnalyticsProps };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import {Suspense,useEffect}from'react';import {usePathname,useSearchParams}from'next/navigation.js';import {init,pageview}from'@serge-ai/js';export{consent,init,pageview,track}from'@serge-ai/js';export{DetectionPixel}from'@serge-ai/react';import {jsx}from'react/jsx-runtime';function u({token:e,...o}){let i=usePathname(),r=useSearchParams();return useEffect(()=>{init(e,o);},[e]),useEffect(()=>{typeof window>"u"||pageview();},[i,r?.toString()]),null}function h(e){return jsx(Suspense,{fallback:null,children:jsx(u,{...e})})}export{h as Analytics};//# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":["AnalyticsInner","token","options","pathname","usePathname","search","useSearchParams","useEffect","init","pageview","Analytics","props","jsx","Suspense"],"mappings":"mRA4DA,SAASA,CAAAA,CAAe,CAAE,MAAAC,CAAAA,CAAO,GAAGC,CAAQ,CAAA,CAAyB,CACnE,IAAMC,CAAAA,CAAWC,WAAAA,GACXC,CAAAA,CAASC,eAAAA,GAGf,OAAAC,SAAAA,CAAU,IAAM,CACdC,IAAAA,CAAKP,EAAOC,CAAO,EAErB,EAAG,CAACD,CAAK,CAAC,CAAA,CASVM,SAAAA,CAAU,IAAM,CACV,OAAO,OAAW,GAAA,EACtBE,QAAAA,GAEF,CAAA,CAAG,CAACN,EAAUE,CAAAA,EAAQ,QAAA,EAAU,CAAC,CAAA,CAE1B,IACT,CAcO,SAASK,EAAUC,CAAAA,CAA6B,CACrD,OACEC,GAAAA,CAACC,QAAAA,CAAA,CAAS,QAAA,CAAU,IAAA,CAClB,SAAAD,GAAAA,CAACZ,CAAAA,CAAA,CAAgB,GAAGW,CAAAA,CAAO,EAC7B,CAEJ","file":"index.js","sourcesContent":["/**\n * @serge-ai/nextjs — Next.js App Router integration.\n *\n * Drop both into `app/layout.tsx` once:\n *\n * import { Analytics, DetectionPixel } from '@serge-ai/nextjs'\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <Analytics token=\"srg_pub_xxx\" />\n * <DetectionPixel token=\"srg_pub_xxx\" />\n * </body>\n * </html>\n * )\n * }\n *\n * What `<Analytics />` does that the plain React component doesn't:\n * - Listens to `usePathname()` + `useSearchParams()` to fire a\n * manual `pageview()` on every App Router navigation. The plain\n * React component relies on the History API, which Next.js\n * intercepts in ways that can hide route changes from a generic\n * listener.\n * - Wraps the search-params listener in `<Suspense>` as Next.js\n * requires — `useSearchParams` forces dynamic rendering of its\n * non-Suspense parent, which would defeat static rendering for\n * the entire layout. The fallback is `null` so the page tree is\n * visually identical.\n *\n * `<DetectionPixel />` is the same pixel from `@serge-ai/react`\n * — re-exported here so consumers only need a single import path.\n *\n * Pages Router users should keep using `@serge-ai/react`'s\n * `<Analytics />`; Next's `<Router>` events handle what we'd need.\n */\n\n'use client'\n\nimport { Suspense, useEffect } from 'react'\nimport { usePathname, useSearchParams } from 'next/navigation.js'\nimport {\n init,\n pageview,\n track,\n consent,\n type InitOptions,\n type ConsentValue,\n} from '@serge-ai/js'\nimport { DetectionPixel, type DetectionPixelProps } from '@serge-ai/react'\n\nexport { init, track, consent, pageview, DetectionPixel }\nexport type { InitOptions, ConsentValue, DetectionPixelProps }\n\nexport interface AnalyticsProps extends InitOptions {\n /** Public token from the Serge dashboard (`srg_pub_*`). */\n token: string\n}\n\nfunction AnalyticsInner({ token, ...options }: AnalyticsProps): null {\n const pathname = usePathname()\n const search = useSearchParams()\n\n /* One-time init on mount. Same pattern as the plain React component. */\n useEffect(() => {\n init(token, options)\n /* eslint-disable-next-line react-hooks/exhaustive-deps */\n }, [token])\n\n /* App Router fires usePathname/useSearchParams updates on every\n * navigation. Emit a pageview event so the timeline is accurate.\n * The core `pageview()` is a no-op until init() finishes; the\n * effect order here (init mounted before navigation effects)\n * means the first navigation after mount is captured by the\n * regular session_start path, not by this effect. Subsequent\n * navigations route through here. */\n useEffect(() => {\n if (typeof window === 'undefined') return\n pageview()\n /* eslint-disable-next-line react-hooks/exhaustive-deps */\n }, [pathname, search?.toString()])\n\n return null\n}\n\n/**\n * Next.js App Router wrapper. Wraps the inner component in `<Suspense>`\n * because `useSearchParams` triggers dynamic-rendering bailout on its\n * nearest non-Suspense parent, which would force the whole layout into\n * dynamic rendering on every request. With Suspense it only bails out\n * the (zero-DOM) inner component, preserving static rendering for the\n * rest of the page.\n *\n * The component returns null at runtime — the React 19 / 18 ReactNode\n * incompatibility around children typing is sidestepped by a single\n * cast (Vercel uses the same trick in @vercel/analytics/next).\n */\nexport function Analytics(props: AnalyticsProps): null {\n return (\n <Suspense fallback={null}>\n <AnalyticsInner {...props} />\n </Suspense>\n ) as never\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@serge-ai/nextjs",
3
+ "version": "0.2.0",
4
+ "description": "Serge for Next.js — App Router-aware <Analytics /> + <DetectionPixel /> with auto pageview tracking on route changes.",
5
+ "license": "MIT",
6
+ "homepage": "https://serge.ai",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/SuperstellarLLC/heyserge.git",
10
+ "directory": "packages/nextjs"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/SuperstellarLLC/heyserge/issues"
14
+ },
15
+ "keywords": [
16
+ "next",
17
+ "nextjs",
18
+ "next.js",
19
+ "vercel",
20
+ "analytics",
21
+ "tracking",
22
+ "agent",
23
+ "ai-agent",
24
+ "ssr",
25
+ "cookieless",
26
+ "app-router"
27
+ ],
28
+ "type": "module",
29
+ "main": "./dist/index.cjs",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "sideEffects": false,
33
+ "exports": {
34
+ "./package.json": "./package.json",
35
+ ".": {
36
+ "import": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./dist/index.js"
39
+ },
40
+ "require": {
41
+ "types": "./dist/index.d.cts",
42
+ "default": "./dist/index.cjs"
43
+ }
44
+ }
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "README.md",
49
+ "LICENSE"
50
+ ],
51
+ "dependencies": {
52
+ "@serge-ai/js": "0.2.0",
53
+ "@serge-ai/react": "0.2.0"
54
+ },
55
+ "peerDependencies": {
56
+ "next": ">=14",
57
+ "react": "^18 || ^19"
58
+ },
59
+ "devDependencies": {
60
+ "@size-limit/preset-small-lib": "^11.1.0",
61
+ "@types/react": "^19.0.0",
62
+ "next": "^16.1.6",
63
+ "react": "^19.0.0",
64
+ "size-limit": "^11.1.0",
65
+ "tsup": "^8.3.5",
66
+ "typescript": "^5.8.2",
67
+ "vitest": "^3.1.1"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "scripts": {
73
+ "build": "tsup",
74
+ "test": "vitest run --config ./vitest.config.ts --passWithNoTests",
75
+ "typecheck": "tsc --noEmit",
76
+ "size": "size-limit"
77
+ }
78
+ }