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.
WorkflowStatustypeWorkflow status union (pending, running, completed, failed).
WorkflowStepInputtypeInput contract for workflow step endpoints.
WorkflowSummarytypeWorkflow create response shape.
WorkflowStateResponsetypeWorkflow state (steps and groups) response shape.
WorkflowStepSummarytypeWorkflow step metadata/state response shape.
WorkflowGroupSummarytypeWorkflow group metadata response shape.
WorkflowParallelCreatedResponsetypeAdd-parallel response shape.
WorkflowResumeInputtypeResume payload shape (stepId, optional output).
WorkflowStatusResponsetypeWorkflow status response shape.
WorkflowTopicEventtypeCore workflow subscription event payload.
WorkflowEventHandlertypeCallback signature for subscribeWorkflow.
WorkflowStatusHandlertypeCallback signature for onWorkflowStatus.
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 }.
useWorkflowEventshookWorkflow topic event subscription wrapper.
UseWorkflowEventsOptionstypeenabled, onEvent.
useWorkflowStatushookWorkflow status subscription wrapper.
UseWorkflowStatusOptionstypeenabled, onStatus.
UseWorkflowStatusResulttype{ status, latest, error }.

On this page