NodeJS & NPM

A npm library for Quick Integration With Recometry

How to use


  1. Install the npm package:
npm i recometry

  1. Initialize the library
const recometry = new Recometry({ apiKey: "your-api-key", env: "live" });

  1. Recommend products or contents
const response = await recometry.recommend({
  modelId: 62,
  userId: '17850',
  limit: 1,
});

//print recommended products for user 17850
console.log(response.data); // [{ "userId": "17850", "productId": "21870", "score": 1.0883 }]

  1. Send click events to server to further improve the accuracy of the agent / model over time
await recometry.collect({
  type: 'click',
  data: {
    productId: '21870'
  },
  userId: '17850'
});