@interfere/vite 12.0.0 → 12.0.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 CHANGED
@@ -219,7 +219,7 @@ Identity is automatically cleared when the SDK is closed. Call `identity.clear()
219
219
 
220
220
  ## Consent Management
221
221
 
222
- By default, all SDK features are active. To gate features behind user consent, pass a `consent` prop to the provider:
222
+ Omitting consent preserves the SDK defaults. To deny analytics and replay from startup, pass `consent: false` to `init()` before mounting the provider. Use the provider’s `consent` prop to keep the current decision synchronized:
223
223
 
224
224
  ```tsx
225
225
  import { InterfereProvider } from "@interfere/vite/provider";
@@ -241,7 +241,7 @@ function App() {
241
241
  | `analytics` | Page events, rage clicks, fingerprint | Yes |
242
242
  | `replay` | Session replay | Yes |
243
243
 
244
- Omitting the `consent` prop preserves consent supplied to `init()`, including later updates through `consent.set()`. If no initial consent was supplied, omitting the prop allows all features. Passing the prop enables only `necessary` plugins and explicitly consented categories.
244
+ Omitting the `consent` prop preserves consent supplied to `init()`, including later updates through `consent.set()`. If no initial consent was supplied, omitting the prop allows all features. Consent controls analytics and replay permission; it does not enable plugins disabled in configuration. Objects replace the current decision, and omitted categories remain allowed. Errors, logs, tracing, and session storage are not disabled by this setting.
245
245
 
246
246
  ### Imperative API
247
247
 
@@ -250,11 +250,14 @@ Use `consent.set()` and `consent.get()` from the `useInterfere` hook:
250
250
  ```tsx
251
251
  const { consent } = useInterfere();
252
252
 
253
- consent.set({ analytics: true, replay: true }); // selective
254
- consent.set(); // grant all
255
- consent.get(); // current state, or null if no gating
253
+ consent.set(false);
254
+ consent.set(true);
255
+ consent.set({ analytics: true, replay: false });
256
+ consent.get();
256
257
  ```
257
258
 
259
+ These values describe permission **now**, not features to enable after a future consent action. `true` allows both categories and `false` denies both. Connect your consent manager's updates to `consent.set()`, passing both booleans for granular decisions. `consent.get()` returns the resolved category object, or `null` when no gating is applied. Calling `consent.set()` without a value removes gating; it does not record a visitor's acceptance.
260
+
258
261
  ### Initial consent via init
259
262
 
260
263
  To set consent before React renders (avoiding any window where non-consented plugins might load), pass it to `init()` directly instead of using `auto`:
@@ -262,7 +265,7 @@ To set consent before React renders (avoiding any window where non-consented plu
262
265
  ```ts
263
266
  import { init } from "@interfere/vite/init";
264
267
 
265
- init({ consent: { analytics: false, replay: false } });
268
+ await init({ consent: false });
266
269
  ```
267
270
 
268
271
  The provider's `consent` prop will then keep it in sync as the user updates their preferences.
package/dist/init.d.mts CHANGED
@@ -1,15 +1,15 @@
1
1
  import { capture, span } from "@interfere/react/api";
2
2
  import { Kernel, KernelOptions, KernelOptions as KernelOptions$1 } from "@interfere/react/internal/kernel";
3
- import { ConsentCategory, ConsentState, GateableCategory } from "@interfere/types/sdk/plugins/manifest";
3
+ import { ConsentCategory, ConsentInput, ConsentState, GateableCategory } from "@interfere/types/sdk/plugins/manifest";
4
4
  //#region src/init.d.ts
5
5
  export declare function init(opts?: KernelOptions$1): Promise<import("@interfere/react/internal/kernel").Kernel | null>;
6
6
  export declare const close: () => Promise<void>, consent: {
7
7
  get: () => import("@interfere/types/sdk/plugins/manifest").ConsentState | null;
8
- set: (value?: import("@interfere/types/sdk/plugins/manifest").ConsentState) => void;
8
+ set: (value?: import("@interfere/types/sdk/plugins/manifest").ConsentInput) => void;
9
9
  }, getKernel: () => import("@interfere/react/internal/kernel").Kernel, getKernelOrNull: () => import("@interfere/react/internal/kernel").Kernel | null, identity: {
10
10
  clear: () => void;
11
11
  get: () => import("@interfere/types/sdk/identify").IdentifyParams | null;
12
12
  set: (params: import("@interfere/types/sdk/identify").IdentifyParams) => Promise<void>;
13
13
  }, subscribeToKernel: (listener: () => void) => () => void;
14
14
  //#endregion
15
- export { type ConsentCategory, type ConsentState, type GateableCategory, type Kernel, type KernelOptions, capture, span };
15
+ export { type ConsentCategory, type ConsentInput, type ConsentState, type GateableCategory, type Kernel, type KernelOptions, capture, span };
package/dist/package.mjs CHANGED
@@ -1 +1 @@
1
- var name=`@interfere/vite`,version=`12.0.0`;export{name,version};
1
+ var name=`@interfere/vite`,version=`12.0.2`;export{name,version};
@@ -1,9 +1,9 @@
1
1
  import { PluginOverrides, useInterfere, useSession } from "@interfere/react/provider";
2
2
  import { PropsWithChildren } from "react";
3
- import { ConsentCategory, ConsentState, ConsentState as ConsentState$1, GateableCategory } from "@interfere/types/sdk/plugins/manifest";
3
+ import { ConsentCategory, ConsentInput, ConsentInput as ConsentInput$1, ConsentState, GateableCategory } from "@interfere/types/sdk/plugins/manifest";
4
4
  //#region src/provider.d.ts
5
5
  interface InterfereProviderProps extends PropsWithChildren {
6
- consent?: ConsentState$1 | undefined;
6
+ consent?: ConsentInput$1 | undefined;
7
7
  errorBoundary?: boolean;
8
8
  plugins?: PluginOverrides | undefined;
9
9
  }
@@ -13,4 +13,4 @@ interface InterfereProviderProps extends PropsWithChildren {
13
13
  */
14
14
  export declare function InterfereProvider({ children, consent, plugins, errorBoundary }: InterfereProviderProps): import("react").JSX.Element;
15
15
  //#endregion
16
- export { type ConsentCategory, type ConsentState, type GateableCategory, useInterfere, useSession };
16
+ export { type ConsentCategory, type ConsentInput, type ConsentState, type GateableCategory, useInterfere, useSession };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interfere/vite",
3
- "version": "12.0.0",
3
+ "version": "12.0.2",
4
4
  "description": "Vite build plugin and client + server initialization for Interfere.",
5
5
  "keywords": [
6
6
  "error-tracking",
@@ -58,16 +58,16 @@
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsdown",
61
- "test": "vitest run",
62
- "typecheck": "tsc --noEmit"
61
+ "test": "vitest run --config ../../../../vitest.config.ts",
62
+ "typecheck": "bun check"
63
63
  },
64
64
  "dependencies": {
65
- "@interfere/build": "^0.2.0",
65
+ "@interfere/build": "^0.2.2",
66
66
  "@interfere/constants": "^9.1.0",
67
67
  "@interfere/helpers": "^9.2.0",
68
- "@interfere/javascript": "^0.2.0",
69
- "@interfere/react": "^12.0.0",
70
- "@interfere/types": "^10.2.0",
68
+ "@interfere/javascript": "^0.2.1",
69
+ "@interfere/react": "^12.0.2",
70
+ "@interfere/types": "^10.2.1",
71
71
  "@opentelemetry/api": "^1.9.1",
72
72
  "@opentelemetry/api-logs": "^0.222.0",
73
73
  "@opentelemetry/baggage-span-processor": "^0.5.0",
@@ -82,11 +82,15 @@
82
82
  "@opentelemetry/sdk-logs": "^0.222.0",
83
83
  "@opentelemetry/sdk-metrics": "^2.11.0",
84
84
  "@opentelemetry/sdk-trace-base": "^2.11.0",
85
- "@opentelemetry/sdk-trace-node": "^2.11.0"
85
+ "@opentelemetry/sdk-trace-node": "^2.11.0",
86
+ "zod": "^4.5.4"
86
87
  },
87
88
  "devDependencies": {
89
+ "@interfere/test-utils": "^10.0.0",
88
90
  "@interfere/typescript-config": "^9.0.2",
89
91
  "@interfere/vitest-config": "0.0.0",
92
+ "@jridgewell/trace-mapping": "^0.3.31",
93
+ "@playwright/test": "^1.63.0",
90
94
  "@tanstack/react-start": "1.168.49",
91
95
  "@types/node": "^26.4.1",
92
96
  "@types/react": "19.2.18",