Class

Core

Core(config)

Core
Constructor

# new Core(config)

Parameters:
Name Type Description
config Config
dependencies.dataManager DataManagerInterface
dependencies.eventManager EventManagerInterface
dependencies.experienceManager ExperienceManagerInterface
dependencies.featureManager FeatureManagerInterface
dependencies.segmentsManager SegmentsManagerInterface
dependencies.apiManager ApiManagerInterface
dependencies.loggerManager LogManagerInterface
Implements:
  • CoreInterface

View Source src/core.ts, line 12

Classes

Core
Core

Methods

# createContext(visitorId, visitorAttributesopt) → {ContextInterface|null}

Create visitor context
Parameters:
Name Type Attributes Description
visitorId string A visitor id
visitorAttributes Record.<string, any> <optional>
An object of key-value pairs that are used for audience and/or segments targeting

View Source src/core.ts, line 212

ContextInterface | null

# async fetchConfig() → {Promise.<void>}

Fetch remote config data

View Source src/core.ts, line 128

Promise.<void>

# initialize(config)

Initialize credentials, configData etc..
Parameters:
Name Type Description
config

View Source src/core.ts, line 55

# on(event, fn) → {void}

Add event handler to event
Parameters:
Name Type Description
event SystemEvents Event name
fn function A callback function which will be fired

View Source src/core.ts, line 220

void

# async onReady() → {Promise.<void>}

Promisified ready event

View Source src/core.ts, line 227

Promise.<void>