Effect CommunityEC
Effect Community7mo ago
5 replies
Near

Separating API Code for Reuse with Effect Typescript Library

I've got a quick question about separating API code for the purposes reuse. I'd like to write a standalone API service and use the generated type-safe client in my frontend to communicate with the backend.

The initial example in the Platform readme basically gives me the impression that the HttpApi object with all supporting HttpApiGroup objects and other schema types used to compose the entire API could live in their own shared API contract package and the actual backend just needs to provide all required implementations using HttpApiBuilder. That way my frontend could reference the API contract package and use HttpApiClient for the generated client. Does that sound correct or is there some more nuanced details I need to keep in mind?
CleanShot_2025-06-10_at_11.46.132x.png
Was this page helpful?