You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param targetUserId - ID of the user who will see the recommendations.
* Specifying the *targetUserId* is beneficial because:
* * It makes the recommendations personalized
* * Allows the calculation of Actions and Conversions
* in the graphical user interface,
* as Recombee can pair the user who got recommendations
* and who afterward viewed/purchased an item.
* If you insist on not specifying the user, pass `null`
* (`None`, `nil`, `NULL` etc., depending on the language) to *targetUserId*.
* Do not create some special dummy user for getting recommendations,
* as it could mislead the recommendation models,
* and result in wrong recommendations.
* For anonymous/unregistered users, it is possible to use, for example, their session ID.
* @param count - Number of items to be recommended (N for the top-N recommendation).
* @param optional - Optional parameters given as an object.
*/
constructor(
itemId: string,
targetUserId: string,
The docs align with the API docs on your site's API reference, and mention passing null, however the type only allows string. Based on the docs, it seems like string | null should be the type. I'm casting in my own code.
Note
I only referenced on occurrence, but this is a repeated issue.
See
js-api-client/src/index.d.ts
Lines 650 to 668 in 3559932
The docs align with the API docs on your site's API reference, and mention passing
null, however the type only allowsstring. Based on the docs, it seems likestring | nullshould be the type. I'm casting in my own code.Note
I only referenced on occurrence, but this is a repeated issue.