Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ const replicate = new Replicate({
});
```

You can override the `fetch` property to add custom behavior to client requests,
such as injecting headers or adding log statements.

```js
client.fetch = (url, options) => {
const headers = new Headers(options && options.headers);
headers.append("X-Custom-Header", "some value");

console.log("fetch", { url, ...options, headers });

return fetch(url, { ...options, headers });
};
```

### `replicate.models.get`

```js
Expand Down