Skip to content

addonsSubstore

Manages lazy-fetched addon resources. Each key in the registry corresponds to a distinct addon configuration fetched from the API on first access and cached for subsequent reads.

Table of contents


getAddons

getAddons: <T extends keyof typeof addonsRegistry>(
addonsKey: T,
) => ApiResource<z.infer<(typeof addonsRegistry)[T]["schema"]>>

Retrieves an addon resource by 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 so it is safe to read during render.

Parameters

NameTypeDescription
addonsKeykeyof typeof addonsRegistryThe registry key identifying which addon to fetch

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

Related