[**@wocart/storefront v3.1.0**](../../README)

***

[@wocart/storefront](../../README) / [astro](../README) / ProxyClientFn

# Type Alias: ProxyClientFn\<TInput, TOutput\>

> **ProxyClientFn**\<`TInput`, `TOutput`\> = (`data`, `headers?`) => `Promise`\<\{\[`key`: `string`\]: `unknown`; `data`: `TOutput`; `success`: `true`; \} \| \{\[`key`: `string`\]: `unknown`; `error`: `string`; `success`: `false`; \}\>

Client function that makes the actual API call to the server.

On failure, every extra field besides `success` and `error` (e.g.
`code`, `windowSeconds`, `attemptsRemaining`, `terminal`) is forwarded
into the error response body — the storefront UI reads these to render
rate-limit countdowns and attempt counters.

## Type Parameters

### TInput

`TInput`

### TOutput

`TOutput`

## Parameters

### data

`TInput`

### headers?

`Record`\<`string`, `string`\>

## Returns

`Promise`\<\{\[`key`: `string`\]: `unknown`; `data`: `TOutput`; `success`: `true`; \} \| \{\[`key`: `string`\]: `unknown`; `error`: `string`; `success`: `false`; \}\>
