@clicklore/react 0.0.0-stage → 0.1.1

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 Pawel Lisowski
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 CHANGED
@@ -1,3 +1,141 @@
1
- # Temporary Holding Version
1
+ # @clicklore/react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React, Next.js and React Router bindings for Clicklore. The package re-exports the whole browser SDK
4
+ (`track`, `identify`, `init`, `clicklore`, …), so apps import from `@clicklore/react` only and share
5
+ one SDK instance.
6
+
7
+ ```sh
8
+ npm install @clicklore/browser @clicklore/react
9
+ ```
10
+
11
+ `@clicklore/browser` is a peer dependency. Use the same version for both Clicklore packages.
12
+ Requires React 18 or newer. The Next.js integration targets Next.js 16 or newer.
13
+
14
+ ## React with Vite
15
+
16
+ Wrap the app in the provider in `src/main.tsx`. Replace the key and host with your project's
17
+ public key and the base URL of your Clicklore deployment.
18
+
19
+ ```tsx
20
+ import { ClickloreProvider } from '@clicklore/react';
21
+ import { createRoot } from 'react-dom/client';
22
+ import App from './App';
23
+
24
+ createRoot(document.getElementById('root')!).render(
25
+ <ClickloreProvider projectKey="cl_…" host="https://ingest.example.com">
26
+ <App />
27
+ </ClickloreProvider>,
28
+ );
29
+ ```
30
+
31
+ The provider initializes the SDK once on the client (config changes after the first render are
32
+ ignored). Pass `user={{ id: user.id, traits: { plan: user.plan } }}` to sync your signed-in user.
33
+ After identification, changing the prop to `null` resets the visitor identity. Switching users
34
+ also resets it before identifying the new user.
35
+
36
+ Use the API in components:
37
+
38
+ ```tsx
39
+ import { useClicklore } from '@clicklore/react';
40
+
41
+ function ExportButton() {
42
+ const { track } = useClicklore();
43
+ return <button onClick={() => track('export-report', { format: 'csv' })}>Export</button>;
44
+ }
45
+ ```
46
+
47
+ `useClicklore()` returns the SDK's `clicklore` object (`track`, `identify`, `group`, `reset`,
48
+ `setRoute`, `optIn`, `optOut`, `flush`, `shutdown`, `getAnonymousId`, `getSessionId`). Calls made
49
+ before the provider initializes are queued and replayed.
50
+
51
+ ## React Router
52
+
53
+ Route patterns (`/projects/:id`) group pages better than the SDK's path heuristics. With
54
+ `<BrowserRouter>`, use `ClickloreRoutes` as a drop-in for `<Routes>`:
55
+
56
+ ```tsx
57
+ import { ClickloreRoutes } from '@clicklore/react/react-router';
58
+ import { Route } from 'react-router';
59
+
60
+ <ClickloreRoutes>
61
+ <Route path="/" element={<Home />} />
62
+ <Route path="/projects/:id" element={<Project />} />
63
+ </ClickloreRoutes>;
64
+ ```
65
+
66
+ With a data router (`createBrowserRouter`), call `useClickloreRoutes(routes)` with the same route
67
+ config in a component that stays mounted, such as the root route's layout. Both report the router
68
+ basename as part of the template. Requires React Router 6.4 or newer (an optional peer dependency).
69
+ Hash routing (`<HashRouter>`, `createHashRouter`) is not supported yet: the SDK keys pages on
70
+ `location.pathname`, so templates are not reported and a warning is logged once in development.
71
+ Descendant `<Routes>` inside a splat route report the parent's pattern (`/projects/*`).
72
+
73
+ ## Next.js App Router
74
+
75
+ ```tsx
76
+ // app/layout.tsx
77
+ import { Clicklore } from '@clicklore/react/next';
78
+ import type { ReactNode } from 'react';
79
+
80
+ export default function RootLayout({ children }: { children: ReactNode }) {
81
+ return (
82
+ <html lang="en">
83
+ <body>
84
+ <Clicklore projectKey="cl_…" host="https://ingest.example.com">
85
+ {children}
86
+ </Clicklore>
87
+ </body>
88
+ </html>
89
+ );
90
+ }
91
+ ```
92
+
93
+ `<Clicklore>` is `ClickloreProvider` plus `ClickloreNextRoutes`, which reports templates such as
94
+ `/projects/[id]` for every navigation. Pass `trackRoutes={false}` to leave routes to the SDK's
95
+ heuristics. `templateFromParams(pathname, params)` is also available from
96
+ `@clicklore/react/route`, an entry without `'use client'` that server components and route
97
+ handlers can call.
98
+
99
+ For component and source annotations in Vite or Next.js, install `@clicklore/annotate` as a dev
100
+ dependency and apply its bundler plugin. See the [annotation setup](https://github.com/clicklore/clicklore/tree/main/packages/annotate#readme).
101
+
102
+ ## Next.js Pages Router
103
+
104
+ Put `ClickloreProvider` in `pages/_app.tsx`. Automatic route templates from
105
+ `@clicklore/react/next` target the App Router. With the provider, Clicklore still captures page
106
+ views on pathname changes and guesses route templates. To supply the actual Pages Router template,
107
+ call `setRoute(router.pathname)` in a client effect after the router is ready and after navigation.
108
+ `withClicklore` can annotate JSX in both routers on Next.js 16+.
109
+
110
+ ```tsx
111
+ import { ClickloreProvider } from '@clicklore/react';
112
+ import type { AppProps } from 'next/app';
113
+
114
+ export default function App({ Component, pageProps }: AppProps) {
115
+ return (
116
+ <ClickloreProvider projectKey="cl_…" host="https://ingest.example.com">
117
+ <Component {...pageProps} />
118
+ </ClickloreProvider>
119
+ );
120
+ }
121
+ ```
122
+
123
+ ## Capture, privacy and hosting
124
+
125
+ The browser SDK collects page and session activity, clicks and impressions, form interactions,
126
+ errors, failed actions, slow interactions and copy signals by default. Field values require
127
+ `captureInputValues` or `data-cl-capture` on the field. Use `data-cl-mask` for sensitive element
128
+ text and values, or `data-cl-ignore` to skip the element's interactions.
129
+
130
+ Pass `requireConsent` to the provider or `<Clicklore>`, then call `optIn()` from your consent UI.
131
+ Use `optOut()` to withdraw consent or record a refusal. Pass a `sanitizeUrl` function to redact
132
+ app-specific path segments. In the App Router, define the function and pass it to `<Clicklore>`
133
+ in a client component.
134
+
135
+ Set `host` to your self-hosted base URL and include its origin in the app's CSP `connect-src`.
136
+ The SDK is part of your app's JavaScript and uses its `script-src` policy. See the
137
+ [browser SDK configuration and privacy controls](https://github.com/clicklore/clicklore/tree/main/packages/browser#configuration).
138
+
139
+ The root and `/route` entry points work with Node ESM and modern Node's `require(esm)`. The
140
+ `/next` entry point is for Next.js bundling. For Jest, use ESM support or transform these
141
+ packages along with your application dependencies.
@@ -0,0 +1,4 @@
1
+
2
+ import { a as ClickloreUser, i as ClickloreProviderProps, n as templateFromParams, o as useClicklore, r as ClickloreProvider, t as RouteParams } from "./route-BNtSxgAY.js";
3
+ import { CaptureOptions, ClickloreApi, ClickloreConfig, SDK_VERSION, clicklore, flush, getAnonymousId, getSessionId, group, identify, init, optIn, optOut, reset, setRoute, shutdown, track } from "@clicklore/browser";
4
+ export { type CaptureOptions, type ClickloreApi, type ClickloreConfig, ClickloreProvider, type ClickloreProviderProps, type ClickloreUser, type RouteParams, SDK_VERSION, clicklore, flush, getAnonymousId, getSessionId, group, identify, init, optIn, optOut, reset, setRoute, shutdown, templateFromParams, track, useClicklore };
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+ import { n as ClickloreProvider, r as useClicklore, t as templateFromParams } from "./route-CEH3idaL.js";
3
+ import { SDK_VERSION, clicklore, flush, getAnonymousId, getSessionId, group, identify, init, optIn, optOut, reset, setRoute, shutdown, track } from "@clicklore/browser";
4
+ export { ClickloreProvider, SDK_VERSION, clicklore, flush, getAnonymousId, getSessionId, group, identify, init, optIn, optOut, reset, setRoute, shutdown, templateFromParams, track, useClicklore };
package/dist/next.d.ts ADDED
@@ -0,0 +1,17 @@
1
+
2
+ import { i as ClickloreProviderProps, n as templateFromParams } from "./route-BNtSxgAY.js";
3
+ //#region src/next.d.ts
4
+ /** Reports Next.js route templates (`/projects/[id]`) instead of raw paths. */
5
+ export declare function ClickloreNextRoutes(): null;
6
+ export interface ClickloreNextProps extends ClickloreProviderProps {
7
+ /** Report App Router route templates. Default `true`; when off, the SDK guesses from the path. */
8
+ trackRoutes?: boolean;
9
+ }
10
+ /**
11
+ * Drop-in for the Next.js App Router root layout:
12
+ *
13
+ * <Clicklore projectKey="cl_…" host="https://…">{children}</Clicklore>
14
+ */
15
+ export declare function Clicklore({ children, trackRoutes, ...props }: ClickloreNextProps): import("react").JSX.Element;
16
+ //#endregion
17
+ export { templateFromParams };
package/dist/next.js ADDED
@@ -0,0 +1,31 @@
1
+ 'use client';
2
+ "use client";
3
+ import { n as ClickloreProvider, t as templateFromParams } from "./route-CEH3idaL.js";
4
+ import { setRoute } from "@clicklore/browser";
5
+ import { useEffect } from "react";
6
+ import { useParams, usePathname } from "next/navigation";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/next.tsx
9
+ /** Reports Next.js route templates (`/projects/[id]`) instead of raw paths. */
10
+ function ClickloreNextRoutes() {
11
+ const pathname = usePathname();
12
+ const params = useParams();
13
+ const template = pathname ? templateFromParams(pathname, params) : null;
14
+ useEffect(() => {
15
+ if (pathname && template) setRoute(template);
16
+ }, [pathname, template]);
17
+ return null;
18
+ }
19
+ /**
20
+ * Drop-in for the Next.js App Router root layout:
21
+ *
22
+ * <Clicklore projectKey="cl_…" host="https://…">{children}</Clicklore>
23
+ */
24
+ function Clicklore({ children, trackRoutes = true, ...props }) {
25
+ return /* @__PURE__ */ jsxs(ClickloreProvider, {
26
+ ...props,
27
+ children: [trackRoutes && /* @__PURE__ */ jsx(ClickloreNextRoutes, {}), children]
28
+ });
29
+ }
30
+ //#endregion
31
+ export { Clicklore, ClickloreNextRoutes, templateFromParams };
@@ -0,0 +1,21 @@
1
+
2
+ import { RouteObject, RoutesProps } from "react-router";
3
+ //#region src/react-router.d.ts
4
+ /** Joins the paths of matched routes: `/projects` + `:id` -> `/projects/:id`. */
5
+ export declare function routeTemplate(matches: ReadonlyArray<{
6
+ route: {
7
+ path?: string;
8
+ };
9
+ }>): string;
10
+ /**
11
+ * Reports the pattern of the route matching the current location (`/projects/:id`) for a route
12
+ * config, e.g. the one passed to `createBrowserRouter`. Call it once, in a component that stays
13
+ * mounted such as the root route's layout.
14
+ */
15
+ export declare function useClickloreRoutes(routes: RouteObject[]): void;
16
+ /**
17
+ * Drop-in for `<Routes>` that also reports the matched route pattern, so pages are grouped by
18
+ * route (`/projects/:id`) instead of by guessed path segments.
19
+ */
20
+ export declare function ClickloreRoutes({ children, location }: RoutesProps): import("react").JSX.Element;
21
+ //#endregion
@@ -0,0 +1,64 @@
1
+ 'use client';
2
+ "use client";
3
+ import { setRoute } from "@clicklore/browser";
4
+ import { useEffect } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { Routes, createRoutesFromChildren, matchRoutes, useHref, useLocation } from "react-router";
7
+ //#region src/react-router.tsx
8
+ /** Joins the paths of matched routes: `/projects` + `:id` -> `/projects/:id`. */
9
+ function routeTemplate(matches) {
10
+ let template = "";
11
+ for (const { route } of matches) {
12
+ if (!route.path) continue;
13
+ template = route.path.startsWith("/") ? route.path : `${template}/${route.path}`;
14
+ }
15
+ return template.replace(/\/{2,}/g, "/").replace(/(.)\/$/, "$1") || "/";
16
+ }
17
+ let warned = false;
18
+ function isDev() {
19
+ try {
20
+ return true;
21
+ } catch {
22
+ return false;
23
+ }
24
+ }
25
+ /**
26
+ * Reports the pattern of the route matching the current location (`/projects/:id`) for a route
27
+ * config, e.g. the one passed to `createBrowserRouter`. Call it once, in a component that stays
28
+ * mounted such as the root route's layout.
29
+ */
30
+ function useClickloreRoutes(routes) {
31
+ const { pathname } = useLocation();
32
+ const base = useHref("/");
33
+ const matches = matchRoutes(routes, pathname);
34
+ const template = matches ? routeTemplate(matches) : null;
35
+ useEffect(() => {
36
+ if (!template) return;
37
+ if (base.includes("#")) {
38
+ if (isDev() && !warned) {
39
+ warned = true;
40
+ console.warn("[clicklore] Hash routing is not supported yet; route templates are not reported.");
41
+ }
42
+ return;
43
+ }
44
+ const prefix = base.endsWith("/") ? base.slice(0, -1) : base;
45
+ setRoute(template === "/" ? prefix || "/" : `${prefix}${template}`);
46
+ }, [
47
+ base,
48
+ pathname,
49
+ template
50
+ ]);
51
+ }
52
+ /**
53
+ * Drop-in for `<Routes>` that also reports the matched route pattern, so pages are grouped by
54
+ * route (`/projects/:id`) instead of by guessed path segments.
55
+ */
56
+ function ClickloreRoutes({ children, location }) {
57
+ useClickloreRoutes(createRoutesFromChildren(children));
58
+ return /* @__PURE__ */ jsx(Routes, {
59
+ location,
60
+ children
61
+ });
62
+ }
63
+ //#endregion
64
+ export { ClickloreRoutes, routeTemplate, useClickloreRoutes };
@@ -0,0 +1,34 @@
1
+
2
+ import { ClickloreApi, ClickloreConfig } from "@clicklore/browser";
3
+ import { ReactNode } from "react";
4
+ //#region src/provider.d.ts
5
+ interface ClickloreUser {
6
+ id: string;
7
+ traits?: Record<string, unknown>;
8
+ }
9
+ interface ClickloreProviderProps extends ClickloreConfig {
10
+ /**
11
+ * The signed-in user. Passing `null` after a user was set calls `reset()` (logout); switching
12
+ * straight to another user resets first, so they don't share an anonymous id or session.
13
+ */
14
+ user?: ClickloreUser | null;
15
+ children?: ReactNode;
16
+ }
17
+ /**
18
+ * Initialises Clicklore once on the client and keeps the identified user in sync.
19
+ * Config changes after the first render are ignored (initialisation is one-shot).
20
+ */
21
+ declare function ClickloreProvider({ user, children, ...config }: ClickloreProviderProps): ReactNode;
22
+ /** Stable access to the Clicklore API inside components. */
23
+ declare function useClicklore(): ClickloreApi;
24
+ //#endregion
25
+ //#region src/route.d.ts
26
+ type RouteParams = Record<string, string | string[] | undefined>;
27
+ /**
28
+ * Rebuilds a Next.js-style route template from a pathname and its dynamic params:
29
+ * `/projects/42/settings` + `{ id: '42' }` -> `/projects/[id]/settings`;
30
+ * catch-all params (`string[]`) become `[...name]`.
31
+ */
32
+ declare function templateFromParams(pathname: string, params: RouteParams | null): string;
33
+ //#endregion
34
+ export { ClickloreUser as a, ClickloreProviderProps as i, templateFromParams as n, useClicklore as o, ClickloreProvider as r, RouteParams as t };
@@ -0,0 +1,92 @@
1
+ 'use client';
2
+ import { clicklore, identify, init, reset } from "@clicklore/browser";
3
+ import { useEffect, useRef } from "react";
4
+ //#region src/provider.tsx
5
+ /**
6
+ * Compares traits by value, so an inline `traits` object doesn't re-identify on every render.
7
+ * Values JSON can't encode (BigInt, cycles) fall back to comparing the object reference.
8
+ */
9
+ function traitsKey(traits) {
10
+ if (!traits) return "";
11
+ try {
12
+ return JSON.stringify(traits);
13
+ } catch {
14
+ return traits;
15
+ }
16
+ }
17
+ /**
18
+ * Initialises Clicklore once on the client and keeps the identified user in sync.
19
+ * Config changes after the first render are ignored (initialisation is one-shot).
20
+ */
21
+ function ClickloreProvider({ user, children, ...config }) {
22
+ const configRef = useRef(config);
23
+ useEffect(() => {
24
+ init(configRef.current);
25
+ }, []);
26
+ const userId = user?.id ?? null;
27
+ const traits = user?.traits;
28
+ const key = traitsKey(traits);
29
+ const synced = useRef({
30
+ id: null,
31
+ key: ""
32
+ });
33
+ useEffect(() => {
34
+ const last = synced.current;
35
+ if (last.id === userId && last.key === key) return;
36
+ if (last.id && last.id !== userId) reset();
37
+ if (userId) identify(userId, traits);
38
+ synced.current = {
39
+ id: userId,
40
+ key
41
+ };
42
+ }, [userId, key]);
43
+ return children;
44
+ }
45
+ /** Stable access to the Clicklore API inside components. */
46
+ function useClicklore() {
47
+ return clicklore;
48
+ }
49
+ //#endregion
50
+ //#region src/route.ts
51
+ const REMOVED = "\0";
52
+ function safeDecode(s) {
53
+ try {
54
+ return decodeURIComponent(s);
55
+ } catch {
56
+ return s;
57
+ }
58
+ }
59
+ function size(value) {
60
+ return Array.isArray(value) ? value.length : 1;
61
+ }
62
+ /**
63
+ * Rebuilds a Next.js-style route template from a pathname and its dynamic params:
64
+ * `/projects/42/settings` + `{ id: '42' }` -> `/projects/[id]/settings`;
65
+ * catch-all params (`string[]`) become `[...name]`.
66
+ */
67
+ function templateFromParams(pathname, params) {
68
+ if (!params) return pathname;
69
+ const segments = pathname.split("/");
70
+ const out = [...segments];
71
+ const claimed = /* @__PURE__ */ new Set();
72
+ const entries = Object.entries(params).filter((e) => e[1] !== void 0 && size(e[1]) > 0 && e[1] !== "");
73
+ entries.sort((a, b) => size(b[1]) - size(a[1]));
74
+ for (const [name, value] of entries) {
75
+ const parts = Array.isArray(value) ? value : [value];
76
+ for (let i = 1; i + parts.length <= segments.length; i++) {
77
+ if (!parts.every((part, j) => {
78
+ const seg = segments[i + j];
79
+ return !claimed.has(i + j) && (seg === part || safeDecode(seg) === part);
80
+ })) continue;
81
+ out[i] = Array.isArray(value) ? `[...${name}]` : `[${name}]`;
82
+ for (let j = 0; j < parts.length; j++) {
83
+ claimed.add(i + j);
84
+ if (j > 0) out[i + j] = REMOVED;
85
+ }
86
+ break;
87
+ }
88
+ }
89
+ return out.filter((s) => s !== REMOVED).join("/") || "/";
90
+ }
91
+ //#endregion
92
+ export { ClickloreProvider as n, useClicklore as r, templateFromParams as t };
@@ -0,0 +1,9 @@
1
+ //#region src/route.d.ts
2
+ export type RouteParams = Record<string, string | string[] | undefined>;
3
+ /**
4
+ * Rebuilds a Next.js-style route template from a pathname and its dynamic params:
5
+ * `/projects/42/settings` + `{ id: '42' }` -> `/projects/[id]/settings`;
6
+ * catch-all params (`string[]`) become `[...name]`.
7
+ */
8
+ export declare function templateFromParams(pathname: string, params: RouteParams | null): string;
9
+ //#endregion
package/dist/route.js ADDED
@@ -0,0 +1,43 @@
1
+ //#region src/route.ts
2
+ const REMOVED = "\0";
3
+ function safeDecode(s) {
4
+ try {
5
+ return decodeURIComponent(s);
6
+ } catch {
7
+ return s;
8
+ }
9
+ }
10
+ function size(value) {
11
+ return Array.isArray(value) ? value.length : 1;
12
+ }
13
+ /**
14
+ * Rebuilds a Next.js-style route template from a pathname and its dynamic params:
15
+ * `/projects/42/settings` + `{ id: '42' }` -> `/projects/[id]/settings`;
16
+ * catch-all params (`string[]`) become `[...name]`.
17
+ */
18
+ function templateFromParams(pathname, params) {
19
+ if (!params) return pathname;
20
+ const segments = pathname.split("/");
21
+ const out = [...segments];
22
+ const claimed = /* @__PURE__ */ new Set();
23
+ const entries = Object.entries(params).filter((e) => e[1] !== void 0 && size(e[1]) > 0 && e[1] !== "");
24
+ entries.sort((a, b) => size(b[1]) - size(a[1]));
25
+ for (const [name, value] of entries) {
26
+ const parts = Array.isArray(value) ? value : [value];
27
+ for (let i = 1; i + parts.length <= segments.length; i++) {
28
+ if (!parts.every((part, j) => {
29
+ const seg = segments[i + j];
30
+ return !claimed.has(i + j) && (seg === part || safeDecode(seg) === part);
31
+ })) continue;
32
+ out[i] = Array.isArray(value) ? `[...${name}]` : `[${name}]`;
33
+ for (let j = 0; j < parts.length; j++) {
34
+ claimed.add(i + j);
35
+ if (j > 0) out[i + j] = REMOVED;
36
+ }
37
+ break;
38
+ }
39
+ }
40
+ return out.filter((s) => s !== REMOVED).join("/") || "/";
41
+ }
42
+ //#endregion
43
+ export { templateFromParams };
package/package.json CHANGED
@@ -1,6 +1,85 @@
1
1
  {
2
2
  "name": "@clicklore/react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "license": "MIT",
5
+ "description": "React, Next.js and React Router bindings for Clicklore.",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/clicklore/clicklore.git",
11
+ "directory": "packages/react"
12
+ },
13
+ "homepage": "https://github.com/clicklore/clicklore/tree/main/packages/react#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/clicklore/clicklore/issues"
16
+ },
17
+ "keywords": [
18
+ "analytics",
19
+ "react",
20
+ "nextjs",
21
+ "react-router",
22
+ "product-analytics"
23
+ ],
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js",
28
+ "default": "./dist/index.js"
29
+ },
30
+ "./next": {
31
+ "types": "./dist/next.d.ts",
32
+ "import": "./dist/next.js",
33
+ "default": "./dist/next.js"
34
+ },
35
+ "./react-router": {
36
+ "types": "./dist/react-router.d.ts",
37
+ "import": "./dist/react-router.js",
38
+ "default": "./dist/react-router.js"
39
+ },
40
+ "./route": {
41
+ "types": "./dist/route.d.ts",
42
+ "import": "./dist/route.js",
43
+ "default": "./dist/route.js"
44
+ }
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "peerDependencies": {
53
+ "next": ">=16",
54
+ "react": ">=18",
55
+ "react-router": ">=6.4",
56
+ "@clicklore/browser": "^0.1.1"
57
+ },
58
+ "peerDependenciesMeta": {
59
+ "next": {
60
+ "optional": true
61
+ },
62
+ "react-router": {
63
+ "optional": true
64
+ }
65
+ },
66
+ "devDependencies": {
67
+ "@testing-library/dom": "10.4.2",
68
+ "@testing-library/react": "16.3.3",
69
+ "@types/react": "19.3.0",
70
+ "@types/react-dom": "19.3.0",
71
+ "happy-dom": "20.14.6",
72
+ "next": "16.4.5",
73
+ "react": "19.3.0",
74
+ "react-dom": "19.3.0",
75
+ "react-router": "8.4.0",
76
+ "tsdown": "0.23.0",
77
+ "vitest": "5.0.3",
78
+ "@clicklore/browser": "^0.1.1"
79
+ },
80
+ "scripts": {
81
+ "build": "tsdown",
82
+ "typecheck": "tsc --noEmit",
83
+ "test": "vitest run"
84
+ }
6
85
  }