Search Documentation
Search guides, functions, classes, interfaces, and more
Splash theming & shared params
Splash and miniapps share the same WebView localStorage. Theme uses the existing miniapp key; optional non-theme params use a separate bag.
Keys
| Key | Who writes | Who reads | Purpose |
|---|---|---|---|
theme | Miniapp: moby.app.set_theme (mirrors via moby.splash.theme) | Splash: splash.theme.* | Splash background (background.splash) |
mobyapps.splash | Miniapp: moby.splash.params | Splash: splash.params.get | App-defined params only — not theme |
Do not nest theme inside mobyapps.splash.
Flow
- Miniapp calls
set_theme(native +localStorage.theme) and optionallymoby.splash.params.merge(...). - On the next cold start, splash calls
splash.theme.apply()and optionallysplash.params.get().
Native must use the same WebView storage partition for splash and miniapps (FR-SP-08).
Miniapp side (@mobyapps/sdk)
import { moby } from '@mobyapps/sdk' // Theme → native + localStorage.theme (preferred) await moby.app.set_theme({ style: 'light', background: { dark: '#0b0b0b', light: '#ffffff', splash: '#112233', // used by splash on next cold start }, }) // Read back what splash will see const stored = moby.splash.theme.get() console.log(stored?.background.splash) // Storage-only theme write (no bridge) — rare; prefer set_theme moby.splash.theme.set({ style: 'dark', background: { dark: '#000000', light: '#ffffff', splash: '#1a1a2e' }, }) // Non-theme params bag (does not touch localStorage.theme) moby.splash.params.merge({ locale: 'ru', show_progress: true, }) const bag = moby.splash.params.get()
| Call | Bridge / native | localStorage.theme |
|---|---|---|
moby.app.set_theme(...) | Yes | Yes |
moby.splash.theme.set(...) | No | Yes only |
Splash side (@mobyapps/splash only)
// src/main.ts — after splash.js; no @mobyapps/sdk splash.theme.apply() // #splash_el + --splash-bg; fallback #ffffff const hex = splash.theme.background() const full = splash.theme.get() // null if missing/corrupt const params = splash.params.get() if (params?.locale === 'ru') { // customize copy / assets }
Prefer splash.theme.apply() over hand-parsing localStorage.theme.
Related
- Spec: splash platform FR-SP-07…11 (
docs/spec/splash/splash-platform.md) - SDK L1:
docs/spec/sdk/splash-shared-params.md - Wire API:
@mobyapps/splash—SPLASH_API.md - Bridge:
theme_settings.background.splash - Guide: Miniapp theming