Renji
Renji

Reputation: 47

How do I post as different users in react-activity-feed component using the same token?

Our Use case is Anyone can create a site in our platform bit as Wix lets say. Each Site has its own Community & Chat.

So I used my appId, secret key to create the user session token for the user of the site1 says site-1-user-1 for displaying the community of site1. I used react-activity-feed components to display the timeline feed of user site-1-user-1 (timeline:site-1-user-1)

I also displayed status update from above the activity feeds using react component. So when I post in this status update form, the activity gets displayed as by site-1-user-1.

How do I post activity as a different user say site-1-user-2 using the same token? I want the timeline feed with status update form to be displayed as a discussion forum where any logged in user can post any topic and see other activities also.

I am able to do this using PHP and getStream SDK. How is it possible by using the react component?

Upvotes: 1

Views: 428

Answers (1)

Nekuromento
Nekuromento

Reputation: 2235

Stream restricts actions user is able to perform when using client-side tokens:

  • User is able to read any feed
  • User is able to make feeds with her user-id follow any feed
  • User is able to post to feeds with her user-id

Client side tokens can only be used to perform the actions as the user the token was created for.

If you need to be able to impersonate other users or post contents for users to feeds they have no access to you will have to user server-side stream api

Upvotes: 1

Related Questions