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

The Flagship class represents the SDK. It facilitates the initialization process and creation of new visitors.

Constructors

new
private
Flagship()

Properties

private
_config: IFlagshipConfig
private
_configManager: IConfigManager
private
_status: FSSdkStatus
private
optional
_visitorInstance: Visitor
private
configManager: IConfigManager
private
instanceId: string
private
lastInitializationTimestamp: string

Methods

protected
setStatus(status: FSSdkStatus): void

When called, it will batch and send all hits that are in the pool before the application is closed

Return the current config set by the customer and used by the SDK.

Return current status of Flagship SDK.

getVisitor(): Visitor | undefined

Return the last visitor created if isNewInstance key is false. Return undefined otherwise.

Creates a new Visitor instance.

Static Properties

private
_instance: Flagship

Static Methods

protected
getInstance(): Flagship

When called, it will batch and send all hits that are in the pool before the application is closed

Return the current config set by the customer and used by the SDK.

Return current status of Flagship SDK.

getVisitor(): Visitor | undefined

Return the last visitor created if isNewInstance key is false. Return undefined otherwise.

Creates a new Visitor instance.

start(
envId: string,
apiKey: string,
): Flagship

Start the flagship SDK, with a custom configuration implementation