class Visitor
implements IVisitor
extends EventEmitter
import { Visitor } from "https://deno.land/x/flagship_io_js_sdk@3.2.3/visitor/Visitor.ts";
Constructors
new
Visitor(visitorDelegate: VisitorAbstract)Properties
private
visitorDelegate: VisitorAbstractreadonly
config: IFlagshipConfigreadonly
context: Record<string, primitive>readonly
flagsData: Map<string, FlagDTO>readonly
modifications: Map<string, FlagDTO>Methods
activateModification(key: string): Promise<void>
activateModifications(keys: { key: string; }[]): Promise<void>
activateModifications(keys: string[]): Promise<void>
activateModifications(params: Array<{ key: string; }> | Array<string>): Promise<void>
authenticate(visitorId: string): void
clearContext(): void
fetchFlags(): Promise<void>
getAllFlagsData(activate?): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>
getAllModifications(activate?): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>
getFlagsDataArray(): FlagDTO[]
getFlatsDataForCampaign(campaignId: string, activate?): 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>>
getModificationsForCampaign(campaignId: string, activate?): Promise<{ visitorId: string; campaigns: CampaignDTO[]; }>
getModificationsSync<T>(params: modificationsRequested<T>[], activateAll?: boolean): Record<string, T>
getModificationSync<T>(params: modificationsRequested<T>): T
sendHit(hit: HitAbstract): Promise<void>
sendHit(hit: IHit | HitAbstract | HitShape): Promise<void>
sendHits(hits: HitAbstract[]): Promise<void>
sendHits(hits: HitAbstract[] | IHit[] | HitShape[]): Promise<void>
setConsent(hasConsented: boolean): void
synchronizeModifications(): Promise<void>
unauthenticate(): void
updateContext(key: string, value: primitive): void
updateContext(context: Record<string, primitive>): void