← All @molecule/* packages · App templates
@molecule/api-http-fetchProvider bond · http · API (Node) · v1.0.1 · Apache-2.0
Native fetch HTTP client provider
npm install @molecule/api-http-fetchnpm · Source on GitHub · Implements @molecule/api-http
@molecule/api-http-fetch is a provider bond on the API (Node) side: it implements the http core interface (@molecule/api-http) with a concrete vendor or library behind it.
Your code calls the core; you wire this provider once at startup. Swapping vendors later is one line in that wiring, not a rewrite.
import { setClient } from '@molecule/api-http'
import { provider } from '@molecule/api-http-fetch'
setClient(provider)Works with: @molecule/api-http
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Native fetch HTTP client provider for molecule.dev.
import { setClient } from '@molecule/api-http'
import { provider } from '@molecule/api-http-fetch'
setClient(provider)
provider
npm install @molecule/api-http-fetch @molecule/api-http
fetchClientHTTP client using native fetch.
const fetchClient: HttpClient
providerDefault fetch-based HTTP provider.
const provider: HttpClient
Implements @molecule/api-http interface.
Setup function to register this provider with the core interface:
import { setClient } from '@molecule/api-http'
import { provider } from '@molecule/api-http-fetch'
export function setupHttpFetch(): void {
setClient(provider)
}
Peer dependencies:
@molecule/api-http ^1.0.1@molecule/api-http