Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
class DefaultStrategy
import { DefaultStrategy } from "https://deno.land/x/flagship_io_js_sdk@3.1.2/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): HitAbstract | null
private
getHitLegacy(hit: HitShape)
private
isDeDuplicated(key: string, deDuplicationTime: number): boolean
private
prepareAndSendHit(hit: IHit | HitShape | HitAbstract, functionName?)
private
updateContextKeyValue(key: string, value: primitive): void
protected
globalFetchFlags(functionName: string): Promise<void>
protected
logDeactivateOnBucketing(functionName: string): void
protected
onUserExposedCallback(unnamed 0: { flag: FlagDTO; visitor: IVisitor; }): void
protected
sendActivate(flagDto: FlagDTO): 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: HitAbstract): Promise<void>
sendHit(hit: IHit): Promise<void>
sendHit(hit: HitShape): Promise<void>
sendHits(hits: HitAbstract[]): Promise<void>
sendHits(hits: IHit[]): Promise<void>
sendHits(hits: HitShape[]): Promise<void>
synchronizeModifications(): Promise<void>
updateContext(key: string, value: primitive): void
updateContext(context: Record<string, primitive>): void
userExposed<T>(param: { key: string; flag?: FlagDTO; defaultValue: T; }): Promise<void>