CachePuppy
JavaScriptCore (@cachepuppy/core)

Core (@cachepuppy/core)

Websocket client, protocol helpers, transports, topic and cache APIs, and typed client events.

The @cachepuppy/core package is what you import in browsers, servers, and tools. It gives you:

  • createClient / CachePuppyClient — connect over Phoenix websockets (or a mock transport for tests), subscribe to topics, publish events, and observe presence.
  • Topic shared statesetTopicState, getTopicState, getTopicStateWithMeta, configureTopicWebhook, clearTopicState, plus onStateUpdated for state_updated broadcasts.
  • Per-connection session statesetSessionState / getSessionState on the fixed session channel.
  • Distributed cachesetData, getData, deleteData over the same session channel (same semantics as the HTTP cache API).
  • Admin HTTPcreateAdminClient / CachePuppyAdminClient for server-side JSON calls (covered under Admin HTTP).
  • Protocol surfacecreateEnvelope, isEnvelope, nextId, and PhoenixTransport.

Add the package to your project the way your team ships it (private registry, tarball, git dependency, or vendored build). The package name is @cachepuppy/core.