Install via NPM or you preferred package manager:
npm install @relewise/uniform-canvas
function getUser() {
return userHasAcceptedCookies
? UserFactory.byAuthenticatedId(<CookieProvider.UniqueId>)
: UserFactory.anonymous();
}
const recommender = new Recommender(`RELEWISE_DATASET_ID`, `RELEWISE_API_KEY`)
const enhancer = createRelewiseEnhancer({
recommender,
dataKeys: { products: ['ImageUrl', 'ShortDescription'], contents: ['url'] },
language: 'en-US',
currency: 'USD',
userFactory: getUser
});
await enhance({
composition: composition,
enhancers: new EnhancerBuilder().parameterType(RELEWISE_CANVAS_PARAMETER_TYPES, enhancer),
context: {},
});
Pull requests are always welcome.
Please fork this repository and make a PR when you are ready with your contribution.
Otherwise you are welcome to open an Issue in our issue tracker.
Relewise Uniform Canvas is licensed under the MIT license