@thunderid/browser 1.0.7 → 1.1.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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Builds a `fetch`-shaped function backed by the shared `FetchHttpClient` singleton, for
3
+ * framework wrappers (`@thunderid/react`, `@thunderid/vue`) that need to hand a core
4
+ * `@thunderid/javascript` API function a `fetcher` carrying the access token automatically.
5
+ *
6
+ * Unlike a plain `fetch` call, `FetchHttpClient.request` throws on a non-2xx response instead
7
+ * of resolving it. This adapter catches that and reconstructs a `Response`-shaped object from
8
+ * the thrown error's `response`, so the core API function sees the real status and body instead
9
+ * of treating every non-2xx result as a network failure. A genuine network error (no response
10
+ * attached) still propagates.
11
+ *
12
+ * @param instanceId - Which `FetchHttpClient` instance to use, for multi-instance apps. Defaults to `0`.
13
+ * @returns A function matching the `(url, config) => Promise<Response>` shape core API functions expect.
14
+ * @example
15
+ * ```typescript
16
+ * await updateMeCredentials({
17
+ * ...config,
18
+ * fetcher: fetcher ?? createHttpClientFetcher(instanceId),
19
+ * });
20
+ * ```
21
+ */
22
+ declare const createHttpClientFetcher: (instanceId?: number) => ((url: string, config: RequestInit) => Promise<Response>);
23
+ export default createHttpClientFetcher;
24
+ //# sourceMappingURL=createHttpClientFetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createHttpClientFetcher.d.ts","sourceRoot":"","sources":["../../src/utils/createHttpClientFetcher.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,uBAAuB,GAAI,mBAAc,KAAG,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CA8BzG,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thunderid/browser",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "Browser runtime SDK for ThunderID",
5
5
  "keywords": [
6
6
  "thunderid",
@@ -46,7 +46,7 @@
46
46
  "vitest": "4.1.10"
47
47
  },
48
48
  "dependencies": {
49
- "@thunderid/javascript": "^1.0.7",
49
+ "@thunderid/javascript": "^1.1.0",
50
50
  "base64url": "3.0.1",
51
51
  "buffer": "6.0.3",
52
52
  "core-js": "3.42.0",