Relewise / relewise-integrations-uniform-canvas

Relewise data enhancers for Uniform Canvas.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Relewise data enhancers for Uniform Canvas.

License:MIT License


Languages

Language:TypeScript 90.1%Language:JavaScript 9.9%