@zeroad.network/token 0.13.11 → 0.13.12
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
|
@@ -69,7 +69,7 @@ Partnering with Zero Ad Network allows your site to:
|
|
|
69
69
|
## Onboarding Your Site
|
|
70
70
|
|
|
71
71
|
1. [Sign up](https://zeroad.network/login) with Zero Ad Network.
|
|
72
|
-
2. [Register your site](https://zeroad.network/publisher/sites/add) to receive your unique `
|
|
72
|
+
2. [Register your site](https://zeroad.network/publisher/sites/add) to receive your unique `Client ID` value.
|
|
73
73
|
|
|
74
74
|
Your site must include this header on all publicly accessible HTML or RESTful endpoints so that Zero Ad Network users’ browser extensions can recognize participation.
|
|
75
75
|
|
|
@@ -117,7 +117,7 @@ const app = express();
|
|
|
117
117
|
|
|
118
118
|
// Initialize the Zero Ad Network module at app startup.
|
|
119
119
|
// Your site's `clientId` value is obtained during site registration on the Zero Ad Network platform (https://zeroad.network).
|
|
120
|
-
const ZERO_AD_NETWORK_CLIENT_ID = "
|
|
120
|
+
const ZERO_AD_NETWORK_CLIENT_ID = "DEMO-Z2CclA8oXIT1e0Qmq";
|
|
121
121
|
const site = Site({
|
|
122
122
|
clientId: ZERO_AD_NETWORK_CLIENT_ID,
|
|
123
123
|
features: [FEATURES.CLEAN_WEB, FEATURES.ONE_PASS],
|
|
@@ -86,10 +86,10 @@ function encodeServerHeader(clientId, features) {
|
|
|
86
86
|
throw new Error("The provided `clientId` value cannot be an empty string");
|
|
87
87
|
}
|
|
88
88
|
if (!features?.length) {
|
|
89
|
-
throw new Error("At least one
|
|
89
|
+
throw new Error("At least one site feature must be provided");
|
|
90
90
|
}
|
|
91
91
|
if (features.filter((feature) => validFeatureValues.includes(feature)).length !== features.length) {
|
|
92
|
-
throw new Error(`Only valid
|
|
92
|
+
throw new Error(`Only valid site features are allowed: ${validFeatureKeys.join(" | ")}`);
|
|
93
93
|
}
|
|
94
94
|
return [clientId, CURRENT_PROTOCOL_VERSION, setFlags(features)].join(SEPARATOR);
|
|
95
95
|
}
|
|
@@ -88,10 +88,10 @@ function encodeServerHeader(clientId, features) {
|
|
|
88
88
|
throw new Error("The provided `clientId` value cannot be an empty string");
|
|
89
89
|
}
|
|
90
90
|
if (!features?.length) {
|
|
91
|
-
throw new Error("At least one
|
|
91
|
+
throw new Error("At least one site feature must be provided");
|
|
92
92
|
}
|
|
93
93
|
if (features.filter((feature) => validFeatureValues.includes(feature)).length !== features.length) {
|
|
94
|
-
throw new Error(`Only valid
|
|
94
|
+
throw new Error(`Only valid site features are allowed: ${validFeatureKeys.join(" | ")}`);
|
|
95
95
|
}
|
|
96
96
|
return [clientId, CURRENT_PROTOCOL_VERSION, setFlags(features)].join(SEPARATOR);
|
|
97
97
|
}
|
package/dist/browser.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as CLIENT_HEADERS, b as CURRENT_PROTOCOL_VERSION, F as FEATURES, P as PROTOCOL_VERSION, S as SERVER_HEADERS, Z as ZEROAD_NETWORK_PUBLIC_KEY, d as decodeServerHeader } from './browser
|
|
1
|
+
export { C as CLIENT_HEADERS, b as CURRENT_PROTOCOL_VERSION, F as FEATURES, P as PROTOCOL_VERSION, S as SERVER_HEADERS, Z as ZEROAD_NETWORK_PUBLIC_KEY, d as decodeServerHeader } from './browser--AdrX2EX.mjs';
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FEATURES, Z as ZEROAD_NETWORK_PUBLIC_KEY, h as hasFlag, f as fromBase64, P as PROTOCOL_VERSION, l as log, s as setFlags, t as toBase64, e as encodeServerHeader, S as SERVER_HEADERS, C as CLIENT_HEADERS } from './browser
|
|
2
|
-
export { b as CURRENT_PROTOCOL_VERSION, d as decodeServerHeader, a as setLogLevel } from './browser
|
|
1
|
+
import { F as FEATURES, Z as ZEROAD_NETWORK_PUBLIC_KEY, h as hasFlag, f as fromBase64, P as PROTOCOL_VERSION, l as log, s as setFlags, t as toBase64, e as encodeServerHeader, S as SERVER_HEADERS, C as CLIENT_HEADERS } from './browser--AdrX2EX.mjs';
|
|
2
|
+
export { b as CURRENT_PROTOCOL_VERSION, d as decodeServerHeader, a as setLogLevel } from './browser--AdrX2EX.mjs';
|
|
3
3
|
import { Buffer } from 'node:buffer';
|
|
4
4
|
import { verify as verify$1, randomBytes, sign as sign$1, createPublicKey, createPrivateKey } from 'node:crypto';
|
|
5
5
|
|