Web SDK
  • Home
  • Overview
  • Getting started
  • References
    • Authentication
    • Account
      • Users
    • Notifications
    • Bookmark
    • 2FA
    • Collection
    • Connection filters
    • Feed
    • File Upload
    • Invite
    • Messaging
    • Payment
    • Reviews
    • Search
    • Verification
      • Supported document type
      • List of expected ISO countries
    • Wallet
      • Withdrawal
  • Tutorial
  • Web API
Powered by GitBook
On this page
  • IFeed
  • Feed Types
  • Create a feed
  • Get all feeds
  • FindFeedDto
  • Get a feed by ID
  • Dismiss all feeds
  • Dismiss a feed
  1. References

Feed

This section details the services that manages timeline information for an authenticated user

PreviousConnection filtersNextFile Upload

Last updated 11 months ago

Feeds are particularly interesting pieces of timeline information notifying a user of particular events happening in the chainsite, they present a summary of specific events, that in effect apply to the user, either for the user to take action or to be aware of happenings in the chainsite.

Feeds are usually generated, based on the actions performed, but can also be created by the authenticated user.

There are different feed types. The IFeed is the main model that contains the information timeline.

IFeed

Field
Description

_id

Identifier for the feed. This is the id used to dismiss a feed

string

creator

The authenticated user that setup the feed.

string

owner

The recipient to whom the feed refers to.

string

owners

List of recipients to whom the feed refers to.

string[]

data

Identifier for the associated information for the feed

string

description

Detailed explanation for the feed

string

title

Appellation for the feed

string

type

Categorization of the feed

isPublic

Identifer for whether its a public or private feed only for the owner, the recipient.

boolean

closed

Identifer to determine that this feed is dismissed

boolean

Feed Types

Field
Description

collection_invite

Type for when a user is invited to a collection

collection_invite_rejected

Type for when a user rejects a collection invite

collection_invite_accepted

Type for when a collection invite is accepted

collection_invite_cancelled

Type for when a collection invite is cancelled

collection_created

Type for when a collection is created

collection_update

Type for when a collection is updated

referral_signup

Type for when a referral signup

Create a feed

Setup a new timeline information for a new event. The CreateFeedDto is needed for this service, as well as the authenticated user.

CreateFeedDto

Field
Description
Type
Is Optional

title

The appellation for the timeline

string

false

description

Detailed explanation for the timeline

string

false

type

The categorization of the feed

false

data

Identifier for the record that is being created into a timeline. When the feed is retrieved, this identifier is populated to retrieve that record information.

string

false

isPublic

Identifier to determine the privacy of the timeline, meaning the timeline can be shared across the chainsite to other users or only to the authenticated user

boolean

false

owners

The recipient(s) os the feed, to whom the feed is created for.

string[] | string

true

Here is a sample implementation

export const createFeed = async (authToken: string, payload: CreateFeedDto) => {
  try {
    const feed: ResponseDto<{}> = await init.feed.create(authToken, payload);
  } 
  catch (error: Error | unknown) {
    console.error({ error });
    return internalResponse(true, 422, String(error), null);
  }
};

Get all feeds

Retrieve all the public feeds for an authenticated user. The FilterFeedDto is used to filter and retrieve paginated information.

FilterFeedDto

Field
Description
Type

page

The page

number

limit

The number of records to be retrieved

number

type

The categorization of the feeds to be retrieved

isOwner

Identifier to retrieve the authenticated user feeds

boolean

isPublic

Identifier to filter only private or public feeds

boolean

The authorization token is required for this call.

const feeds: ResponseDto<FindFeedDto> = await init.feed.getAll(
      authToken,
      filter
    );

Upon success, the FindFeedDto is returned.

FindFeedDto

Field
Description

data

The list of feeds record.

List of feed records

total

The total records based on the query.

number

pages

The total number of available sections based on the query.

number

page

The section of the list of records retrieved.

number

limit

The number of records retrieved for that page.

number

Get a feed by ID

Retrieve feed details, and information, based on the identifier. The authorization jwt token is required. The IFeed is returned, containing the details of the feed timeline.

See the sample implementation below:

const feed: ResponseDto<IFeed> = await init.feed.getById(authToken, feedId);

Dismiss all feeds

Mark all feeds as acknowledged. The authorization token is required.

const feed: ResponseDto<{}> = await init.feed.dismissAllFeeds(authToken,);

Dismiss a feed

Mark a feed as seen.

 const feed: ResponseDto<{}> = await init.feed.dismissAFeed(authToken, feedId);

see

see

Create a feed.
Get all feeds.
Get a feed by ID.
Dismiss all feeds.
Dismiss a feed.
Feed Type
FEED_TYPES
FEED TYPES