Skip to content

Instantly share code, notes, and snippets.

@astrotars
Created February 21, 2018 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astrotars/f4f10bf0e36ab4469f8a5629b1cda1ad to your computer and use it in GitHub Desktop.
Save astrotars/f4f10bf0e36ab4469f8a5629b1cda1ad to your computer and use it in GitHub Desktop.
personalization({
endpoint: '/user_recommendations',
userId: req.user.sub, // id is extracted from the jwt
})
.then(users => {
// iterate over users and enrich
users.map(user => {
// do something with the user data
});
})
.catch(err => {
res.status(503).send(err.response.data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment