Class

ApiManager

ApiManager(configopt, dependenciesopt)

Provides logic for network requests. Reads remote configuration and sends tracking events to Convert server.
Constructor

# new ApiManager(configopt, dependenciesopt)

Parameters:
Name Type Attributes Description
config Config <optional>
dependencies Object <optional>
eventManager EventManagerInterface <optional>
loggerManager LogManagerInterface <optional>
Implements:
  • ApiManagerInterface

View Source src/api-manager.ts, line 17

Classes

ApiManager
ApiManager

Methods

# enqueue(visitorId, eventRequest, segments) → {void}

Add request to queue for sending to server
Parameters:
Name Type Description
visitorId Id
eventRequest VisitorEvent
segments SegmentsData

View Source src/api-manager.ts, line 250

void

# getConfigByKey(sdkKey) → {Promise.<ConfigData>}

Get config data by SDK key
Parameters:
Name Type Description
sdkKey string

View Source src/api-manager.ts, line 282

Promise.<ConfigData>

# releaseQueue(reasonopt) → {Promise.<any>}

Send queue to server
Parameters:
Name Type Attributes Description
reason string <optional>

View Source src/api-manager.ts, line 257

Promise.<any>

# async request(method, path, data, headers) → {Promise.<HttpResponse>}

Send request to api server
Parameters:
Name Type Description
method
path
data
headers

View Source src/api-manager.ts, line 241

Promise.<HttpResponse>

# setData(data)

Set data
Parameters:
Name Type Description
data ConfigData

View Source src/api-manager.ts, line 275

# startQueue() → {void}

Start queue timer

View Source src/api-manager.ts, line 269

void

# stopQueue() → {void}

Stop queue timer

View Source src/api-manager.ts, line 263

void