Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
How to get ownReactions for reactions and child reactions?

I would like to check if a user has already liked an activity/comment before, so I would like to get the likes of a user on an activity, or the likes of a user on a comment. However, this populates all reactions on an activity/comment instead of filtering only the user's reactions.

client.feed('user', 'Amy').get({ withReactionCounts: true, withOwnReactions: true })

I have tried the workaround commented on the Github project and tried playing around with both withOwnReactions and ownReactions based on this question but to no avail.

I currently have stream-js v7.2.11 installed.

Thanks!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The parameters should be reactions.own and reactions.counts.

client.feed('user', 'Amy').get({reactions: {own: true, counts: true})

The other thing you need to do if you are making a server side call is to make sure you are calling it with a user token for the user you wish to see own reactions for, otherwise it will give you everything, as the client won't know who "own" refers to.

//Create the server side client
const serverClient = stream.connect(
  'abcde12345',
  'somereallylongandverysecretapikeythatyoushouldnotshareonstackoverflow',
  '123456');

//Create the user specific token
const userToken = serverClient.createUserToken('Amy');

//Create the user specific client
const userClient = stream.connect('abcde12345', userToken, '123456');

Now you should be able to get data from your feed with own_reactions populated only with data for the user you specified.

userClient.feed('user', 'Amy').get({reactions: {own: true, counts: true})

An additional gotcha is that if you create a new feed group other than the default ones Stream creates, than you will also need to email Stream's support team to ask them to change the permission to "Global Read" otherwise you'll get a 403 error. There doesn't seem to be any way to do it via their console. The user feed group is set to Global Read by default, but new feed groups are set to private. Their support was very helpful and fixed it up for me in less than an hour.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda