@feathq/web-sdk 0.1.0 → 0.1.1

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
@@ -1,4 +1,12 @@
1
- # @feathq/web-sdk
1
+ <p align="center">
2
+ <a href="https://feat.so">
3
+ <img src="https://feat.so/logo/wordmark.png" alt="feat.so" width="320" />
4
+ </a>
5
+ </p>
6
+
7
+ ---
8
+
9
+ # feat Web SDK
2
10
 
3
11
  Browser / client-side SDK for [feat](https://feat.so) feature flags. Polls a per-environment datafile to the browser and evaluates flags locally with a synchronous cache.
4
12
 
package/dist/index.cjs CHANGED
@@ -161,6 +161,9 @@ function hasLocalStorage2() {
161
161
  }
162
162
  }
163
163
 
164
+ // src/version.ts
165
+ var SDK_VERSION = "0.1.1";
166
+
164
167
  // src/client.ts
165
168
  var CLIENT_SIDE_PREFIX = "feat_cs_";
166
169
  var MIN_POLL_INTERVAL_MS = 5e3;
@@ -333,7 +336,9 @@ var FeatWebClient = class {
333
336
  async fetchDatafile() {
334
337
  const url = `${this.config.dataPlaneUrl.replace(/\/$/, "")}/sdk/v1/datafile`;
335
338
  const headers = {
336
- Authorization: `Bearer ${this.config.apiKey}`
339
+ Authorization: `Bearer ${this.config.apiKey}`,
340
+ // Custom header because browsers forbid setting User-Agent on fetch.
341
+ "X-Feat-Sdk": `web/${SDK_VERSION}`
337
342
  };
338
343
  if (this.etag) headers["If-None-Match"] = this.etag;
339
344
  const res = await this.fetchImpl(url, { method: "GET", headers });
@@ -435,7 +440,7 @@ function assertHttpsUrl(url) {
435
440
  }
436
441
 
437
442
  // src/index.ts
438
- var SDK_VERSION = "0.1.0";
443
+ var SDK_VERSION2 = "0.1.0";
439
444
 
440
445
  exports.FeatWebClient = FeatWebClient;
441
- exports.SDK_VERSION = SDK_VERSION;
446
+ exports.SDK_VERSION = SDK_VERSION2;
package/dist/index.js CHANGED
@@ -159,6 +159,9 @@ function hasLocalStorage2() {
159
159
  }
160
160
  }
161
161
 
162
+ // src/version.ts
163
+ var SDK_VERSION = "0.1.1";
164
+
162
165
  // src/client.ts
163
166
  var CLIENT_SIDE_PREFIX = "feat_cs_";
164
167
  var MIN_POLL_INTERVAL_MS = 5e3;
@@ -331,7 +334,9 @@ var FeatWebClient = class {
331
334
  async fetchDatafile() {
332
335
  const url = `${this.config.dataPlaneUrl.replace(/\/$/, "")}/sdk/v1/datafile`;
333
336
  const headers = {
334
- Authorization: `Bearer ${this.config.apiKey}`
337
+ Authorization: `Bearer ${this.config.apiKey}`,
338
+ // Custom header because browsers forbid setting User-Agent on fetch.
339
+ "X-Feat-Sdk": `web/${SDK_VERSION}`
335
340
  };
336
341
  if (this.etag) headers["If-None-Match"] = this.etag;
337
342
  const res = await this.fetchImpl(url, { method: "GET", headers });
@@ -433,6 +438,6 @@ function assertHttpsUrl(url) {
433
438
  }
434
439
 
435
440
  // src/index.ts
436
- var SDK_VERSION = "0.1.0";
441
+ var SDK_VERSION2 = "0.1.0";
437
442
 
438
- export { FeatWebClient, SDK_VERSION };
443
+ export { FeatWebClient, SDK_VERSION2 as SDK_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feathq/web-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "feat feature-flag SDK for browsers. Polling client + sync evaluation cache. Pair with @feathq/openfeature-web for OpenFeature.",
5
5
  "keywords": [
6
6
  "feature-flags",
@@ -11,7 +11,7 @@
11
11
  "client-side"
12
12
  ],
13
13
  "license": "MIT",
14
- "author": "feat HQ <engineering@feat.so>",
14
+ "author": "feat HQ <support@feat.so>",
15
15
  "homepage": "https://feat.so",
16
16
  "repository": {
17
17
  "type": "git",
@@ -48,11 +48,6 @@
48
48
  "@feathq/datafile-schema": "^0.1.0",
49
49
  "@feathq/feat-eval": "^0.1.0"
50
50
  },
51
- "resolutions": {
52
- "@feathq/datafile-schema": "portal:../../packages/datafile-schema",
53
- "@feathq/datafile-schema@workspace:*": "portal:../../packages/datafile-schema",
54
- "@feathq/feat-eval": "portal:../../packages/feat-eval"
55
- },
56
51
  "devDependencies": {
57
52
  "@types/node": "^25.6.2",
58
53
  "happy-dom": "^15.11.7",
@@ -60,4 +55,4 @@
60
55
  "typescript": "^6.0.3",
61
56
  "vitest": "^4.1.6"
62
57
  }
63
- }
58
+ }