Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
method Flagship.newVisitor
import { Flagship } from "https://deno.land/x/flagship_io_js_sdk@3.1.4/main/Flagship.ts";

Create a new visitor with a context.

Parameters

optional
visitorId: string | null

: Unique visitor identifier.

optional
context: Record<string, primitive>

: visitor context. e.g: { isVip: true, country: "UK" }.

Returns

a new visitor instance

Create a new visitor with a context.

Parameters

optional
params: NewVisitor

: Unique visitor identifier.

Returns

a new visitor instance

Parameters

optional
param1: NewVisitor | string | null
optional
param2: Record<string, primitive>