@fingerly/next 0.1.2 → 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/README.md CHANGED
@@ -12,6 +12,11 @@ Tested against Next 16.
12
12
  pnpm add @fingerly/next
13
13
  ```
14
14
 
15
+ **Not for apps.** This binding runs the browser SDK, which collects nothing
16
+ inside an app's web view (Capacitor, Cordova, Ionic, React Native WebView,
17
+ `WKWebView`, Android `WebView`, Electron). Use the Fingerly iOS or Android SDK
18
+ in an app; see [docs/privacy.md §3.3](../../../docs/privacy.md).
19
+
15
20
  ## Configure
16
21
 
17
22
  Read the key in a Server Component and pass it down:
@@ -28,7 +33,7 @@ the browser through the RSC payload, which is where a public SDK key was
28
33
  always going to end up.
29
34
 
30
35
  The provider will also read `NEXT_PUBLIC_FINGERLY_API_KEY` and
31
- `NEXT_PUBLIC_FINGERLY_ENDPOINT` itself, but that path has a condition on it:
36
+ `NEXT_PUBLIC_FINGERLY_ENDPOINTS` itself, but that path has a condition on it:
32
37
  Next inlines `NEXT_PUBLIC_` variables **while compiling**, and it does not
33
38
  compile your dependencies. In a published build the read survives as a
34
39
  `process.env` lookup, and in a browser there is no `process`. The server
@@ -51,7 +56,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
51
56
  return (
52
57
  <html>
53
58
  <body>
54
- {/* consent="granted" only once you have consent (or another lawful basis) */}
59
+ {/* consent="granted" only once you have consent (or know none is required here; see docs/privacy.md §4) */}
55
60
  <FingerlyProvider apiKey={process.env.FINGERLY_API_KEY} consent="granted">
56
61
  {children}
57
62
  </FingerlyProvider>
package/dist/index.cjs CHANGED
@@ -38,12 +38,10 @@ var import_react = require("@fingerly/react");
38
38
  var import_jsx_runtime = require("react/jsx-runtime");
39
39
  function fromEnvironment() {
40
40
  const apiKey = typeof process === "undefined" ? void 0 : process.env.NEXT_PUBLIC_FINGERLY_API_KEY;
41
- const endpoint = typeof process === "undefined" ? void 0 : process.env.NEXT_PUBLIC_FINGERLY_ENDPOINT;
42
41
  const endpointsRaw = typeof process === "undefined" ? void 0 : process.env.NEXT_PUBLIC_FINGERLY_ENDPOINTS;
43
42
  const endpoints = endpointsRaw ? parsedEndpoints(endpointsRaw) : void 0;
44
43
  return {
45
44
  ...apiKey === void 0 || apiKey === "" ? {} : { apiKey },
46
- ...endpoint === void 0 || endpoint === "" ? {} : { endpoint },
47
45
  ...endpoints === void 0 ? {} : { endpoints }
48
46
  };
49
47
  }
@@ -68,7 +66,6 @@ function FingerlyProvider(props) {
68
66
  const environment = fromEnvironment();
69
67
  const apiKey = props.apiKey ?? environment.apiKey;
70
68
  const endpoints = props.endpoints ?? environment.endpoints;
71
- const endpoint = endpoints === void 0 ? props.endpoint ?? environment.endpoint : void 0;
72
69
  if (!apiKey && !reportedMissingKey) {
73
70
  reportedMissingKey = true;
74
71
  console.error(
@@ -79,7 +76,6 @@ function FingerlyProvider(props) {
79
76
  import_react.FingerlyProvider,
80
77
  {
81
78
  apiKey: apiKey ?? "",
82
- ...endpoint === void 0 ? {} : { endpoint },
83
79
  ...props.apiVersion === void 0 ? {} : { apiVersion: props.apiVersion },
84
80
  ...endpoints === void 0 ? {} : { endpoints },
85
81
  ...props.fallbackToDefaultEndpoint === void 0 ? {} : { fallbackToDefaultEndpoint: props.fallbackToDefaultEndpoint },
package/dist/index.d.cts CHANGED
@@ -10,10 +10,8 @@ export { R as REQUEST_ID_FIELD } from './field-name-CAkWsUa5.cjs';
10
10
  interface FingerlyNextProviderProps {
11
11
  /** Overrides `NEXT_PUBLIC_FINGERLY_API_KEY`. */
12
12
  apiKey?: string;
13
- /** Overrides `NEXT_PUBLIC_FINGERLY_ENDPOINT`. Defaults to production. */
14
13
  /** API route version. Defaults to v1. */
15
14
  apiVersion?: string;
16
- endpoint?: string;
17
15
  /** Ordered first-party endpoints; overrides NEXT_PUBLIC_FINGERLY_ENDPOINTS. */
18
16
  endpoints?: string | readonly string[];
19
17
  /** Opt into the Fingerly API after custom endpoints fail. */
package/dist/index.d.ts CHANGED
@@ -10,10 +10,8 @@ export { R as REQUEST_ID_FIELD } from './field-name-CAkWsUa5.js';
10
10
  interface FingerlyNextProviderProps {
11
11
  /** Overrides `NEXT_PUBLIC_FINGERLY_API_KEY`. */
12
12
  apiKey?: string;
13
- /** Overrides `NEXT_PUBLIC_FINGERLY_ENDPOINT`. Defaults to production. */
14
13
  /** API route version. Defaults to v1. */
15
14
  apiVersion?: string;
16
- endpoint?: string;
17
15
  /** Ordered first-party endpoints; overrides NEXT_PUBLIC_FINGERLY_ENDPOINTS. */
18
16
  endpoints?: string | readonly string[];
19
17
  /** Opt into the Fingerly API after custom endpoints fail. */
package/dist/index.js CHANGED
@@ -8,12 +8,10 @@ import { FingerlyProvider as ReactFingerlyProvider } from "@fingerly/react";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  function fromEnvironment() {
10
10
  const apiKey = typeof process === "undefined" ? void 0 : process.env.NEXT_PUBLIC_FINGERLY_API_KEY;
11
- const endpoint = typeof process === "undefined" ? void 0 : process.env.NEXT_PUBLIC_FINGERLY_ENDPOINT;
12
11
  const endpointsRaw = typeof process === "undefined" ? void 0 : process.env.NEXT_PUBLIC_FINGERLY_ENDPOINTS;
13
12
  const endpoints = endpointsRaw ? parsedEndpoints(endpointsRaw) : void 0;
14
13
  return {
15
14
  ...apiKey === void 0 || apiKey === "" ? {} : { apiKey },
16
- ...endpoint === void 0 || endpoint === "" ? {} : { endpoint },
17
15
  ...endpoints === void 0 ? {} : { endpoints }
18
16
  };
19
17
  }
@@ -38,7 +36,6 @@ function FingerlyProvider(props) {
38
36
  const environment = fromEnvironment();
39
37
  const apiKey = props.apiKey ?? environment.apiKey;
40
38
  const endpoints = props.endpoints ?? environment.endpoints;
41
- const endpoint = endpoints === void 0 ? props.endpoint ?? environment.endpoint : void 0;
42
39
  if (!apiKey && !reportedMissingKey) {
43
40
  reportedMissingKey = true;
44
41
  console.error(
@@ -49,7 +46,6 @@ function FingerlyProvider(props) {
49
46
  ReactFingerlyProvider,
50
47
  {
51
48
  apiKey: apiKey ?? "",
52
- ...endpoint === void 0 ? {} : { endpoint },
53
49
  ...props.apiVersion === void 0 ? {} : { apiVersion: props.apiVersion },
54
50
  ...endpoints === void 0 ? {} : { endpoints },
55
51
  ...props.fallbackToDefaultEndpoint === void 0 ? {} : { fallbackToDefaultEndpoint: props.fallbackToDefaultEndpoint },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fingerly/next",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,8 +32,8 @@
32
32
  ],
33
33
  "sideEffects": false,
34
34
  "dependencies": {
35
- "@fingerly/react": "0.1.1",
36
- "@fingerly/node": "0.1.2"
35
+ "@fingerly/node": "0.1.4",
36
+ "@fingerly/react": "0.2.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "next": ">=15",
@@ -49,7 +49,7 @@
49
49
  "tsup": "^8.3.5",
50
50
  "typescript": "^5.7.2",
51
51
  "vitest": "^2.1.8",
52
- "@fingerly/web-js": "0.1.1"
52
+ "@fingerly/web-js": "0.2.0"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "tsup",