Feed & Timeline

Let your users showcase their unique personality right in their timelines

Feed is a new way for users to create content on various areas of the SDK. Currently, users and groups can have feeds. Each feed consists of a collection of posts. Users are able to create posts on any groups that they are a member of and any user that they can find.

There is a global feed which is an aggregate of all the posts in a user's feed.

Feed management methods are all contained in a FeedRepository class.

import { FeedRepository } from 'eko-sdk';

Query User Feed

You can get any user's feed by calling the method below with the userId:

const liveFeed = FeedRepository.getUserFeed({
    userId: 'user1'
});

liveFeed.once('dataUpdated', models => {
 //
});

There is a quick easy method to get your own feed:

const liveFeed = FeedRepository.getMyFeed();

liveFeed.once('dataUpdated', models => {
 //
});

Query Group Feed

You can get any group's feed by calling the method below with the communityId:

const liveFeed = FeedRepository.getCommunityFeed({
    communityId: 'community1',
});

liveFeed.once('dataUpdated', models => {
 //
});

Query Global Feed

You can retrieve your global feed by calling the following method:

const liveFeed = FeedRepository.getGlobalFeed();

liveFeed.once('dataUpdated', models => {
 //
});

Last updated