Articles

interface Articles

The article catalogue: the pieces inside an issue, and the ones published on their own.

Reached through Content.articles. get resolves one article in full — body elements included, ready to render — while the all overloads list them in their light ArticleShort form, which is what a feed or a table of contents needs.

val articles = CGS.content().articles.all(
publicationIds = listOf(publicationId),
scope = viewModelScope
)

Everything here follows the active profile and is bound to the scope you pass — see Content.

Functions

Link copied to clipboard
abstract fun all(pageSize: Int = 20, scope: CoroutineScope): PaginatedResource<ArticleShort>

Retrieves a paginated list of article content accessible to the current user profile.

abstract fun all(publicationIds: List<PublicationId>, issueIds: List<IssueId> = emptyList(), pageSize: Int = 20, scope: CoroutineScope): PaginatedResource<ArticleShort>

Retrieves a paginated list of article content accessible to the current user profile filtered by publicationIds, optionally narrowed to the articles of issueIds.

Link copied to clipboard
abstract suspend fun get(id: ArticleId, scope: CoroutineScope): StateFlow<CgsStreamState<Article?>>

Observes an article by its identifier, reacting to changes in the active session.