Digital Experience Cloud Client
Unofficial client for the Sitefinity Digital Experience Cloud.
For additional information, please see the Digital Experience Cloud documentation.
Installing
npm install dec-client
Then within your application, you can reference the client with the following:
var DECClient = ;
Usage
Create a new DECClient()
. Make sure to provide your data center API key, and a source label.
var client = apiKey: 'your-api-key' source: 'your-datasource-label';
Writing Sentences
client;
Tracking Subject Metadata
Subject Metadata documentation
client;
Adding Subject Mapping
client;
Sending Sentences to the Digital Experience Cloud
The client allows you to write multiple interactions [sentences] at a time. Once all interactions have been written, you must flushData()
to actually send them to the DEC.
// returns a promiseclient;
Personalization
You can make a call to the DEC to retrieve information about the subject's Personas, Campaigns, and Lead Scores.
Create a new DECClient()
. Make sure to provide your data center API key, a source label, and an authToken.
var client = apiKey: 'your-api-key' source: 'your-datasource-label' authToken: 'appauth your-app-auth-key';
The authToken
is used by an authorized application to request data from the personalization end-points. You can construct the token by concatenating the "appauth " string with the Access Key of the authorized application, for example: "appauth 94e8b2d2-931e-cd01-b57b-07fa2013cb24".
An Authorized Application can be configured by navigating to the "Authorized applications" in the Administration section of your Data Center.
client
Example Response
{"items":[{"Id":1,"Score":100,"ThresholdPassedOn":"2017-08-11T01:45:21.120Z","Threshold":100}]}