Skip to main content
Latest
interface IFlagshipConfig
Re-export
import { type IFlagshipConfig } from "https://deno.land/x/flagship_io_js_sdk@3.3.2/index.ts";

Properties

optional
envId: string

Specify the environment id provided by Flagship, to use.

optional
apiKey: string

Specify the secure api key provided by Flagship, to use.

optional
timeout: number

Specify timeout in seconds for api request. Default is 2s.

optional
logLevel: LogLevel

Set the maximum log level to display

optional
decisionMode: DecisionMode

Specify the SDK running mode. BUCKETING or DECISION_API

optional
statusChangedCallback: (status: FlagshipStatus) => void

Define a callable in order to get callback when the SDK status has changed.

optional
logManager: IFlagshipLogManager

Specify a custom implementation of LogManager in order to receive logs from the SDK.

optional
fetchNow: boolean

Decide to fetch automatically modifications data when creating a new FlagshipVisitor

optional
pollingInterval: number

Specify delay between two bucketing polling. Default is 2s.

Note: If 0 is given then it should poll only once at start time.

optional
fetchThirdPartyData: boolean

Bucketing mode only

If true, will fetch the visitor's segment from universal data connector each time fetchFlags is called and append those segments in the visitor context

optional
enableClientCache: boolean

Indicates whether enables or disables the client cache manager. By enabling the client cache, it will allow you to keep cross sessions visitor experience.

optional
onBucketingSuccess: (param: { status: number; payload: BucketingDTO; }) => void

Define a callable in order to get callback when the first bucketing polling succeed.

optional
onBucketingFail: (error: Error) => void

Define a callable to get callback when the first bucketing polling failed.

optional
onBucketingUpdated: (lastUpdate: Date) => void

Define a callable to get callback each time bucketing data from Flagship has updated.

optional
initialBucketing: BucketingDTO

You can define an object containing the data received when fetching the bucketing endpoint. Providing this object will make bucketing ready to use and the first polling will immediately check for updates.

optional
decisionApiUrl: string
optional
hitDeduplicationTime: number

You can specify a delay in seconds for hit deduplication. After a hit is sent, any future attempts to send the same hit will be blocked until the specified delay has expired.

Note: If a value of 0 is given, no deduplication process will be used.

optional
visitorCacheImplementation: IVisitorCacheImplementation

Define an object that implement the interface visitorCacheImplementation, to handle the visitor cache.

optional
hitCacheImplementation: IHitCacheImplementation

You can define an object that implements the IHitCacheImplementation interface to manage hits cache.

optional
disableCache: boolean

If it's set to true, hit cache and visitor cache will be disabled otherwise will be enabled.

optional
language: 0 | 1 | 2
optional
deprecated
trackingMangerConfig: ITrackingManagerConfig

Define options to configure hit batching

optional
trackingManagerConfig: ITrackingManagerConfig

Define options to configure hit batching

optional
deprecated
onUserExposure: (param: UserExposureInfo) => void

You can define a callback function that will be called each time a flag is exposed to a user (i.e., when an activation hit is sent by the SDK).

optional
onVisitorExposed: (arg: OnVisitorExposed) => void

You can define a callback function that will be called each time a flag is exposed to a visitor (i.e., when an activation hit is sent by the SDK).

optional
sdkVersion: string
optional
onLog: (
level: LogLevel,
tag: string,
message: string,
) => void

Define a callable to get a callback whenever the SDK needs to report a log

optional
nextFetchConfig: Record<string, unknown>

In Next.js 13, you can define the time in seconds for storing SDK route cache before revalidation.

optional
fetchFlagsBufferingTime: number

(Default value 2) You can specify a delay in seconds for fetch flags call buffering. This means that after the SDK has fetched flags, they will be buffered for the specified delay. During this delay, any subsequent fetch flags calls will return the same flags.

Note:

  • If a value of 0 is given, no buffering process will be used.
  • If visitor data has changed, the buffering will be bypassed.
optional
disableDeveloperUsageTracking: boolean

Disable the collect of analytics data