@flike/recommend
TypeScript icon, indicating that this package has built-in type declarations

1.4.21 • Public • Published

More information about Flike can be found here.

Installation

Install the @flike/recommend package:

npm install @flike/recommend

Quick Guide

  1. Install the module as described in Installation.

  2. Import the module into your code

    import {Recommender} from '@flike/recommend
  3. Instantiate the Recommender with your API key.

    const recommender = new Recommender(<your API key>);
  4. 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",
    // }

Reference

Refer to the library reference for further documentation.

/@flike/recommend/

    Package Sidebar

    Install

    npm i @flike/recommend

    Weekly Downloads

    18

    Version

    1.4.21

    License

    MIT

    Unpacked Size

    25.5 kB

    Total Files

    6

    Last publish

    Collaborators

    • flike_admin