Skip to main content
Go to Latest
class DefaultStrategy
import { DefaultStrategy } from "https://deno.land/x/flagship_io_js_sdk@3.0.11/visitor/DefaultStrategy.ts";

Methods

private
activate(key: string)
private
checkAndGetModification<T>(params: modificationsRequested<T>, activateAll?: boolean): T
private
checkPredefinedContext(key: string, value: primitive): boolean | null
private
getHit(hit: IHit | BatchDTO): HitAbstract | null
private
getHitLegacy(hit: HitShape)
private
isDeDuplicated(key: string, deDuplicationTime: number): boolean
private
updateContextKeyValue(key: string, value: primitive): void

Update the visitor context values, matching the given keys, used for targeting.

A new context value associated with this key will be created if there is no previous matching value. Context key must be String, and value type must be one of the following : Number, Boolean, String.

protected
globalFetchFlags(functionName: string): Promise<void>
protected
logDeactivateOnBucketing(functionName: string): void
protected
sendActivate(modification: FlagDTO, functionName?): Promise<void>
activateModification(params: string): Promise<void>
activateModifications(keys: { key: string; }[]): Promise<void>
activateModifications(keys: string[]): Promise<void>
authenticate(visitorId: string): void
clearContext(): void
fetchFlags(): Promise<void>
getAllFlagsData(activate: boolean): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>
deprecated
getAllModifications(activate?): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>

returns a Promise containing all the data for all the campaigns associated with the current visitor.

getFlagMetadata(param: { metadata: IFlagMetadata; key?: string; hasSameType: boolean; }): IFlagMetadata
getFlagValue<T>(param: { key: string; defaultValue: T; flag?: FlagDTO; userExposed?: boolean; }): T
getFlatsDataForCampaign(campaignId: string, activate: boolean): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>
getModification<T>(params: modificationsRequested<T>): Promise<T>
getModificationInfo(key: string): Promise<FlagDTO | null>
getModificationInfoSync(key: string): FlagDTO | null
getModifications<T>(params: modificationsRequested<T>[], activateAll?: boolean): Promise<Record<string, T>>
deprecated
getModificationsForCampaign(campaignId: string, activate?): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>

Get data for a specific campaign.

getModificationsSync<T>(params: modificationsRequested<T>[], activateAll?: boolean): Record<string, T>
sendHit(hit: BatchDTO): Promise<void>
sendHit(hit: HitAbstract): Promise<void>
sendHit(hit: IHit): Promise<void>
sendHit(hit: HitShape): Promise<void>
sendHits(hits: BatchDTO[]): Promise<void>
sendHits(hits: HitAbstract[]): Promise<void>
sendHits(hits: IHit[]): Promise<void>
sendHits(hits: HitShape[]): Promise<void>
synchronizeModifications(): Promise<void>
updateContext(context: Record<string, primitive>): void
userExposed<T>(param: { key: string; flag?: FlagDTO; defaultValue: T; }): Promise<void>