@attraqt/xo-js
v2.0.0
Published
## Installation and Usage
Downloads
3,294
Readme
@attraqt/xo-js
Installation and Usage
npm install --save @attraqt/xo-js
import * as xo from '@attraqt/xo-js';
xo.init({
activity: {
trackerKey: 'YOUR_TRACKER_KEY',
region: 'WEBSITE_REGION' // optional, set to EU by default
},
search: {
token: 'SEARCH_API_TOKEN'
}
});
xo.activity.send({
action: 'view',
target: {
product: 'YOUR_PRODUCT_ID'
}
});
xo.search.query('T-Shirt', {
offset: 10,
limit: 30,
filter: 'price < 50'
});
xo.search.suggest('T-Shirt', {
filter: 'price < 50',
groupBy: {
attribute: 'kind',
count: 10,
values: ['product', 'shops', 'ads']
}
});
xo.search.autocomplete('T-Shirt', {
numberOfSuggestions: 5
});
Modules
- @attraqt/activity: Collecting user activities
- @attraqt/search: Search items