# PieceRetriever

Defined in: [packages/synapse-sdk/src/types.ts:114](https://github.com/FilOzone/synapse-sdk/blob/32f86959b0bf15557657ea412e31a0897440ca98/packages/synapse-sdk/src/types.ts#L114)

PieceRetriever interface for fetching pieces from various sources
Returns standard Web API Response objects for flexibility

## Properties

### fetchPiece()

> **fetchPiece**: (`pieceCid`, `client`, `options?`) => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Response`](https://developer.mozilla.org/docs/Web/API/Response)\>

Defined in: [packages/synapse-sdk/src/types.ts:122](https://github.com/FilOzone/synapse-sdk/blob/32f86959b0bf15557657ea412e31a0897440ca98/packages/synapse-sdk/src/types.ts#L122)

Fetch a piece from available sources

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `pieceCid` | `PieceLink` | The PieceCID identifier of the piece (validated internally) |
| `client` | `` `0x${string}` `` | The client address requesting the piece |
| `options?` | \{ `providerAddress?`: `` `0x${string}` ``; `signal?`: [`AbortSignal`](https://developer.mozilla.org/docs/Web/API/AbortSignal); `withCDN?`: `boolean`; \} | Optional retrieval parameters |
| `options.providerAddress?` | `` `0x${string}` `` | - |
| `options.signal?` | [`AbortSignal`](https://developer.mozilla.org/docs/Web/API/AbortSignal) | - |
| `options.withCDN?` | `boolean` | - |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Response`](https://developer.mozilla.org/docs/Web/API/Response)\>

A Response object that can be processed for the piece data