Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda