The Metabind Android SDK (Documentation Index
Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
Use this file to discover all available pages before exploring further.
metabind-android) lets you render server-driven content in your Kotlin applications. Build dynamic experiences that update instantly without app store releases.
View on GitHub
metabind-android — source code, issues, and releases.Requirements
| Requirement | Version |
|---|---|
| Android | 8.0 (API 26) or later |
| UI toolkit | Jetpack Compose |
| JDK | 21 |
Installation
Add the SDK to your module’s dependencies. It pulls inbindjs-android (the Compose renderer) transitively.
- build.gradle.kts
- build.gradle
Configure endpoints
The SDK reads the Metabind API endpoints from yourAndroidManifest.xml as <meta-data> entries. Set both, or the client throws at startup:
Quick start
Render content by its ID with theMetabindView composable. It fetches the content and its components, renders them as native Compose, and handles loading and error states:
Core concepts
MetabindView
MetabindView is the primary way to display content. Backed by MetabindViewModel, it:
- Fetches the content and its required components
- Renders the UI through the BindJS Compose runtime
- Subscribes to real-time updates when
enableSubscriptionistrue - Exposes a
StateFlow<UiState>ofLoading | Success | Error
PreviewView(contentId =)— a fixed-size (150×150 dp) live preview.ThumbnailView(contentId =)— an offscreen-rendered bitmap snapshot, for non-interactive thumbnails.
ComponentRepository
For direct data access below the view layer,ComponentRepository.get(context) exposes the Apollo-backed fetchers and a dual-layer cache (10 MB in-memory chained to a SQLite store). It returns suspend functions and Kotlin Flows — for example getContentByToken(token) for a one-shot read and subscribeToPreviewByToken(token) for a live stream over WebSocket.
Real-time updates
For live content, either passenableSubscription = true to MetabindView or subscribe directly through ComponentRepository. subscribeToPreviewByToken(token) returns a Flow that emits whenever the content changes in Metabind:
watchPreviewByToken(token) returns a Flow<Result<PreviewComponent>>.
Direct GraphQL access
For data access below the view layer,ComponentRepository exposes suspend fetchers and Kotlin Flows over the same GraphQL API and cache. See the repository on GitHub for the available methods, and the GraphQL docs for the API itself.
Next steps
Build components
Create custom components for your app.
BindJS reference
Learn the component authoring language.
Managing content
Understand how to structure content.
iOS SDK
The iOS equivalent.