Skip to content

Choosing an SRD client

Decision tree

APIWhen to use
createSrdRuntimeDefault for apps (CCS, journey, etc.) — one cache, preload, locale
createSrdClientDirect bundle access without runtime; advanced or migration
createSrdEntryListClientEntry lists only; usually wrapped by runtime

Anti-patterns

  • Double cache — do not use loadResource in the app for keys the runtime already owns (classes:v2, srd:type:…, etc.).
  • Import transform/* — internal adapters; not part of the public API.
  • import.meta.env in the library — forbidden; inject apiBaseUrl from the app.

Query keys

The library exports:

  • srdQueryKeys.all
  • srdQueryKeys.metaLocales()
  • srdQueryKeys.translationStats(locale)

There are no srdQueryKeys.classes() helpers — define app-level keys if you wrap loadBundle in TanStack Query.

API reference

Full signatures: TypeDoc — srd.