StoryblokClient

Client for the Storyblok Content Delivery API.

Provides type-safe access to stories with automatic JSON deserialization and relation resolution.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val http: HttpClient

The underlying Ktor HTTP client.

Functions

Link copied to clipboard
abstract fun close()

Closes the underlying HTTP client and releases resources.

Link copied to clipboard
abstract fun stories(config: PagingConfig = PagingConfig(pageSize = 25), resolveLevel: Int = 1, query: StoriesQuery<Component>.() -> Unit = {}): Pager<Int, Story<Component>>

Retrieves multiple stories as a PagingData stream.

abstract fun <T : Component> stories(config: PagingConfig, typeInfo: TypeInfo, resolveLevel: Int = 1, query: StoriesQuery<T>.() -> Unit = {}): Pager<Int, Story<T>>

Retrieves multiple stories as a PagingData stream with explicit type information for the Component type.

Link copied to clipboard
inline fun <T : Component> StoryblokClient.stories(config: PagingConfig = PagingConfig(pageSize = 25), resolveLevel: Int = 1, noinline query: StoriesQuery<T>.() -> Unit = {}): Pager<Int, Story<T>>

Retrieves multiple stories as a PagingData stream, using reified type information for the Component type.

Link copied to clipboard
abstract fun story(slug: String, resolveLevel: Int = 1, query: StoryQuery<Component>.() -> Unit = {}): Flow<Story<Component>>

Retrieves a Story by its slug.

abstract fun story(uuid: Uuid, resolveLevel: Int = 1, query: StoryQuery<Component>.() -> Unit = {}): Flow<Story<Component>>

Retrieves a Story by its UUID.

abstract fun <T : Component> story(slug: String, typeInfo: TypeInfo, resolveLevel: Int = 1, query: StoryQuery<T>.() -> Unit = {}): Flow<Story<T>>

Retrieves a Story by its slug with explicit type information for the Component type.

abstract fun <T : Component> story(uuid: Uuid, typeInfo: TypeInfo, resolveLevel: Int = 1, query: StoryQuery<T>.() -> Unit = {}): Flow<Story<T>>

Retrieves a Story by its UUID with explicit type information for the Component type.

Link copied to clipboard
inline fun <T : Component> StoryblokClient.story(slug: String, resolveLevel: Int = 1, noinline query: StoryQuery<T>.() -> Unit = {}): Flow<Story<T>>

Retrieves a Story by its slug using reified type information for the Component type.

inline fun <T : Component> StoryblokClient.story(uuid: Uuid, resolveLevel: Int = 1, noinline query: StoryQuery<T>.() -> Unit = {}): Flow<Story<T>>

Retrieves a Story by its UUID using reified type information for the Component type.