Skip to content

Relewise/relewise-integrations-uniform-canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relewise Uniform Canvas GitHub license npm version PRs Welcome

Installation

Install via NPM or you preferred package manager:

npm install @relewise/uniform-canvas

Usage examples

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: {},
});

Contributing

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.

License

Relewise Uniform Canvas is licensed under the MIT license