@feathq/js-sdk 0.1.0 → 0.1.2

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/js-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 Node.js SDK
2
10
 
3
11
  Server-side JavaScript / TypeScript SDK for [feat](https://feat.so) feature flags. Local flag evaluation against a polled datafile, OpenFeature provider included.
4
12
 
package/dist/index.cjs CHANGED
@@ -3,10 +3,16 @@
3
3
  var featEval = require('@feathq/feat-eval');
4
4
  var core = require('@openfeature/core');
5
5
 
6
+ // src/client.ts
7
+
8
+ // src/version.ts
9
+ var SDK_VERSION = "0.1.2";
10
+
6
11
  // src/client.ts
7
12
  var MIN_POLL_INTERVAL_MS = 5e3;
8
13
  var DEFAULT_POLL_INTERVAL_MS = 3e4;
9
14
  var MAX_DATAFILE_BYTES = 10 * 1024 * 1024;
15
+ var USER_AGENT = `feat-sdk-js/${SDK_VERSION}`;
10
16
  var FeatClient = class {
11
17
  constructor(config) {
12
18
  this.config = config;
@@ -68,7 +74,8 @@ var FeatClient = class {
68
74
  async fetchDatafile() {
69
75
  const url = `${this.config.dataPlaneUrl.replace(/\/$/, "")}/sdk/v1/datafile`;
70
76
  const headers = {
71
- Authorization: `Bearer ${this.config.apiKey}`
77
+ Authorization: `Bearer ${this.config.apiKey}`,
78
+ "User-Agent": USER_AGENT
72
79
  };
73
80
  if (this.etag) headers["If-None-Match"] = this.etag;
74
81
  const res = await this.fetchImpl(url, { method: "GET", headers });
package/dist/index.js CHANGED
@@ -2,10 +2,16 @@ import { evaluate } from '@feathq/feat-eval';
2
2
  export { evaluate } from '@feathq/feat-eval';
3
3
  import { ErrorCode } from '@openfeature/core';
4
4
 
5
+ // src/client.ts
6
+
7
+ // src/version.ts
8
+ var SDK_VERSION = "0.1.2";
9
+
5
10
  // src/client.ts
6
11
  var MIN_POLL_INTERVAL_MS = 5e3;
7
12
  var DEFAULT_POLL_INTERVAL_MS = 3e4;
8
13
  var MAX_DATAFILE_BYTES = 10 * 1024 * 1024;
14
+ var USER_AGENT = `feat-sdk-js/${SDK_VERSION}`;
9
15
  var FeatClient = class {
10
16
  constructor(config) {
11
17
  this.config = config;
@@ -67,7 +73,8 @@ var FeatClient = class {
67
73
  async fetchDatafile() {
68
74
  const url = `${this.config.dataPlaneUrl.replace(/\/$/, "")}/sdk/v1/datafile`;
69
75
  const headers = {
70
- Authorization: `Bearer ${this.config.apiKey}`
76
+ Authorization: `Bearer ${this.config.apiKey}`,
77
+ "User-Agent": USER_AGENT
71
78
  };
72
79
  if (this.etag) headers["If-None-Match"] = this.etag;
73
80
  const res = await this.fetchImpl(url, { method: "GET", headers });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feathq/js-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "feat feature-flag SDK for JavaScript and TypeScript (server-side, OpenFeature provider)",
5
5
  "keywords": [
6
6
  "feature-flags",
@@ -10,7 +10,7 @@
10
10
  "feature-management"
11
11
  ],
12
12
  "license": "MIT",
13
- "author": "feat HQ <engineering@feat.so>",
13
+ "author": "feat HQ <support@feat.so>",
14
14
  "homepage": "https://feat.so",
15
15
  "repository": {
16
16
  "type": "git",
@@ -48,6 +48,7 @@
48
48
  "@feathq/feat-eval": "^0.1.0"
49
49
  },
50
50
  "peerDependencies": {
51
+ "@openfeature/core": "^1.0.0",
51
52
  "@openfeature/server-sdk": "^1.0.0"
52
53
  },
53
54
  "devDependencies": {
@@ -57,10 +58,5 @@
57
58
  "tsup": "^8.3.5",
58
59
  "typescript": "^6.0.3",
59
60
  "vitest": "^4.1.6"
60
- },
61
- "resolutions": {
62
- "@feathq/datafile-schema": "portal:../../packages/datafile-schema",
63
- "@feathq/datafile-schema@workspace:*": "portal:../../packages/datafile-schema",
64
- "@feathq/feat-eval": "portal:../../packages/feat-eval"
65
61
  }
66
- }
62
+ }