ClickCease
A global activity feed with posts where users can react to

How to build a global feed in your app

Italo Orihuela
Italo Orihuela
Engineer
Android
iOS
Web
Aug 15, 2023

Nowadays, social media platforms have become the go-to source for the latest news, trends, and conversations. As a developer, it is crucial to provide a comprehensive and engaging feed for your users in order to foster a vibrant and dynamic community.

In this tutorial, we will provide a general introduction to how to access the Global Feed feature offered by the Amity Social Cloud SDK, with a specific focus on leveraging this feature using TypeScript. With Amity, you can quickly build a Global Feed using their features and create a genuine social environment for your users!

Pre-requisites

Before we dive into the code, let’s make sure we have everything we need:

  • Amity Account: You need to have a valid Amity account and the necessary permissions to access the Global Feed.
  • Amity Social Cloud SDK: You need to have the ‘@amityco/ts-sdk’ package installed in your project. You can install it using npm or yarn.
  • Asynchronous Programming Knowledge: You need to have an understanding of asynchronous programming in TypeScript, as the `queryGlobalFeed` function is an async function.

Note: If you haven’t already registered for an Amity account, we recommend following our comprehensive step-by-step guide on how to create your new network.

What is a Global Feed?

Central to the Amity Chat SDK experience is the Global Feed. This feature acts as a hub, consolidating both User and Community feeds into a single, easily accessible stream. Think of it as a curated window into the latest content and discussions within your network. The Global Feed ensures you’re always informed, promoting engagement and interaction. It’s a convenient way to stay connected and participate actively in your community’s ongoing conversations and updates.

Step-by-Step Guide

Step 1: Import the FeedRepository

First, we need to import the `FeedRepository` from the ‘@amityco/ts-sdk’ package. This repository provides us with the methods we need to interact with the Global Feed.

Step 2: Create the queryGlobalFeed Function

Next, we create an async function called `queryGlobalFeed`. This function will retrieve the Global Feed data.

Step 3: Call the queryGlobalFeed Function

Finally, we call the `queryGlobalFeed` function to retrieve the Global Feed. The function will return a promise that resolves to the posts in the Global Feed.

Full Code Snippet

Here is the full code snippet for querying the Global Feed using TypeScript:

Complete documentation regarding this feature can be found here.

Final Thoughts

Using the Global Feed functionality within the Amity Social Cloud SDK through TypeScript offers developers the capability to quickly and easily deliver an immersive and all-encompassing activity feed experience to their users. By keeping in touch with the most recent content and discussions, users can cultivate a lively and ever-evolving community.