Skip to main content
Use post retrieval when your app already knows the post ID. Single-post retrieval returns a live object or stream on every SDK. Batch lookup is available on TypeScript, iOS, and Android.

Single Post

import { PostRepository } from "@amityco/ts-sdk";

const unsubscribe = PostRepository.getPost(
  postId,
  ({ data: post, loading, error }) => {
    if (loading) return;
    if (error) {
      handleError(error);
      return;
    }
    if (post) {
      renderResults(post);
    }
  },
);

Multiple Posts By ID

import { PostRepository } from "@amityco/ts-sdk";

const { data: posts } = await PostRepository.getPostByIds([
  postId,
  "another-post-id",
]);
The current Flutter public post repository exposes single-post retrieval through live.getPost(postId) and the deprecated getPost(postId) future, but it does not expose a public batch get-by-IDs method.

Notes

  • Keep the unsubscriber or notification token so you can dispose the live object when the screen is destroyed.
  • Use query APIs when you need a feed, pagination, filtering, or real-time collection updates.
  • Batch lookup skips invalid IDs on iOS collection results; handle an empty collection as a valid outcome.

Query Posts

Query posts by feed target, post type, review status, or tags

Viewing Content

Render post data and child media safely

Post Overview

Review post structure and post data types