flagfish-client-node 0.0.3 → 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.
@@ -8,7 +8,7 @@ export interface FlagResponse {
8
8
  }
9
9
  export declare class FlagFishClient {
10
10
  private apiKey;
11
- private baseUrl;
12
- constructor(apiKey: string, baseUrl: string);
11
+ private _baseUrl;
12
+ constructor(apiKey: string);
13
13
  getFeatureFlagByKey(name: string, options?: FlagOptions): Promise<FlagResponse>;
14
14
  }
@@ -1,14 +1,14 @@
1
1
  export class FlagFishClient {
2
- constructor(apiKey, baseUrl) {
2
+ constructor(apiKey) {
3
+ this._baseUrl = 'https://sdk.flagfish.co';
3
4
  this.apiKey = apiKey.trim();
4
- this.baseUrl = baseUrl;
5
5
  }
6
6
  async getFeatureFlagByKey(name, options) {
7
7
  const payload = {
8
8
  flag_name: name,
9
9
  ...(options ?? {}),
10
10
  };
11
- const response = await fetch(`${this.baseUrl}/v1/flag`, {
11
+ const response = await fetch(`${this._baseUrl}/v1/flag`, {
12
12
  method: 'POST',
13
13
  headers: {
14
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",
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",