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 amocktransport for tests), subscribe to topics, publish events, and observe presence.- Topic shared state —
setTopicState,getTopicState,getTopicStateWithMeta,configureTopicWebhook,clearTopicState, plusonStateUpdatedforstate_updatedbroadcasts. - Per-connection session state —
setSessionState/getSessionStateon the fixedsessionchannel. - Distributed cache —
setData,getData,deleteDataover the samesessionchannel (same semantics as the HTTP cache API). - Admin HTTP —
createAdminClient/CachePuppyAdminClientfor server-side JSON calls (covered under Admin HTTP). - Protocol surface —
createEnvelope,isEnvelope,nextId, andPhoenixTransport.
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.