await serverClient.feeds.createFeedView({
id: "<view id>",
activity_selectors: [
{
type: "following",
},
],
ranking: { type: "recency" },
});Feed views
When to use feed views
Feed groups let you define what activities should be included in the feed and the ranking to sort these activities.
By default all feeds in the given group will have the same settings. However, you might want to experiment with different selectors and rankings. Feed views let you do that by overriding the group's default settings.
Note that any write operation to feed groups/views can take up to 30 seconds to propagate to all API nodes.
Applications can't have more than 100 feed views
Feed view operations are only available on server-side.
If you create a feed view with the same ID as a built-in feed group (user, timeline, notification, foryou, story, stories), that feed view will automatically be used on all default reads for that group — even without passing view in the request. This lets you customize built-in group behavior, but can cause unexpected results if you intended the feed view to only be used explicitly. To avoid conflicts, use a distinct ID for feed views that you only want to apply when passed explicitly.
Alternatively you can use the getOrCreateFeedView endpoint that will create and apply settings, or return the existing view.
feed.getOrCreate({
// Override the default view id
view: "<id of a feed view>",
});With custom feed views you can control
- Activity selectors
- Ranking
- Aggregation
List feed views
To list existing feed views and their configurations:
await client.feeds.listFeedViews();Updating feed views
It's possible to update any custom or built-in feed views.
await serverClient.feeds.updateFeedView({
id: "<view id to update>",
// Fields to update
});Deleting feed views
await serverClient.feeds.deleteFeedView({
id: "view id to delete",
});