KRISHNAKANTH BASKARAN
KRISHNAKANTH BASKARAN

Reputation: 55

GetStream- Without following feed?

I need the public flat feed. For instance, the user named 'public'.It does not have follower or following anyone, if user:public posts any activity, it can reach all of the users timeline, how to do that?

I have tried the user:global but without following the user:global, did not get or retrieve the activity of user:global

Upvotes: 0

Views: 432

Answers (1)

Nekuromento
Nekuromento

Reputation: 2235

While Stream does not provide a global feed there are multiple ways you could implement a public global feed:

  1. Define a 'global' feed (e.g. user:global) and follow that feed by all user feeds on user creation
const user = await client.currentUser.getOrCreate({
    name: "John Doe", 
    occupation: "Software Engineer",
    gender: 'male'
});
await client.feed("user").follow("user", "global");

This is enough if you just want to expose users to global feed content.

  1. Use to field in activity to deliver the content to all interested feeds (https://getstream.io/docs/#targetting) but it has a limit of 100 targets.

Upvotes: 3

Related Questions