ConstructorIO

ConstructorIO

Class to instantiate the ConstructorIO client.

Constructor

new ConstructorIO(parameters) → {class}

Source:
Properties:
Name Type Description
search object Interface to module:search
browse object Interface to module:browse
autocomplete object Interface to module:autocomplete
recommendations object Interface to module:recommendations
tracker object Interface to module:tracker
quizzes object Interface to module:quizzes
assistant object Interface to module:assistant
Parameters:
Name Type Description
parameters object Parameters for client instantiation
Properties
Name Type Attributes Default Description
apiKey string Constructor.io API key
serviceUrl string <optional>
'https://ac.cnstrc.com' API URL endpoint
quizzesServiceUrl string <optional>
'https://quizzes.cnstrc.com' Quizzes API URL endpoint
assistantServiceUrl string <optional>
'https://assistant.cnstrc.com' AI Assistant API URL endpoint
segments array <optional>
User segments
testCells object <optional>
User test cells
clientId string <optional>
Client ID, defaults to value supplied by 'constructorio-id' module
sessionId number <optional>
Session ID, defaults to value supplied by 'constructorio-id' module
userId string <optional>
User ID
fetch function <optional>
If supplied, will be utilized for requests rather than default Fetch API
trackingSendDelay number <optional>
250 Amount of time to wait before sending tracking events (in ms)
sendReferrerWithTrackingEvents boolean <optional>
true Indicates if the referrer is sent with tracking events
sendTrackingEvents boolean <optional>
false Indicates if tracking events should be dispatched
idOptions object <optional>
Options object to be supplied to 'constructorio-id' module
eventDispatcher object <optional>
Options related to 'EventDispatcher' class
Properties
Name Type Attributes Default Description
enabled boolean <optional>
true Determine if events should be dispatched
waitForBeacon boolean <optional>
true Wait for beacon before dispatching events
networkParameters object <optional>
Parameters relevant to network requests
Properties
Name Type Attributes Description
timeout number <optional>
Request timeout (in milliseconds) - may be overridden within individual method calls
Returns:
Type
class

Methods

setClientOptions(options)

Description:
  • Sets the client options
Source:
Parameters:
Name Type Description
options object Client options to update
Properties
Name Type Attributes Description
apiKey string <optional>
Constructor.io API key
segments array <optional>
User segments
testCells object <optional>
User test cells
sessionId number <optional>
Session ID - Will only be set in DOM-less environments
userId string <optional>
User ID