Skip to content

twilic/fetch

Repository files navigation

@twilic/fetch

Fetch helpers for Twilic binary request and response bodies.

Install

pnpm add @twilic/fetch @twilic/core

Usage

import { 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.

API

  • TWILIC_CONTENT_TYPE
  • twilicFetch(input, init?)
  • parseTwilicResponse(response, options?)
  • twilicFetchJson(input, init?)
  • createTwilicFetch(codec?, fetchImpl?)

Changelog

See docs/CHANGELOG.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Fetch helpers for Twilic binary request and response bodies.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors