Skip to content

appearanceSubstore

Manages lazy-fetched appearance configuration resources. Each key in the registry maps to a distinct appearance config (e.g., "frontend") fetched from the API on first access and cached for subsequent reads.

Table of contents


getAppearance

getAppearance: <T extends keyof typeof appearanceRegistry>(
appearanceKey: T,
) => ApiResource<z.infer<(typeof appearanceRegistry)[T]["schema"]>>

Retrieves the appearance configuration for a given key, lazily fetching from the API on first access.

On the first call for a given key the SDK fires a background request. Subsequent calls return the cached ApiResource immediately. The returned object always reflects the current loading/error state.

Parameters

NameTypeDescription
appearanceKeykeyof typeof appearanceRegistryThe registry key identifying which appearance config to fetch (e.g., "frontend")

Returns ApiResource<T>data is undefined while loading, then holds the typed appearance payload once resolved.

Related