CachePuppy
API reference

TypeScript public exports

What ships from @cachepuppy/core and @cachepuppy/react.

@cachepuppy/core

ExportKindSummary
createClientfunctionFactory for CachePuppyClient.
CachePuppyClientclassWebsocket-first SDK entry point.
createAdminClientfunctionFactory for CachePuppyAdminClient.
CachePuppyAdminClientclassHTTP admin APIs.
createEnvelopefunctionBuild versioned envelopes.
isEnvelopefunctionRuntime shape guard.
nextIdfunctionAllocate message ids.
PhoenixTransportclassPhoenix-backed transport implementation.
AdminClientOptionstypeAdmin client configuration.
CachePuppyEnvelopetypeWire envelope JSON.
ClientEventMaptypeclient.on event typing.
ClientOptionstypecreateClient configuration.
ConnectionStatetypeConnection lifecycle union.
MessageTypetypeEnvelope type union.
TopicHandlertypeSubscription callback signature.
TopicPresenceResponsetypeHTTP presence snapshot typing.
TopicWebhookConfigOptionstypeWebhook configuration object.
CacheSetDataOptionstypeTTL options for cache writes.
TopicStateResponsetypeTopic state + optional routing metadata.

@cachepuppy/react

ExportKindSummary
CachePuppyProvidercomponentContext provider wrapping createClient.
CachePuppyProviderPropstypeProvider props (options, autoConnect, …).
useCachePuppyContexthookLow-level access to provider value.
useCachePuppyClienthookAlias of useCachePuppyContext.
useTopichookManaged subscription lifecycle.
UseTopicOptionstypeenabled, onMessage, …
usePresencehookPresence count helper.
UsePresenceResulttype{ clientCount, error }.
useTopicStatehookTopic state + mutations.
UseTopicStateResulttype{ state, loading, error, setState, refresh, clear }.

On this page