@neon-pixels/consent 0.0.0 → 0.3.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 Neon Pixels Studio
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,77 @@
1
+ # @neon-pixels/consent
2
+
3
+ Analytics consent for the browser, with no framework and no runtime dependency. It keeps one choice for 180 days, treats a browser privacy signal as a refusal, and loads Google Analytics only when you ask it to. Banners stay in your app.
4
+
5
+ Importing the package touches no browser global, so it is safe during server rendering. Every browser object (`storage`, `navigator`, `window`, `document`) is passed in.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ pnpm add @neon-pixels/consent
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { createConsent, loadGoogleAnalytics } from "@neon-pixels/consent";
17
+
18
+ const consent = createConsent({
19
+ app: "my-site", // stored under "my-site:analytics-consent"
20
+ services: { analytics: { measurementId: "G-XXXXXXX" }, sessionReplay: true },
21
+ storage: window.localStorage,
22
+ navigator,
23
+ window,
24
+ // legacyKey: "old-key", // migrate an older key, if the app had one
25
+ });
26
+
27
+ consent.status; // "granted" | "denied" | "unset" | "signal"
28
+ consent.shouldPrompt; // show your banner
29
+ consent.services; // ["analytics", "sessionReplay"]: name only these in the banner
30
+
31
+ if (consent.status === "granted") {
32
+ loadGoogleAnalytics("G-XXXXXXX", { document, window });
33
+ }
34
+
35
+ consent.grant(); // then call loadGoogleAnalytics
36
+ consent.deny();
37
+ ```
38
+
39
+ If a privacy signal appears after an earlier grant, `status` becomes `signal`; call `deny()` to clear the old `_ga` cookies. `status` and `shouldPrompt` read storage each time, so they are always current.
40
+
41
+ ### Status
42
+
43
+ - `granted` / `denied`: a valid stored choice.
44
+ - `unset`: nothing stored, or the record is expired, malformed, or dated more than 180 days ahead.
45
+ - `signal`: Global Privacy Control, or Do Not Track set to `1` or `yes` on `navigator`, `window`, or `navigator.msDoNotTrack`. Nothing should load, `shouldPrompt` is false, and `grant()` does nothing.
46
+
47
+ `shouldPrompt` is also false when no service is configured.
48
+
49
+ ### Stored record
50
+
51
+ `{ "choice": "granted" | "denied", "expiresAt": <epoch ms> }` under `<app>:analytics-consent`, expiring 180 days after the choice. The older values `accepted` and `declined` (inside a record, as a bare string, or under `legacyKey`) are read and rewritten in the current form. A bare legacy value starts a fresh 180 days.
52
+
53
+ ### `deny()`
54
+
55
+ Stores the denial and sets `ga-disable-<measurementId>` for the page. When an earlier grant existed (current, expired, or made on this page), it also expires the `_ga` and `_ga_*` cookies on the host and each parent domain. IP addresses get no parent domains.
56
+
57
+ ### `loadGoogleAnalytics(measurementId, { document, window })`
58
+
59
+ Injects gtag.js once per window however often it is called, with Google signals and ad personalization turned off. It sends no Consent Mode commands: call it only after a grant. It defines no `window.gtag`: push to `window.dataLayer` yourself to send events. A second measurement id on the same window is configured without a second tag. Calling it again after `deny()` clears the disable flag without adding a second tag.
60
+
61
+ ### `hasPrivacySignal({ navigator, window })`
62
+
63
+ The signal check on its own.
64
+
65
+ ## Testing
66
+
67
+ ```ts
68
+ import {
69
+ createMemoryStorage,
70
+ stubPrivacySignal,
71
+ } from "@neon-pixels/consent/testing";
72
+
73
+ const storage = createMemoryStorage();
74
+ const navigator = stubPrivacySignal({ globalPrivacyControl: true });
75
+ ```
76
+
77
+ `stubPrivacySignal` returns a `navigator` stand-in with `doNotTrack` and `globalPrivacyControl`. `createMemoryStorage` is an in-memory storage with an `entries` map for assertions.
@@ -0,0 +1,58 @@
1
+ import { a as ConsentStatus, c as StoredConsent, i as ConsentServices, n as ConsentChoice, o as ConsentStorage, r as ConsentService, s as NavigatorSignals, t as BrowserWindow } from "./types-B818wSQH.js";
2
+ export declare const CONSENT_LIFETIME_DAYS = 180;
3
+ export declare const CONSENT_LIFETIME_MS: number;
4
+ export declare function consentStorageKey(app: string): string;
5
+ interface ConsentOptions {
6
+ /** Prefix of the storage key: `<app>:analytics-consent`. */
7
+ app: string;
8
+ services: ConsentServices;
9
+ storage: ConsentStorage;
10
+ navigator: NavigatorSignals;
11
+ window: BrowserWindow;
12
+ /** Milliseconds since the epoch. Defaults to `Date.now`. */
13
+ now?: () => number;
14
+ /** An older storage key to migrate from. */
15
+ legacyKey?: string;
16
+ }
17
+ interface Consent {
18
+ readonly status: ConsentStatus;
19
+ readonly shouldPrompt: boolean;
20
+ /** The services the app configured, so a banner names only those. */
21
+ readonly services: readonly ConsentService[];
22
+ /** Stores a grant. No effect while a privacy signal is present. */
23
+ grant(): ConsentStatus;
24
+ /** Stores a denial, switches analytics off for the page, and clears `_ga` cookies after an earlier grant. */
25
+ deny(): ConsentStatus;
26
+ }
27
+ export declare function createConsent(options: ConsentOptions): Consent;
28
+ /**
29
+ * True when the browser asks not to be tracked: Global Privacy Control, or Do
30
+ * Not Track set to `1` or `yes` on `navigator`, `window`, or `msDoNotTrack`.
31
+ */
32
+ export declare function hasPrivacySignal(browser: {
33
+ navigator: NavigatorSignals;
34
+ window: BrowserWindow;
35
+ }): boolean;
36
+ export declare const GTAG_SCRIPT_URL = "https://www.googletagmanager.com/gtag/js";
37
+ interface ScriptElementLike {
38
+ async: boolean;
39
+ src: string;
40
+ }
41
+ interface AnalyticsDocument {
42
+ createElement(tagName: "script"): ScriptElementLike;
43
+ head: {
44
+ appendChild(node: never): unknown;
45
+ };
46
+ }
47
+ interface AnalyticsBrowser {
48
+ document: AnalyticsDocument;
49
+ window: BrowserWindow;
50
+ }
51
+ /**
52
+ * Injects gtag.js once per window, however often it is called. Google signals
53
+ * and ad personalization are off. No Consent Mode commands are sent: the
54
+ * caller loads this only after a grant. A second, different measurement id on
55
+ * the same window is configured without a second tag.
56
+ */
57
+ export declare function loadGoogleAnalytics(measurementId: string, { document, window }: AnalyticsBrowser): void;
58
+ export type { AnalyticsBrowser, AnalyticsDocument, BrowserWindow, Consent, ConsentChoice, ConsentOptions, ConsentService, ConsentServices, ConsentStatus, ConsentStorage, NavigatorSignals, StoredConsent };
package/dist/index.js ADDED
@@ -0,0 +1,279 @@
1
+ // src/constants.ts
2
+ const CONSENT_LIFETIME_DAYS = 180;
3
+ const CONSENT_LIFETIME_MS = 15552e6;
4
+ function consentStorageKey(app) {
5
+ return `${app}:analytics-consent`;
6
+ }
7
+ // src/cookies.ts
8
+ const EXPIRED = "Thu, 01 Jan 1970 00:00:00 GMT";
9
+ const IPV4 = /^\d{1,3}(\.\d{1,3}){3}$/;
10
+ function isIpAddress(hostname) {
11
+ return IPV4.test(hostname) || hostname.includes(":");
12
+ }
13
+ /** The host and each parent domain below the top level: a.b.com gives a.b.com, b.com. */
14
+ function candidateDomains(hostname) {
15
+ const labels = hostname.split(".");
16
+ if (labels.length < 2) return [hostname];
17
+ return labels.slice(0, -1).map((_, index) => labels.slice(index).join("."));
18
+ }
19
+ function isGoogleAnalyticsCookie(name) {
20
+ return name === "_ga" || name.startsWith("_ga_");
21
+ }
22
+ function cookieNames(cookie) {
23
+ return cookie.split(";").map((pair) => pair.split("=")[0].trim()).filter(isGoogleAnalyticsCookie);
24
+ }
25
+ function expire(document, name, domain) {
26
+ const domainPart = domain === void 0 ? "" : `; domain=${domain}`;
27
+ document.cookie = `${name}=; expires=${EXPIRED}; max-age=0; path=/${domainPart}`;
28
+ }
29
+ function expireEverywhere(document, name, domains) {
30
+ expire(document, name);
31
+ for (const domain of domains) expire(document, name, domain);
32
+ }
33
+ /** Expires the `_ga` and `_ga_*` cookies on the host and each parent domain. IP hosts get no parent domains. */
34
+ function clearGoogleAnalyticsCookies(browserWindow) {
35
+ const { document, location } = browserWindow;
36
+ if (document === void 0) return;
37
+ const hostname = location?.hostname ?? "";
38
+ const domains = hostname === "" || isIpAddress(hostname) ? [] : candidateDomains(hostname);
39
+ for (const name of cookieNames(document.cookie)) expireEverywhere(document, name, domains);
40
+ }
41
+ // src/google-analytics.ts
42
+ const GTAG_SCRIPT_URL = "https://www.googletagmanager.com/gtag/js";
43
+ const configuredIds = /* @__PURE__ */ new WeakMap();
44
+ function disableFlagName(measurementId) {
45
+ return `ga-disable-${measurementId}`;
46
+ }
47
+ /** Sets the flag gtag.js checks before sending anything. */
48
+ function setAnalyticsDisabled(browserWindow, measurementId, disabled) {
49
+ browserWindow[disableFlagName(measurementId)] = disabled;
50
+ }
51
+ /** Switches off every measurement id this package configured on the window. */
52
+ function disableConfiguredAnalytics(browserWindow) {
53
+ for (const measurementId of configuredIds.get(browserWindow) ?? []) setAnalyticsDisabled(browserWindow, measurementId, true);
54
+ }
55
+ function queueCommand(dataLayer, ...args) {
56
+ function gtag(..._args) {
57
+ dataLayer.push(arguments);
58
+ }
59
+ gtag(...args);
60
+ }
61
+ /**
62
+ * Injects gtag.js once per window, however often it is called. Google signals
63
+ * and ad personalization are off. No Consent Mode commands are sent: the
64
+ * caller loads this only after a grant. A second, different measurement id on
65
+ * the same window is configured without a second tag.
66
+ */
67
+ function loadGoogleAnalytics(measurementId, { document, window }) {
68
+ setAnalyticsDisabled(window, measurementId, false);
69
+ const known = configuredIds.get(window);
70
+ if (known?.has(measurementId)) return;
71
+ if (known === void 0) appendScript(document, measurementId);
72
+ const target = window;
73
+ const dataLayer = target.dataLayer ??= [];
74
+ if (known === void 0) queueCommand(dataLayer, "js", /* @__PURE__ */ new Date());
75
+ queueCommand(dataLayer, "config", measurementId, {
76
+ allow_google_signals: false,
77
+ allow_ad_personalization_signals: false
78
+ });
79
+ configuredIds.set(window, (known ?? /* @__PURE__ */ new Set()).add(measurementId));
80
+ }
81
+ function appendScript(document, measurementId) {
82
+ const script = document.createElement("script");
83
+ script.async = true;
84
+ script.src = `${GTAG_SCRIPT_URL}?id=${encodeURIComponent(measurementId)}`;
85
+ document.head.appendChild(script);
86
+ }
87
+ // src/record.ts
88
+ const CHOICE_BY_STORED_VALUE = {
89
+ granted: "granted",
90
+ denied: "denied",
91
+ accepted: "granted",
92
+ declined: "denied"
93
+ };
94
+ function parseJson(raw) {
95
+ try {
96
+ return JSON.parse(raw);
97
+ } catch {
98
+ return;
99
+ }
100
+ }
101
+ function parseObject(value) {
102
+ if (typeof value !== "object" || value === null) return null;
103
+ const { choice, expiresAt } = value;
104
+ if (typeof choice !== "string" || !Object.hasOwn(CHOICE_BY_STORED_VALUE, choice)) return null;
105
+ if (typeof expiresAt !== "number" || !Number.isFinite(expiresAt)) return null;
106
+ return {
107
+ choice: CHOICE_BY_STORED_VALUE[choice],
108
+ expiresAt,
109
+ isCurrentForm: choice === "granted" || choice === "denied"
110
+ };
111
+ }
112
+ function parseStoredValue(raw) {
113
+ if (Object.hasOwn(CHOICE_BY_STORED_VALUE, raw)) return {
114
+ choice: CHOICE_BY_STORED_VALUE[raw],
115
+ expiresAt: null,
116
+ isCurrentForm: false
117
+ };
118
+ return parseObject(parseJson(raw));
119
+ }
120
+ function safeGetItem(storage, key) {
121
+ try {
122
+ return storage.getItem(key);
123
+ } catch {
124
+ return null;
125
+ }
126
+ }
127
+ /** Writes the current record shape. Returns false when storage refuses the write. */
128
+ function writeConsent(storage, key, record) {
129
+ try {
130
+ storage.setItem(key, JSON.stringify(record));
131
+ return true;
132
+ } catch {
133
+ return false;
134
+ }
135
+ }
136
+ function newRecord(choice, now) {
137
+ return {
138
+ choice,
139
+ expiresAt: now + CONSENT_LIFETIME_MS
140
+ };
141
+ }
142
+ function isValid(expiresAt, now) {
143
+ return expiresAt > now && expiresAt <= now + 15552e6;
144
+ }
145
+ function removeQuietly(storage, key) {
146
+ try {
147
+ storage.removeItem(key);
148
+ } catch {}
149
+ }
150
+ function migrate(options, parsed, fromLegacyKey) {
151
+ const { storage, key, legacyKey, now } = options;
152
+ const record = {
153
+ choice: parsed.choice,
154
+ expiresAt: parsed.expiresAt ?? now + 15552e6
155
+ };
156
+ if (parsed.isCurrentForm && !fromLegacyKey) return record;
157
+ const written = writeConsent(storage, key, record);
158
+ if (!written && parsed.expiresAt === null) return null;
159
+ if (written && fromLegacyKey) removeQuietly(storage, legacyKey);
160
+ return record;
161
+ }
162
+ function findParsed(options) {
163
+ const { storage, key, legacyKey } = options;
164
+ const current = safeGetItem(storage, key);
165
+ const parsedCurrent = current === null ? null : parseStoredValue(current);
166
+ if (parsedCurrent !== null || legacyKey === void 0) return {
167
+ parsed: parsedCurrent,
168
+ fromLegacyKey: false
169
+ };
170
+ const legacy = safeGetItem(storage, legacyKey);
171
+ const parsedLegacy = legacy === null ? null : parseStoredValue(legacy);
172
+ return {
173
+ parsed: parsedLegacy,
174
+ fromLegacyKey: parsedLegacy !== null
175
+ };
176
+ }
177
+ /**
178
+ * Reads the stored choice. Older values (`accepted`, `declined`, a bare
179
+ * string, the legacy key) are rewritten in the current form under the current
180
+ * key. A bare legacy value starts a fresh 180 days from `now`.
181
+ */
182
+ function readConsent(options) {
183
+ const { parsed, fromLegacyKey } = findParsed(options);
184
+ if (parsed === null) return {
185
+ record: null,
186
+ hadGrant: false
187
+ };
188
+ const hadGrant = parsed.choice === "granted";
189
+ if (parsed.expiresAt !== null && !isValid(parsed.expiresAt, options.now)) return {
190
+ record: null,
191
+ hadGrant
192
+ };
193
+ return {
194
+ record: migrate(options, parsed, fromLegacyKey),
195
+ hadGrant
196
+ };
197
+ }
198
+ // src/signals.ts
199
+ const DO_NOT_TRACK_ENABLED_VALUES = /* @__PURE__ */ new Set(["1", "yes"]);
200
+ function isDoNotTrackEnabled(value) {
201
+ return typeof value === "string" && DO_NOT_TRACK_ENABLED_VALUES.has(value);
202
+ }
203
+ /**
204
+ * True when the browser asks not to be tracked: Global Privacy Control, or Do
205
+ * Not Track set to `1` or `yes` on `navigator`, `window`, or `msDoNotTrack`.
206
+ */
207
+ function hasPrivacySignal(browser) {
208
+ const { navigator, window } = browser;
209
+ if (navigator.globalPrivacyControl === true) return true;
210
+ return [
211
+ navigator.doNotTrack,
212
+ navigator.msDoNotTrack,
213
+ window.doNotTrack
214
+ ].some(isDoNotTrackEnabled);
215
+ }
216
+ // src/consent.ts
217
+ function configuredServices(services) {
218
+ const configured = [];
219
+ if (services.analytics !== void 0) configured.push("analytics");
220
+ if (services.sessionReplay === true) configured.push("sessionReplay");
221
+ return configured;
222
+ }
223
+ function createConsent(options) {
224
+ const { app, storage, navigator, window, legacyKey } = options;
225
+ const now = options.now ?? Date.now;
226
+ const key = consentStorageKey(app);
227
+ const services = configuredServices(options.services);
228
+ let grantedThisSession = false;
229
+ const read = () => readConsent({
230
+ storage,
231
+ key,
232
+ legacyKey,
233
+ now: now()
234
+ });
235
+ const signalPresent = () => hasPrivacySignal({
236
+ navigator,
237
+ window
238
+ });
239
+ function status() {
240
+ if (signalPresent()) return "signal";
241
+ return read().record?.choice ?? "unset";
242
+ }
243
+ function store(choice) {
244
+ writeConsent(storage, key, newRecord(choice, now()));
245
+ return status();
246
+ }
247
+ function clearCookiesQuietly() {
248
+ try {
249
+ clearGoogleAnalyticsCookies(window);
250
+ } catch {}
251
+ }
252
+ function deny() {
253
+ const { hadGrant } = read();
254
+ const measurementId = options.services.analytics?.measurementId;
255
+ if (measurementId !== void 0) setAnalyticsDisabled(window, measurementId, true);
256
+ disableConfiguredAnalytics(window);
257
+ const result = store("denied");
258
+ if (hadGrant || grantedThisSession) clearCookiesQuietly();
259
+ grantedThisSession = false;
260
+ return result;
261
+ }
262
+ function grant() {
263
+ if (signalPresent()) return "signal";
264
+ grantedThisSession = true;
265
+ return store("granted");
266
+ }
267
+ return {
268
+ get status() {
269
+ return status();
270
+ },
271
+ get shouldPrompt() {
272
+ return services.length > 0 && status() === "unset";
273
+ },
274
+ services,
275
+ grant,
276
+ deny
277
+ };
278
+ }
279
+ export { CONSENT_LIFETIME_DAYS, CONSENT_LIFETIME_MS, GTAG_SCRIPT_URL, consentStorageKey, createConsent, hasPrivacySignal, loadGoogleAnalytics };
@@ -0,0 +1,12 @@
1
+ import { o as ConsentStorage, s as NavigatorSignals } from "./types-B818wSQH.js";
2
+ export interface PrivacySignalStubOptions {
3
+ doNotTrack?: string | null;
4
+ globalPrivacyControl?: boolean;
5
+ }
6
+ /** A `navigator` stand-in with the two privacy signals set as given. */
7
+ export declare function stubPrivacySignal(options?: PrivacySignalStubOptions): NavigatorSignals;
8
+ export interface MemoryStorage extends ConsentStorage {
9
+ readonly entries: ReadonlyMap<string, string>;
10
+ }
11
+ /** In-memory `Storage` for tests. */
12
+ export declare function createMemoryStorage(initial?: Record<string, string>): MemoryStorage;
@@ -0,0 +1,23 @@
1
+ // src/testing.ts
2
+ /** A `navigator` stand-in with the two privacy signals set as given. */
3
+ function stubPrivacySignal(options = {}) {
4
+ return {
5
+ doNotTrack: options.doNotTrack ?? null,
6
+ globalPrivacyControl: options.globalPrivacyControl ?? false
7
+ };
8
+ }
9
+ /** In-memory `Storage` for tests. */
10
+ function createMemoryStorage(initial = {}) {
11
+ const entries = new Map(Object.entries(initial));
12
+ return {
13
+ entries,
14
+ getItem: (key) => entries.get(key) ?? null,
15
+ setItem: (key, value) => {
16
+ entries.set(key, value);
17
+ },
18
+ removeItem: (key) => {
19
+ entries.delete(key);
20
+ }
21
+ };
22
+ }
23
+ export { createMemoryStorage, stubPrivacySignal };
@@ -0,0 +1,34 @@
1
+ type ConsentChoice = "granted" | "denied";
2
+ type ConsentStatus = ConsentChoice | "unset" | "signal";
3
+ type ConsentService = "analytics" | "sessionReplay";
4
+ /** The record kept in storage. `expiresAt` is epoch milliseconds. */
5
+ interface StoredConsent {
6
+ choice: ConsentChoice;
7
+ expiresAt: number;
8
+ }
9
+ /** The part of `Storage` this package uses. */
10
+ interface ConsentStorage {
11
+ getItem(key: string): string | null;
12
+ setItem(key: string, value: string): void;
13
+ removeItem(key: string): void;
14
+ }
15
+ /** The part of `Navigator` that carries privacy signals. */
16
+ interface NavigatorSignals {
17
+ doNotTrack?: string | null;
18
+ msDoNotTrack?: string | null;
19
+ globalPrivacyControl?: boolean;
20
+ }
21
+ /**
22
+ * The browser `window`. Typed as `object` so a real `window` is accepted
23
+ * without declaring the properties this package reads (`doNotTrack`,
24
+ * `document.cookie`, `location.hostname`, `dataLayer`).
25
+ */
26
+ type BrowserWindow = object;
27
+ interface ConsentServices {
28
+ /** Google Analytics. The measurement id lets `deny()` switch the tag off. */
29
+ analytics?: {
30
+ measurementId: string;
31
+ };
32
+ sessionReplay?: boolean;
33
+ }
34
+ export { ConsentStatus as a, StoredConsent as c, ConsentServices as i, ConsentChoice as n, ConsentStorage as o, ConsentService as r, NavigatorSignals as s, BrowserWindow as t };
package/package.json CHANGED
@@ -1 +1,36 @@
1
- {"name":"@neon-pixels/consent","version":"0.0.0","description":"Placeholder. The first real release follows.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/neonpixels-studio/packages.git"}}
1
+ {
2
+ "name": "@neon-pixels/consent",
3
+ "version": "0.3.0",
4
+ "description": "Analytics consent state, privacy-signal detection, and a consent-gated Google Analytics loader, with every browser object injected.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/neonpixels-studio/packages.git",
10
+ "directory": "packages/consent"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "default": "./dist/index.js"
16
+ },
17
+ "./testing": {
18
+ "types": "./dist/testing.d.ts",
19
+ "default": "./dist/testing.js"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "engines": {
30
+ "node": "^22.17.0 || ^24.0.0 || >=26.0.0"
31
+ },
32
+ "scripts": {
33
+ "build": "tsdown",
34
+ "typecheck": "tsc --noEmit -p tsconfig.json"
35
+ }
36
+ }