@effect/rpc enables the development of type-safe RPC systems in TypeScript, providing end-to-end type safety between client and server with custom serialization, error handling, and middleware support.
Installation
Quick Start
1. Define Requests
Create your RPC schema usingRpcGroup and Rpc:
2. Implement Handlers
Create the server-side logic:3. Serve the API
4. Use the Client
Enjoy end-to-end type safety:Middleware
Add authentication and other cross-cutting concerns:Serialization Formats
NDJSON
MessagePack
Key Features
- End-to-End Type Safety: Share types between client and server
- Schema Validation: Automatic validation using Effect schemas
- Streaming Support: Stream data with
stream: true - Custom Serialization: Choose JSON, MessagePack, or custom formats
- Middleware: Add authentication, logging, and more
- Error Handling: Type-safe error responses
- Multiple Protocols: HTTP, WebSocket, or custom transports
Testing with curl
Related Resources
API Reference
Complete API documentation
@effect/platform
HTTP server and client abstractions