Documentation navigation

Published API · 0.1.0-rc.1

foldkit · http

Published foldkit API declarations for http.

./http

@wsagency/wseffect-foldkit · MIT · source · MIT license · WS-AGENCY-NOTICE · THIRD-PARTY-NOTICES

This entry point is published in @wsagency/wseffect-foldkit@0.1.0-rc.1. Import it from the package subpath shown below; the signatures and documentation are read from the installed package declarations.

import * as Wseffect from '@wsagency/wseffect-foldkit/http'

Exported declarations

layer

A Fetch-backed `HttpClient` Layer with trace header propagation disabled by default. Effect's `HttpClient` records an `http.client` span for every request and, by default, writes that span's context onto the request as `traceparent` and `b3` headers. That default is tuned for servers, where propagating trace context to your own downstream services is desirable. In a browser the same headers make otherwise CORS-simple requests non-simple, triggering preflights against plain APIs and dev proxies that never expect them. Foldkit apps run in the browser, so this Layer defaults propagation off and requests stay CORS-simple. Local observability is unaffected: the `http.client` span with method, URL, and status attributes is still recorded, and in a Foldkit app it nests under the runtime's Command span. An app doing distributed tracing can re-enable propagation per Command with `Effect.provideService(HttpClient.TracerPropagationEnabled, true)`, or use `FetchHttpClient.layer` from Effect directly.

layer: Layer.Layer<HttpClient.HttpClient>