@coframe/sdk 1.1.30 → 1.1.31

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.
@@ -253,6 +253,8 @@ interface FeatureFlagSelector {
253
253
  groups?: string[];
254
254
  }
255
255
 
256
+ declare function flushFeatureFlagEvents(): Promise<void>;
257
+
256
258
  interface GetProjectDataOptions {
257
259
  projectId: string;
258
260
  currentUrl: string;
@@ -282,16 +284,20 @@ interface EvaluateFlagsOptions {
282
284
  userContext?: Record<string, unknown>;
283
285
  country?: string;
284
286
  device?: 'desktop' | 'mobile';
287
+ ingestUrl?: string;
288
+ sendEvent?: boolean;
285
289
  }
290
+ type FeatureFlagServerReadOptions = Omit<EvaluateFlagsOptions, 'selector'>;
286
291
  declare function evaluateFlags(options: EvaluateFlagsOptions): Promise<FeatureFlagsResponse | undefined>;
287
- declare function getFeatureFlagResult(key: string, options: Omit<EvaluateFlagsOptions, 'selector'>): Promise<FeatureFlagResult | undefined>;
288
- declare function getFeatureFlag(key: string, options: Omit<EvaluateFlagsOptions, 'selector'>): Promise<FeatureFlagValue | undefined>;
289
- declare function isFeatureEnabled(key: string, options: Omit<EvaluateFlagsOptions, 'selector'> & {
292
+ declare function getFeatureFlagResult(key: string, options: FeatureFlagServerReadOptions): Promise<FeatureFlagResult | undefined>;
293
+ declare function getFeatureFlag(key: string, options: FeatureFlagServerReadOptions): Promise<FeatureFlagValue | undefined>;
294
+ declare function isFeatureEnabled(key: string, options: FeatureFlagServerReadOptions & {
290
295
  defaultValue?: boolean;
291
296
  }): Promise<boolean | undefined>;
292
- declare function getFeatureFlagPayload(key: string, options: Omit<EvaluateFlagsOptions, 'selector'>): Promise<JsonValue | null | undefined>;
297
+ declare function getFeatureFlagPayload(key: string, options: FeatureFlagServerReadOptions): Promise<JsonValue | null | undefined>;
293
298
  declare const getRemoteConfig: typeof getFeatureFlagPayload;
299
+
294
300
  declare function getProjectData(options: GetProjectDataOptions): Promise<CoframeProjectPayload | null>;
295
301
 
296
- export { evaluateFlags, getFeatureFlag, getFeatureFlagPayload, getFeatureFlagResult, getProjectData, getRemoteConfig, isFeatureEnabled };
297
- export type { CoframeProjectPayload, EvaluateFlagsOptions, GetProjectDataOptions };
302
+ export { evaluateFlags, flushFeatureFlagEvents, getFeatureFlag, getFeatureFlagPayload, getFeatureFlagResult, getProjectData, getRemoteConfig, isFeatureEnabled };
303
+ export type { CoframeProjectPayload, EvaluateFlagsOptions, FeatureFlagServerReadOptions, GetProjectDataOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coframe/sdk",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "description": "Coframe optimizes your website using generative AI to deliver maximum impact to your audience and allow your site to improve itself as you sleep. Learn more at coframe.com.",
5
5
  "main": "dist/pkg/cf.cjs.js",
6
6
  "module": "dist/pkg/cf.esm.mjs",