The Docs.

Prim+RPC is in prerelease mode and may be unstable until official release.
All Plugins


Plugin Details
  • Plugin Type:
    Callback Plugin
  • Transport:
  • Works with:

Prim+RPC can be used with the WebSocket API as implemented in all modern browsers. This plugin will allow Prim+RPC to communicate with a callback handler used with the Prim+RPC server.

We can set up a client like so:

import { createPrimClient } from "@doseofted/prim-rpc"
import { createCallbackPlugin } from "@doseofted/prim-rpc-plugins/browser-websocket"
import type * as Module from "./module"
const callbackPlugin = createCallbackPlugin()
const client = createPrimClient<Module>({
  wsEndpoint: "ws://localhost:3000/prim"

You may also use this plugin alongside a method plugin: Prim+RPC will know when to use the callback plugin versus the method plugin.

If you are using the callback plugin alongside a method plugin, ensure that the WebSocket endpoint is correct as this server may share the same port as your HTTP server. This will depend on how you choose to configure your WebSockets.

You may also choose a compatible callback handler:

Report an Issue