@ts-kizuna/fetch
v1.57.1
Published
Typed fetch client for ts-kizuna contracts
Readme
@ts-kizuna/fetch
@ts-kizuna/fetch provides new KizunaClient(), a typed wrapper around the native fetch API. It runs anywhere fetch does, React Native included.
Installation
pnpm add @ts-kizuna/fetchUsage
import { KizunaClient } from '@ts-kizuna/fetch';
import { contract } from './contract';
const apiClient = new KizunaClient(contract, {
baseUrl: 'http://localhost:3000',
});
const { status, body } = await apiClient.users.getUser({
params: {
id: '1',
},
});