@intellifend/requestshieldjs 2.0.0-qat.211 → 2.0.0-qat.220
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 +15 -3
- package/dist/checksums.json +5 -5
- package/dist/index.d.ts +3 -0
- package/dist/intellifend.js +2 -2
- package/dist/intellifend.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,11 @@ IntelliFend supplies a different endpoint for your application, set it explicitl
|
|
|
47
47
|
Pin the resolved version
|
|
48
48
|
in your application's lockfile for reproducible installations.
|
|
49
49
|
|
|
50
|
+
This SDK uses API v2 by default. Select API v1 with `apiVersion: "v1"` or
|
|
51
|
+
`data-api-version="v1"` on the script tag. The version is
|
|
52
|
+
separate from the service base URL; do not append `/v1` or `/v2` to
|
|
53
|
+
`challengeUrl`. Both versions use the same app key and backend token transport.
|
|
54
|
+
|
|
50
55
|
The ESM entry point exports `IntelliFend`, `IntelliFendError`, `VERSION`, and
|
|
51
56
|
TypeScript types. It does not attach a global or initialize itself. Use it in
|
|
52
57
|
browser applications with an ESM-capable toolchain.
|
|
@@ -135,15 +140,21 @@ await fetch("/api/register", {
|
|
|
135
140
|
| Option | Required | Description |
|
|
136
141
|
| --- | --- | --- |
|
|
137
142
|
| `appKey` | Yes | Public app key supplied by IntelliFend. |
|
|
143
|
+
| `apiVersion` | No | Challenge API version: `"v1"` or `"v2"`. Defaults to `"v2"`. |
|
|
138
144
|
| `challengeUrl` | No | Absolute Challenge Server base URL. Defaults to `https://challenge.intellifend.ai`. It must use HTTP(S) and contain no credentials, query, or fragment. |
|
|
139
145
|
| `fallbackChallengeUrl` | No | Approved absolute HTTPS secondary base URL, without credentials, query, or fragment. Omitted by default. An identical normalized primary URL adds no alternate endpoint. |
|
|
140
146
|
| `timeoutMs` | No | Positive whole-flow time budget for create, solve, verify, and retries. Defaults to 5,000 ms. |
|
|
141
147
|
| `protect` | No | Exact endpoint path or URL strings for Seamless mode. Omit or pass an empty list for Manual-only operation. |
|
|
142
|
-
| `telemetry` | No | Enables the optional browser signal collection
|
|
148
|
+
| `telemetry` | No | Enables the optional browser signal collection on API v2. Default `false`; collection stays disabled on v1. |
|
|
143
149
|
|
|
144
150
|
`init()` validates synchronously and throws `IntelliFendError` with code `invalid_config` for invalid input. Reinitialization replaces the previous valid configuration; a failing reinitialization leaves that configuration in place. Unknown configuration keys are ignored.
|
|
145
151
|
|
|
146
|
-
Script-tag integrations use the equivalent attributes `data-app-key`, `data-challenge-url`, `data-protect`, and `data-fallback-challenge-url`. `data-protect` must be a JSON array of strings. The collector accepts only the exact `data-telemetry="true"` and `data-telemetry="false"` values; invalid supplied values use the same sanitized `invalid_config` auto-init warning.
|
|
152
|
+
Script-tag integrations use the equivalent attributes `data-app-key`, `data-api-version`, `data-challenge-url`, `data-protect`, and `data-fallback-challenge-url`. `data-api-version` accepts exactly `"v1"` or `"v2"`; omitting it selects v2. `data-protect` must be a JSON array of strings. The collector accepts only the exact `data-telemetry="true"` and `data-telemetry="false"` values; invalid supplied values use the same sanitized `invalid_config` auto-init warning.
|
|
153
|
+
|
|
154
|
+
Each token flow retains its API version through create, solve, verify, retries,
|
|
155
|
+
and endpoint fallback, including when the SDK is reinitialized during that flow.
|
|
156
|
+
This SDK requires WebAssembly and the documented CSP permissions with either
|
|
157
|
+
API version. Integrations pinned to Browser SDK 1.0.0 continue using API v1.
|
|
147
158
|
|
|
148
159
|
### Optional secondary domain
|
|
149
160
|
|
|
@@ -163,10 +174,11 @@ The SDK can retry eligible connection failures through the alternate service.
|
|
|
163
174
|
All attempts share the configured token timeout, which defaults to 5,000 ms.
|
|
164
175
|
Switching services does not restart that timeout. No cookies or browser storage
|
|
165
176
|
are used. `getToken()` returns a token or `""` if acquisition fails.
|
|
177
|
+
Both services use the selected API version; a v2 failure never retries through v1.
|
|
166
178
|
|
|
167
179
|
### Optional browser signal collection
|
|
168
180
|
|
|
169
|
-
`telemetry: true` collects a bounded summary of browser
|
|
181
|
+
On API v2, `telemetry: true` collects a bounded summary of browser
|
|
170
182
|
interaction and timezone information in page memory for up to five minutes.
|
|
171
183
|
This summary accompanies token requests and includes timezone information.
|
|
172
184
|
|
package/dist/checksums.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0.0-qat.
|
|
2
|
+
"version": "2.0.0-qat.220",
|
|
3
3
|
"algorithm": "sha384",
|
|
4
4
|
"bundles": [
|
|
5
5
|
{
|
|
6
6
|
"name": "intellifend",
|
|
7
7
|
"path": "intellifend.js",
|
|
8
|
-
"version": "2.0.0-qat.
|
|
9
|
-
"integrity": "sha384-
|
|
8
|
+
"version": "2.0.0-qat.220",
|
|
9
|
+
"integrity": "sha384-K09d6qmXACzSLNDagPbaJb3hTK2FNfFCH9dfcDwiTVT/eAHAbG8zwXRMIuY4frT2"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "intellifend-esm",
|
|
13
13
|
"path": "intellifend.mjs",
|
|
14
|
-
"version": "2.0.0-qat.
|
|
15
|
-
"integrity": "sha384-
|
|
14
|
+
"version": "2.0.0-qat.220",
|
|
15
|
+
"integrity": "sha384-G0S0OzHiTI6gAtDt6Iu7hqf6VuSYL/wa3kOdHY+eStCm0W3X/5bXs5NpL867+BXi"
|
|
16
16
|
}
|
|
17
17
|
]
|
|
18
18
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
export type ApiVersion = "v1" | "v2";
|
|
1
2
|
export interface InitConfig {
|
|
2
3
|
/** Public site key (`pk_...`). Required. */
|
|
3
4
|
appKey: string;
|
|
5
|
+
/** Challenge API version. Defaults to v2; v1 preserves the legacy policy. */
|
|
6
|
+
apiVersion?: ApiVersion;
|
|
4
7
|
/** Challenge Server HTTP(S) base URL. Defaults to https://challenge.intellifend.ai. */
|
|
5
8
|
challengeUrl?: string;
|
|
6
9
|
/** Optional HTTPS service base URL used when the preferred endpoint is unavailable. */
|