Choosing an SRD client
Decision tree
| API | When to use |
|---|---|
createSrdRuntime | Default for apps (CCS, journey, etc.) — one cache, preload, locale |
createSrdClient | Direct bundle access without runtime; advanced or migration |
createSrdEntryListClient | Entry lists only; usually wrapped by runtime |
Anti-patterns
- Double cache — do not use
loadResourcein 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.envin the library — forbidden; injectapiBaseUrlfrom the app.
Query keys
The library exports:
srdQueryKeys.allsrdQueryKeys.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.