class Visitor
implements IVisitor
extends EventEmitter
import { Visitor } from "https://deno.land/x/flagship_io_js_sdk@4.0.4/visitor/index.ts";
The Visitor
class represents a unique user within your application. It aids in
managing the visitor's data and fetching the corresponding flags for the visitor
from the Flagship platform .
Methods
authenticate(visitorId: string): void
clearContext(): void
fetchFlags(): Promise<void>
getFlag(key: string): IFSFlag
getFlags(): IFSFlagCollection
sendHit(hit: HitAbstract): Promise<void>
sendHit(hit: IHit): Promise<void>
sendHit(hit: IHit | HitAbstract): Promise<void>
sendHits(hits: HitAbstract[]): Promise<void>
sendHits(hits: IHit[]): Promise<void>
sendHits(hits: HitAbstract[] | IHit[]): Promise<void>
setConsent(hasConsented: boolean): void
unauthenticate(): void
updateContext(key: string, value: primitive): void
updateContext(context: Record<string, primitive>): void