> ## Documentation Index
> Fetch the complete documentation index at: https://social-b97141fb-feat-user-history-moderation-detail.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# For You Feed

> Backend-personalized feed for the current user: what it includes, how to enable it, and how to query it.

As a community grows, members can't keep up with everything — the posts worth their attention get buried by volume. **For You feed surfaces the posts each member is most likely to care about**, so the home experience feels relevant, intentional, and worth returning to, instead of a noisy wall of everything.

For You feed is a backend-personalized global feed for the current user. Ranking is owned by the backend; the SDK only requests the feed and returns the posts the backend provides. It is a network-level feature that must be enabled for your network before the feed returns content.

<Info>
  For You feed is a network setting. Read `getForYouFeedSetting()` on the client and only render the surface when the feed is enabled. If the feed is not enabled, the collection reports a feed-disabled error rather than an empty list — `AmityForYouFeedDisabledError` on TypeScript and Android, or the `.forYouFeedDisabled` error code on iOS (see below).
</Info>

## What the For You feed includes

The backend assembles For You from these content sources, then ranks them for the current user:

| Source | What it contributes |
| - | - |
| Joined communities | Posts from communities the user is a member of |
| Public communities | Posts from public communities the user has **not** joined |
| Followed users | Posts from the user feeds the user follows |
| Public user feeds | Posts from user feeds that are public |
| Exploration | A small amount of random posts, for controlled discovery |
| Live streams | Ongoing livestreams, injected into the feed while they are live |

The mix between these sources and the ranking applied to them are owned by the backend. The SDK exposes no parameters to weight, filter, or exclude them.

## How ranking works

The backend scores every eligible post for the current user and returns them in ranked order. The score blends four signals:

| Signal | What it measures |
| - | - |
| Relevance | How closely a post matches what the user has engaged with before — comments, reactions, and meaningful views of similar content. |
| Affinity | The user's connection to the author or community — who they follow, the communities they belong to, and who they interact with. |
| Popularity | How much engagement a post is drawing across the network. |
| Freshness | How recently the post was published — more recent posts rank higher, and older posts fade over time. |

After scoring, the feed spaces out posts from the same author, community, or topic so it stays varied without pushing clearly more relevant posts down.

The exact weighting and scoring model are owned by the backend and can be tuned per network. They are not exposed through the SDK, and the SDK does not let the client re-rank the feed.

## Post eligibility

A post is only eligible for For You if it is published, is discoverable by the user (a public community, a public user feed, a community the user belongs to, or a user feed the user follows), falls within a freshness window (roughly the last 90 days), meets the platform's safety and quality standards, and the user has not already seen it.

Following the same rules as the global feed, a post never appears if it is from a private community the user is not a member of, from a private user feed the user does not follow, published by someone the user has blocked, or deleted. These checks are re-applied as the user paginates, so a post that becomes private, blocked, or deleted mid-session simply does not appear — the rest of the feed keeps its order.

## Seen posts

For You does not repeat posts the user has already seen — anywhere on the platform (For You, the chronological feed, community feeds, or a user profile). Seen state is driven by the view events your app reports.

<Note>
  If you build a custom feed surface with the SDK, call [`markAsViewed()`](/social-plus-sdk/social/content-management/posts/analytics/post-impressions) as posts appear so the feed knows what to exclude. The UIKit reports views for you. Seen state syncs across a user's devices within about an hour, so a post seen on one device may briefly reappear on another until they sync.
</Note>

## New and returning users

A user with little or no interaction history sees a feed led by popularity and freshness, and shifts to a more personalized mix as they engage. A user who has been inactive long enough that their history is no longer a reliable signal (around 90 days) is eased back in the same way until they rebuild it.

Visitors (and bot accounts) do not get a personalized feed — gate the For You surface on both the network setting and a signed-in, non-visitor user.

<Info>
  **Personalization & transparency.** For You is a personalized recommender. If you operate where recommender-system transparency rules apply (such as the EU Digital Services Act), you are responsible for telling your users, in plain language, the main parameters behind the feed — the four signals above — and for offering a non-personalized alternative they can switch to. The [chronological global feed](/social-plus-sdk/social/discovery-engagement/feed/global-feed) serves as that non-profiling option. social.plus does not publish the exact weights or scoring model, so describe the signals at the level shown here rather than as a formula.
</Info>

## Query the feed

`getForYouFeed()` is a live collection that takes **no query parameters**. Page through results with the `onNextPage` / `hasNextPage` values from the callback; the default page size is 20 posts.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Client, FeedRepository } from '@amityco/ts-sdk';

  // 1. Gate the surface on the network setting.
  const { forYouFeed } = await Client.getForYouFeedSetting();
  if (!forYouFeed.enabled) {
    hideForYouSurface();
    return;
  }

  // 2. Observe the personalized feed.
  let loadNextPage: (() => void) | undefined;
  let canLoadMore = false;

  const unsubscribe = FeedRepository.getForYouFeed(
    ({ data: posts, onNextPage, hasNextPage, loading, error }) => {
      if (loading) return;
      if (error) {
        if (error instanceof FeedRepository.AmityForYouFeedDisabledError) {
          // For You feed is not enabled for this network — hide the tab.
          hideForYouSurface();
          return;
        }
        handleError(error);
        return;
      }

      renderResults(posts);
      loadNextPage = onNextPage;
      canLoadMore = hasNextPage;
    },
  );

  function loadMoreForYouFeed() {
    if (canLoadMore) {
      loadNextPage?.();
    }
  }

  unsubscribe();
  ```

  ```swift iOS theme={null}
  let forYouFeed = feedRepository.getForYouFeed()

  token = forYouFeed.observe { collection, error in
      if let error {
          if error.isAmityErrorCode(.forYouFeedDisabled) {
              // For You feed is not enabled for this network — hide the tab.
              hideForYouSurface()
              return
          }
          handleError(error)
          return
      }

      showSuccessMessage(collection.snapshots.count)
  }

  forYouFeed.nextPage()
  ```

  ```kotlin Android theme={null}
  AmitySocialClient.newFeedRepository()
      .getForYouFeed()
      .subscribe(
          { pagingData: PagingData<AmityPost> ->
              showSuccessMessage(pagingData)
          },
          { error ->
              if (error is AmityForYouFeedDisabledError) {
                  // For You feed is not enabled for this network — hide the tab.
                  hideForYouSurface()
              } else {
                  handleGeneralError(error)
              }
          },
      )
  ```
</CodeGroup>

<Note>
  For You feed is available on TypeScript, iOS, and Android. It is not available in the current Flutter SDK.
</Note>

## Parameters

| Parameter | Platforms | Required | Description |
| - | - | - | - |
| None | All | — | `getForYouFeed()` takes no query parameters. The backend owns the ranking and the content mix. |
| `limit`, `onNextPage`, `hasNextPage` | TypeScript | No | Control page size and load additional pages from the live collection callback. |

## Read the feed setting

`getForYouFeedSetting()` is a method on the client that reports whether the network has For You feed enabled. Use it to decide whether to render a For You tab or entry point at all.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Client } from '@amityco/ts-sdk';

  const setting = await Client.getForYouFeedSetting();
  // setting: { forYouFeed: { enabled: boolean } }

  if (setting.forYouFeed.enabled) {
    showForYouTab();
  }
  ```

  ```swift iOS theme={null}
  let setting = try await client.getForYouFeedSetting()
  if setting.enabled {
      showForYouTab()
  }
  ```

  ```kotlin Android theme={null}
  AmityCoreClient.getForYouFeedSetting()
      .doOnSuccess { setting: AmityForYouFeedSetting ->
          if (setting.enabled) {
              showForYouTab()
          }
      }
      .doOnError { error ->
          handleGeneralError(error)
      }
      .subscribe()
  ```
</CodeGroup>

## Related Topics

<CardGroup cols={2}>
  <Card title="For You Feed UIKit" icon="mobile" href="/uikit/components/social/feeds#for-you-feed">
    Drop the personalized feed into your app with the prebuilt UIKit component.
  </Card>

  <Card title="Global Feed" icon="clock" href="/social-plus-sdk/social/discovery-engagement/feed/global-feed">
    Chronological global feed, with no personalization.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.