@nexly/react-web 0.16.2 → 1.0.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/README.md +1 -0
- package/dist/nexly-provider.d.ts +8 -1
- package/dist/nexly-provider.d.ts.map +1 -1
- package/dist/nexly-provider.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ function App() {
|
|
|
44
44
|
- **`appId`**, **`ingestKey`** — required strings (`ingestKey` is the ingest API token; not named `key` because that is reserved in React).
|
|
45
45
|
- **`autoPageView`** (default `false`) — when a client exists, send one pageview on mount.
|
|
46
46
|
- **`autoEngagement`** (default `false`) — when **`true`** and a client exists (all three strings non-empty after trim), attach engagement listeners; otherwise no-op. Cleanup on unmount or when the client or flag changes. The underlying `startEngagement()` is idempotent, so double-mounts (StrictMode, HMR) don't produce duplicate listeners.
|
|
47
|
+
- **`privacyMode`** (default `false`) — never read or write `localStorage` for visitor / session identifiers. The Nexly collector derives a daily-rotating visit fingerprint server-side instead; supply your own IDs with `setVisitorId()` / `setSessionId()` from `@nexly/web` when you need stable cross-visit identity. See the [`@nexly/web` README](https://www.npmjs.com/package/@nexly/web) for details.
|
|
47
48
|
|
|
48
49
|
### Opting elements out of auto-capture
|
|
49
50
|
|
package/dist/nexly-provider.d.ts
CHANGED
|
@@ -26,9 +26,16 @@ export type NexlyProviderProps = {
|
|
|
26
26
|
* change/unmount.
|
|
27
27
|
*/
|
|
28
28
|
autoOutboundLinks?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Privacy mode: never read or write `localStorage` for visitor / session
|
|
31
|
+
* identifiers. Without a manual `setVisitorId()` / `setSessionId()` the
|
|
32
|
+
* collector derives a daily-rotating visit fingerprint server-side.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
privacyMode?: boolean;
|
|
29
36
|
children: ReactNode;
|
|
30
37
|
};
|
|
31
|
-
export declare function NexlyProvider({ collectUrl, appId, ingestKey, autoPageView, autoEngagement, autoOutboundLinks, children, }: NexlyProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function NexlyProvider({ collectUrl, appId, ingestKey, autoPageView, autoEngagement, autoOutboundLinks, privacyMode, children, }: NexlyProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
39
|
/** Returns the configured {@link Nexly} client, or `null` if credentials are incomplete. Must be used under {@link NexlyProvider}. */
|
|
33
40
|
export declare function useNexlyClient(): Nexly | null;
|
|
34
41
|
//# sourceMappingURL=nexly-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nexly-provider.d.ts","sourceRoot":"","sources":["../src/nexly-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrF;;;;;;GAMG;AAEH,eAAO,MAAM,2BAA2B,sCAAgD,CAAA;AAExF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,8FAA8F;IAC9F,SAAS,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,+HAA+H;IAC/H,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,KAAK,EACL,SAAS,EACT,YAAoB,EACpB,cAAsB,EACtB,iBAAyB,EACzB,QAAQ,GACT,EAAE,kBAAkB,2CAkCpB;AAED,sIAAsI;AACtI,wBAAgB,cAAc,IAAI,KAAK,GAAG,IAAI,CAE7C"}
|
|
1
|
+
{"version":3,"file":"nexly-provider.d.ts","sourceRoot":"","sources":["../src/nexly-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAIrF;;;;;;GAMG;AAEH,eAAO,MAAM,2BAA2B,sCAAgD,CAAA;AAExF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,8FAA8F;IAC9F,SAAS,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,+HAA+H;IAC/H,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,KAAK,EACL,SAAS,EACT,YAAoB,EACpB,cAAsB,EACtB,iBAAyB,EACzB,WAAmB,EACnB,QAAQ,GACT,EAAE,kBAAkB,2CAkCpB;AAED,sIAAsI;AACtI,wBAAgB,cAAc,IAAI,KAAK,GAAG,IAAI,CAE7C"}
|
package/dist/nexly-provider.js
CHANGED
|
@@ -12,7 +12,7 @@ const NexlyClientContext = createContext(null);
|
|
|
12
12
|
*/
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14
14
|
export const _NexlyClientIdentityContext = createContext(NexlyClient.React);
|
|
15
|
-
export function NexlyProvider({ collectUrl, appId, ingestKey, autoPageView = false, autoEngagement = false, autoOutboundLinks = false, children, }) {
|
|
15
|
+
export function NexlyProvider({ collectUrl, appId, ingestKey, autoPageView = false, autoEngagement = false, autoOutboundLinks = false, privacyMode = false, children, }) {
|
|
16
16
|
const clientId = useContext(_NexlyClientIdentityContext);
|
|
17
17
|
const nexly = useMemo(() => {
|
|
18
18
|
const id = (appId ?? '').trim();
|
|
@@ -24,8 +24,8 @@ export function NexlyProvider({ collectUrl, appId, ingestKey, autoPageView = fal
|
|
|
24
24
|
console.warn('[Nexly] Missing ingestKey — tracking is disabled.');
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
|
-
return Nexly.init({ collectUrl, appId: id, key: k, client: clientId });
|
|
28
|
-
}, [collectUrl, appId, ingestKey, clientId]);
|
|
27
|
+
return Nexly.init({ collectUrl, appId: id, key: k, client: clientId, privacyMode });
|
|
28
|
+
}, [collectUrl, appId, ingestKey, clientId, privacyMode]);
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
if (autoPageView && nexly) {
|
|
31
31
|
nexly.pageview();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexly/react-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "React bindings for Nexly (@nexly/web): provider, client hook, engagement, optional auto pageview",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react": "^18.0.0 || ^19.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@nexly/web": "0.
|
|
42
|
+
"@nexly/web": "1.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/react": "^19.2.14",
|