recombee / js-api-client

JavaScript client for easy use of the Recombee recommendation API from frontend
23 stars 11 forks source link

AddUser request #14

Closed jbtheard closed 2 years ago

jbtheard commented 2 years ago

How can we add a user as per https://docs.recombee.com/api.html#users ?

OndraFiedler commented 2 years ago

Hi @jbtheard,

The users are automatically created from the sent interactions.

jbtheard commented 2 years ago

But I want to be able to make a recommendation event before user has first interacted with any content! in such case request would throw because of user not existing. How am I supposed to do that ?

jbtheard commented 2 years ago

I may be the first one to state it but this API methods indeed has some interest !

OndraFiedler commented 2 years ago

But I want to be able to make a recommendation event before user has first interacted with any content! in such case request would throw because of user not existing. How am I supposed to do that ?

Same as with the interactions, the user gets created on the first recommendation request with the given userId (because cascadeCreate=true by default in the JS client).

jbtheard commented 2 years ago

oh ok! I'll check that. Thanks for the quick answer.

jbtheard commented 2 years ago

oh that's actually because I do that first call on the backend...

jbtheard commented 2 years ago

I'll add cascadeCreate=true on the backend and that should be fixed