@coframe/sdk 1.1.30 → 1.1.32
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/README.md +42 -5
- package/dist/pkg/cf.cjs.js +9 -1
- package/dist/pkg/cf.esm.mjs +9 -1
- package/dist/pkg/feature-flags.cjs.js +239 -9
- package/dist/pkg/feature-flags.esm.mjs +239 -9
- package/dist/pkg/react.cjs.js +17 -11
- package/dist/pkg/react.esm.mjs +17 -11
- package/dist/pkg/server.cjs.js +276 -3
- package/dist/pkg/server.esm.mjs +276 -4
- package/dist/pkg/types/feature-flags.d.ts +9 -5
- package/dist/pkg/types/react.d.ts +5 -4
- package/dist/pkg/types/server.d.ts +12 -6
- package/package.json +1 -1
|
@@ -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:
|
|
288
|
-
declare function getFeatureFlag(key: string, options:
|
|
289
|
-
declare function isFeatureEnabled(key: string, options:
|
|
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:
|
|
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.
|
|
3
|
+
"version": "1.1.32",
|
|
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",
|