solibo-sdk

API Reference

The Solibo SDK is organized into sub-APIs, each corresponding to a functional area of the Solibo Home ecosystem.

Sub-APIs

The HomeApi instance provides access to various sub-APIs through the api field. Each sub-API corresponds to a tag in our OpenAPI specification.

For example:

All available sub-APIs can be discovered via your IDE’s auto-completion on the api object.

OpenAPI Specification

For the full list of endpoints and model definitions, you can refer to our OpenAPI specification: Swagger UI

Common Models

The SDK uses consistent data models across all platforms. These are located in no.solibo.oss.sdk.api.gen.models (Kotlin) or imported from @solibo/solibo-sdk (TypeScript).

Key models include:

Paged Lists

All collection endpoints return a PagedList<T> wrapper instead of a plain array. This applies to both the Kotlin SDK and the TypeScript layer.

Structure

PagedList<T>
  .items   — the current page of results (List<T> / T[])
  .meta    — metadata, including .count (total items on this page)
  .paging  — cursor pagination tokens:
               .next     — pass as pageToken to fetch the next page ("END_OF_LIST" means no more pages)
               .previous — token for the previous page

Kotlin

val response = mockApi.task.indexTasks(1L).body()
val tasks: List<Task> = response.items
val total: Long = response.meta.count ?: 0L
val nextToken: String? = response.paging.next

React / TypeScript (via hooks)

Paged list hooks use TanStack’s useInfiniteQuery. Each call appends a new page to data.pages:

import { useIssues } from '@solibo/solibo-query'

function IssueList({ companyId }: { companyId: number }) {
  const { data, fetchNextPage, hasNextPage } = useIssues({ companyId })

  const allIssues = data?.pages.flatMap(page => page.items) ?? []

  return (
    <>
      {allIssues.map(issue => <div key={issue.id.toString()}>{issue.title}</div>)}
      {hasNextPage && <button onClick={() => fetchNextPage()}>Load more</button>}
    </>
  )
}

When calling the SDK directly (outside a hook), access .items and convert to a JS array:

const body = (await sdk.api.task.indexTasks(toLong(companyId))).body()
const tasks = body.items.asJsReadonlyArrayView()

Field Projections

Most read endpoints accept an optional fields query parameter that limits which fields are returned in the response. This reduces payload size when only a subset of data is needed.

Kotlin

// Only include company and feed fields in the homepage response
val homepage = sdk.api.homepage.showHomepage(companyId, fields = "company,feed").body()

TypeScript (via hooks)

Pass fields through the hook’s params object:

const { data } = useHomepage({ companyId, fields: 'company,feed' })

Omitting fields returns the full object. Consult the Swagger UI for the available field names per endpoint.


Platform-Specific Details

Kotlin (Multiplatform)

Models are data classes with @Serializable annotations. All API calls are suspend functions.

Web (JS/TS)

Models are TypeScript interfaces. API calls return Promise objects. The @solibo/solibo-query package provides React Query hooks for most of these APIs.