Fetch helpers for Twilic binary request and response bodies.
pnpm add @twilic/fetch @twilic/coreimport { twilicFetchJson } from "@twilic/fetch";
const data = await twilicFetchJson("/api/users", {
method: "POST",
twilicBody: { id: 1n, name: "alice" },
});In the browser, call init({ prefer: "wasm" }) from @twilic/core before using these helpers.
TWILIC_CONTENT_TYPEtwilicFetch(input, init?)parseTwilicResponse(response, options?)twilicFetchJson(input, init?)createTwilicFetch(codec?, fetchImpl?)
See docs/CHANGELOG.md.
This project is licensed under the MIT License - see the LICENSE file for details.