Skip to content

Commit b156a2e

Browse files
authored
Merge pull request #178 from Flagsmith/fix/initial-fetch
fix!: Improve error handling when environment fetch fails. Minor type safety breaking changes
2 parents 01f7d0e + b20470d commit b156a2e

16 files changed

+457
-363
lines changed
File renamed without changes.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flagsmith-nodejs",
3-
"version": "5.1.1",
3+
"version": "6.0.0",
44
"description": "Flagsmith lets you manage features flags and remote config across web, mobile and server side applications. Deliver true Continuous Integration. Get builds out faster. Control who has access to new features.",
55
"main": "./build/cjs/index.js",
66
"type": "module",

sdk/analytics.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { pino, Logger } from 'pino';
22
import { Fetch } from "./types.js";
3-
import { Flags } from "./models.js";
3+
import { FlagsmithConfig } from "./types.js";
44

55
export const ANALYTICS_ENDPOINT = './analytics/flags/';
66

@@ -21,17 +21,17 @@ export interface AnalyticsProcessorOptions {
2121
logger?: Logger;
2222
/** Custom {@link fetch} implementation to use for API requests. **/
2323
fetch?: Fetch
24-
24+
2525
/** @deprecated Use {@link analyticsUrl} instead. **/
2626
baseApiUrl?: string;
2727
}
2828

2929
/**
3030
* Tracks how often individual features are evaluated whenever {@link trackFeature} is called.
31-
*
31+
*
3232
* Analytics data is posted after {@link trackFeature} is called and at least {@link ANALYTICS_TIMER} seconds have
3333
* passed since the previous analytics API request was made (if any), or by calling {@link flush}.
34-
*
34+
*
3535
* Data will stay in memory indefinitely until it can be successfully posted to the API.
3636
* @see https://docs.flagsmith.com/advanced-use/flag-analytics.
3737
*/
@@ -89,7 +89,7 @@ export class AnalyticsProcessor {
8989
/**
9090
* Track a single evaluation event for a feature.
9191
*
92-
* This method is called whenever {@link Flags.isFeatureEnabled}, {@link Flags.getFeatureValue} or {@link Flags.getFlag} are called.
92+
* @see FlagsmithConfig.enableAnalytics
9393
*/
9494
trackFeature(featureName: string) {
9595
this.analyticsData[featureName] = (this.analyticsData[featureName] || 0) + 1;

0 commit comments

Comments
 (0)