flagfish-client-node 0.0.2 → 0.0.4
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/dist/FlagFishClient.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface FlagResponse {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class FlagFishClient {
|
|
10
10
|
private apiKey;
|
|
11
|
-
private
|
|
12
|
-
constructor(apiKey: string
|
|
11
|
+
private _baseUrl;
|
|
12
|
+
constructor(apiKey: string);
|
|
13
13
|
getFeatureFlagByKey(name: string, options?: FlagOptions): Promise<FlagResponse>;
|
|
14
14
|
}
|
package/dist/FlagFishClient.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import fetch from 'node-fetch';
|
|
2
1
|
export class FlagFishClient {
|
|
3
|
-
constructor(apiKey
|
|
2
|
+
constructor(apiKey) {
|
|
3
|
+
this._baseUrl = 'https://sdk.flagfish.co';
|
|
4
4
|
this.apiKey = apiKey.trim();
|
|
5
|
-
this.baseUrl = baseUrl;
|
|
6
5
|
}
|
|
7
6
|
async getFeatureFlagByKey(name, options) {
|
|
8
7
|
const payload = {
|
|
9
8
|
flag_name: name,
|
|
10
9
|
...(options ?? {}),
|
|
11
10
|
};
|
|
12
|
-
const response = await fetch(`${this.
|
|
11
|
+
const response = await fetch(`${this._baseUrl}/v1/flag`, {
|
|
13
12
|
method: 'POST',
|
|
14
13
|
headers: {
|
|
15
14
|
'Content-Type': 'application/json',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flagfish-client-node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Node.js client for FlagFish feature flag API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/FlagFishClient.js",
|
|
@@ -10,7 +10,13 @@
|
|
|
10
10
|
"test": "jest",
|
|
11
11
|
"test:cov": "node --experimental-vm-modules node_modules/.bin/jest --coverage"
|
|
12
12
|
},
|
|
13
|
-
"keywords": [
|
|
13
|
+
"keywords": [
|
|
14
|
+
"feature-flag",
|
|
15
|
+
"client",
|
|
16
|
+
"flagfish",
|
|
17
|
+
"typescript",
|
|
18
|
+
"nodejs"
|
|
19
|
+
],
|
|
14
20
|
"author": "flagfishdotco",
|
|
15
21
|
"license": "MIT",
|
|
16
22
|
"devDependencies": {
|
|
@@ -19,8 +25,5 @@
|
|
|
19
25
|
"jest": "^29.7.0",
|
|
20
26
|
"ts-jest": "^29.3.4",
|
|
21
27
|
"typescript": "^5.8.3"
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"node-fetch": "^3.3.2"
|
|
25
28
|
}
|
|
26
29
|
}
|