class VisitorAbstract
implements IVisitor
extends EventEmitter
Abstract
import { VisitorAbstract } from "https://deno.land/x/flagship_io_js_sdk@3.2.3/visitor/VisitorAbstract.ts";
Constructors
new
VisitorAbstract(param: NewVisitor & { visitorId?: string; configManager: IConfigManager; context: Record<string, primitive>; })Properties
protected
_campaigns: CampaignDTO[]protected
_configManager: IConfigManagerprotected
_context: Record<string, primitive>protected
_flags: Map<string, FlagDTO>campaigns: CampaignDTO[]
readonly
config: IFlagshipConfigreadonly
configManager: IConfigManagercontext: Record<string, primitive>
Clear the current context and set a new context value
flagsData: Map<string, FlagDTO>
modifications: Map<string, Modification>
optional
visitorCache: VisitorCacheDTOMethods
protected
generateVisitorId(): stringprotected
getStrategy(): VisitorStrategyAbstractprotected
setInitialFlags(modifications?: Map<string, FlagDTO> | FlagDTO[]): voidprotected
setInitializeCampaigns(campaigns?: CampaignDTO[], hasModifications?: boolean): voidprotected
updateCache(): voidabstract
activateModification(key: string): Promise<void>abstract
activateModifications(keys: { key: string; }[]): Promise<void>abstract
activateModifications(keys: string[]): Promise<void>abstract
activateModifications(params: Array<{ key: string; }> | Array<string>): Promise<void>abstract
authenticate(visitorId: string): voidabstract
clearContext(): voidclearDeDuplicationCache(deDuplicationTime: number): void
abstract
fetchFlags(): Promise<void>abstract
getAllFlagsData(activate: boolean): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>abstract
getAllModifications(activate: boolean): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>abstract
getFlagMetadata(param: { metadata: IFlagMetadata; key?: string; hasSameType: boolean; }): IFlagMetadatagetFlagsDataArray(): FlagDTO[]
abstract
getFlagValue<T>(param: { key: string; defaultValue: T; flag?: FlagDTO; userExposed?: boolean; }): Tabstract
getFlatsDataForCampaign(campaignId: string, activate: boolean): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>abstract
getModification<T>(params: modificationsRequested<T>): Promise<T>abstract
getModificationInfo(key: string): Promise<Modification | null>abstract
getModificationInfoSync(key: string): Modification | nullabstract
getModifications<T>(params: modificationsRequested<T>[], activateAll?: boolean): Promise<Record<string, T>>abstract
getModificationsForCampaign(campaignId: string, activate: boolean): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>abstract
getModificationsSync<T>(params: modificationsRequested<T>[], activateAll?: boolean): Record<string, T>abstract
getModificationSync<T>(params: modificationsRequested<T>): TloadPredefinedContext(): void
abstract
sendHit(hit: HitAbstract): Promise<void>abstract
sendHit(hit: IHit | HitAbstract | HitShape): Promise<void>abstract
sendHits(hit: HitAbstract[]): Promise<void>abstract
sendHits(hit: HitAbstract[] | IHit[] | HitShape[]): Promise<void>setConsent(hasConsented: boolean): void
Set if visitor has consented for protected data usage.
abstract
synchronizeModifications(): Promise<void>abstract
unauthenticate(): voidabstract
updateContext(key: string, value: primitive): voidabstract
updateContext(context: Record<string, primitive>): voidabstract
updateContext(context: Record<string, primitive> | string, value?: primitive): voidabstract
visitorExposed<T>(param: { key: string; flag?: FlagDTO; defaultValue: T; }): Promise<void>