3

I'm trying to integrate getstream.io into our framework to deliver activities to subscribers and also allow clients to filter activities. GetStream doesn't allow filter on activities, So I had to create new group and link the activities through to property. Is this the proper way to do filter?

We need to allow clients to update the activity with bookmarks/comments from browser. I'm having issue here.

var activity = {
  actor: 'org_1:user_1',
  verb: 'start',
  object: 'site',
  time: '2018-04-18T11:19:04.263000',
  foreign_id: 'site_id:1',
  comment: 'start properly'
}
client.updateActivities([activity]).then(
  function(res) {
    console.log('res:',res)
  },
  function(err) {
    console.log('err:',err)
  }
);

The code gives following error in browser but works when executed from the node.js server

getstream.js:2107 Uncaught TypeError: jwt.sign is not a function
    at Object.exports.JWTScopeToken (getstream.js:2107)
    at StreamClient.updateActivities (getstream.js:816)
    at <anonymous>:8:8

I pass the feed token that is generated in the node.js server to client to make connection to the feed group.

Should I add JWT to the updateActivities request, If so what should the payload contain and how do I add a token to the request?

1

1 Answer 1

1

True. JWT is only included as a back-end dependency and not compiled in your front-end assets, probably.

Updating activities is not an operation to be done on the front-end side of your application. The only recommended operation on the front-end is getting more activities with a read-only token and client.feed(...).getActivities().

Cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.