More information about Flike can be found here.
Install the @flike/recommend package:
npm install @flike/recommend
Install the module as described in Installation.
Import the module into your code
import {Recommender} from '@flike/recommend
Instantiate the Recommender
with your API key.
const recommender = new Recommender(<your API key>);
Retrieve recommendations in real time:
const recs = await recommender.recommend("<user_id>", 6);
console.log(recs);
// {
// items: [
// {
// item_id: "eE8iqyS3nEYGMdSFVa4T",
// probability: 0.4804032,
// },
// {
// item_id: "uItDAqQhm5MMXtJRGXUx",
// probability: 0.1196371,
// },
// {
// item_id: "ZpJCKlbj7fglMhTzPFCQ",
// probability: 0.041603,
// },
// {
// item_id: "YUrKof1INQJ2HMzWnVar",
// probability: 0.024264,
// },
// {
// item_id: "mDSLnJEe37qEYsLpM2dG",
// probability: 0.018669,
// },
// ],
// correlation_id: "cid-9461ba9d-856d-4d5e-b776-bb90e6eed35d",
// }
Refer to the library reference for further documentation.
Generated using TypeDoc