Libraries

HttpApi Client

A generated Effect HttpApi client service with shared OpenAPI operation discovery, input decoding, and tool schema helpers.

Install
Add this registry item to your app with shadcn.
bash
bunx --bun shadcn@latest add https://krakstack.net/r/httpapi-client.json

Overview

httpapi-client provides the shared foundation for generated HTTP API adapters. HttpApiSpec discovers operations from an Effect HttpApi, builds self-contained input schemas, and decodes tool or CLI input. ApiClient executes those operations through Effect's generated HttpApiClient, preserving the API's typed transport and response decoding.

Included Files

  • lib/httpapi-client.ts - ApiClient, its configuration, and generated operation execution
  • lib/httpapi-helpers.tsx - shared OpenAPI operation types, input schemas, decoders, naming, and HttpApiSpec

Usage

typescript
import { FetchHttpClient } from "effect/unstable/http"; import { ApiClient } from "@/lib/httpapi-client"; import { HttpApiSpec } from "@/lib/httpapi-helpers"; import { AppApi } from "@/api"; export const apiClientLayer = ApiClient.layer({ api: AppApi, baseUrl: "https://example.com", }).pipe(Layer.provide(FetchHttpClient.layer)); export const apiSpecLayer = HttpApiSpec.layer({ api: AppApi, methods: ["get", "post"], });
Dependencies
Packages and shadcn components required by this registry item.

Dependencies