Feed and Activity Visibility

Feed Visibility Levels

Feed groups have a default visibility (if it's not set when creating the group, visible will be set). You can also override the group's default when creating a feed. For changing a feed's visibility after creation, see Changing Feed Visibility.

Visibility changes are asynchronous. The change request returns optimistically while follow relationships are reconciled in the background, and counts may be temporarily stale until reconciliation completes.

feed := client.Feeds().Feed("user", "alice")
feed.GetOrCreate(context.Background(), &getstream.GetOrCreateFeedRequest{
  Data: &getstream.FeedInput{
    // Override group's default visibility
    Visibility: getstream.PtrTo("public"),
  },
  UserID: getstream.PtrTo("alice"),
})

feedGroupID := "test-feed-group"
createResponse, err := client.Feeds().CreateFeedGroup(context.Background(), &getstream.CreateFeedGroupRequest{
  ID:                feedGroupID,
  DefaultVisibility: getstream.PtrTo("public"),
  // Other settings
})
if err != nil {
  log.Fatal("Error creating feed group:", err)
}
log.Printf("Feed group created: %+v", createResponse.Data)

// Change visibility after feed creation
changeResponse, err := feed.ChangeFeedVisibility(context.Background(), &getstream.ChangeFeedVisibilityRequest{
  Visibility: "followers",
})
if err != nil {
  log.Fatal("Error changing feed visibility:", err)
}
log.Printf("Visibility updated: %+v", changeResponse.Data)

Supported visibility levels:

LevelViewing feed (activities + metadata)FollowingPosting
visibleAnyone can viewAnyone can followOnly the owner or member/follower with the post permission can post
publicAnyone can viewAnyone can followAnyone can post
followersOnly approved followers can viewAnyone can send a follow request,
follow requests have to be approved
Only the owner or member/follower with the post permission can post
membersOnly members can viewOnly members can followOnly the owner or member/follower with the post permission can post
privateOnly the owner can viewOnly the owner can followOnly the owner can post

Activity Visibility Levels

  • public: marks the activity as public - everyone who can view feed content, can see it
  • private: marks the activity as private - only feed owner can see it
  • tag:mytag: marks the activity as only visible to followers/members with the permission to see this tag

This visibility system is very flexible and allows you to build:

  • Apps like Patreon where only certain levels of users can see your content
  • Apps like Strava where it's possible to share your activity with nobody, everyone or your followers
response, err := client.Feeds().AddActivity(context.Background(), &getstream.AddActivityRequest{
    Feeds:         []string{"user:alice"},
    Type:          "post",
    Text:          getstream.PtrTo("Premium content"),
    Visibility:    getstream.PtrTo("tag"),
    VisibilityTag: getstream.PtrTo("premium"),
    UserID:        getstream.PtrTo("alice"),
})
if err != nil {
    log.Fatal("Error adding activity:", err)
}

log.Printf("Activity added successfully: %+v", response)
// Premium users can see full activity, others a preview

For all the details on tag visibility read the Membership levels guide.