Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

docs: Update README.md #4192

Merged
merged 1 commit into from
Sep 2, 2022
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
18 changes: 18 additions & 0 deletions packages/ipfs-http-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- [Importing the module and usage](#importing-the-module-and-usage)
- [In a web browser](#in-a-web-browser)
- [Custom Headers](#custom-headers)
- [Infura Header](#Infura-header)
- [Global Timeouts](#global-timeouts)
- [Development](#development)
- [Testing](#testing)
Expand Down Expand Up @@ -350,6 +351,23 @@ const ipfs = create({
})
```

### Infura Header

If you wish to send infura headers with each request made by this library, for example, the Authorization header. You can use the config to do so:

```js
const auth =
'Basic ' + Buffer.from(INFURA_ID + ':' + INFURA_SECRET_KEY).toString('base64');
const client = ipfsClient.create({
host: 'ipfs.infura.io',
port: 5001,
protocol: 'https',
headers: {
authorization: auth,
},
});
```

### Global Timeouts

To set a global timeout for *all* requests pass a value for the `timeout` option:
Expand Down