RPC for the Rest of Us.
Prim+RPC bridges incompatible JavaScript environments. Call a JavaScript function on the server remotely as if it was defined on the client itself.
It's Just JavaScript
If you know JavaScript basics then you know how to use Prim+RPC. Great for beginners and experts alike.
No Guessing: It's Fully Typed
When you use TypeScript you get full type definitions in your client. Not using TypeScript? Get typed results with JSDoc using plain JavaScript.
Zero Client Generation
You don't have to compile an API client with Prim+RPC: instead it's determined at runtime based on the functions that you call.
Bring Your Own Server
Prim+RPC is built to be framework-agnostic. It can support the server you're already using through the use of plugins.
Choose Your Client
Not only can you use the server of your choice but you can use your favorite HTTP client by creating a plugin in Prim+RPC.
It's Transport-Agnostic
Prim+RPC can bridge any gap between two JavaScript environments: not just HTTP. Bridge processes, Web Workers, and more.
Write A Function. Call It. Done.
With Prim+RPC, you can write regular JavaScript on a server and expose it for some client to use. Communicate between frontend/backend, browser/worker, and more. Easily.
You can choose your own server, client, transport, JSON handler, and more with Prim+RPC. See the available integrations in the documentation or try out an example.
Oh, But That's Not All.
Upload Files
You can upload a file in Prim+RPC by simply passing a file as an argument to your function.
Use Your Callbacks
By using a callback on your function, you can receive events from your server on the client without all of the setup!
Advanced Types Supported
Prim+RPC can send advanced structures like Dates, RegExps, Errors, and more by using a custom JSON handler.
Throw Errors on Server and Client
Errors thrown on the server get thrown on the client. Try / catch is your friend here.
Upload Forms Easily
Pass your form directly to the Prim+RPC client and receive all fields, including files, on the server. No additional form processing.
Share It with the World
You can use Prim+RPC either privately in a single project or share your API with the world by hosting and publishing your types to a private/public registry.
Batch RPCs
When you call many functions at once using the Prim+RPC client, they can be combined into a single request automatically.
Share Only What's Allowed
As a security precaution, only the functions you explicitly export and mark as RPC will be callable from Prim+RPC.
Generate Documentation
Prim+RPC can generate RPC-specific documentation from your code's TypeDoc documentation. Build your own documentation website how you want.
It's Available Now. Like, Right Now.