# PieceRetriever

Defined in: [packages/synapse-sdk/src/types.ts:114](https://github.com/FilOzone/synapse-sdk/blob/1d6c4b9fe34534bf1087dfe41491b72be0b46858/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()

```ts
fetchPiece: (pieceCid, client, options?) => Promise<Response>;
```

Defined in: [packages/synapse-sdk/src/types.ts:122](https://github.com/FilOzone/synapse-sdk/blob/1d6c4b9fe34534bf1087dfe41491b72be0b46858/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` | `string` | The client address requesting the piece |
| `options?` | \{ `providerAddress?`: `string`; `signal?`: `AbortSignal`; `withCDN?`: `boolean`; \} | Optional retrieval parameters |
| `options.providerAddress?` | `string` | - |
| `options.signal?` | `AbortSignal` | - |
| `options.withCDN?` | `boolean` | - |

#### Returns

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

A Response object that can be processed for the piece data