Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagsmith-nodejs",
"version": "5.1.1",
"version": "6.0.0",
"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.",
"main": "./build/cjs/index.js",
"type": "module",
Expand Down
10 changes: 5 additions & 5 deletions sdk/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { pino, Logger } from 'pino';
import { Fetch } from "./types.js";
import { Flags } from "./models.js";
import { FlagsmithConfig } from "./types.js";

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

Expand All @@ -21,17 +21,17 @@ export interface AnalyticsProcessorOptions {
logger?: Logger;
/** Custom {@link fetch} implementation to use for API requests. **/
fetch?: Fetch

/** @deprecated Use {@link analyticsUrl} instead. **/
baseApiUrl?: string;
}

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