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

Commit cb3533a

Browse files
authoredSep 2, 2022
docs: Update README.md (#4192)
Added infura header
1 parent 8f351a8 commit cb3533a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

‎packages/ipfs-http-client/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
- [Importing the module and usage](#importing-the-module-and-usage)
3434
- [In a web browser](#in-a-web-browser)
3535
- [Custom Headers](#custom-headers)
36+
- [Infura Header](#Infura-header)
3637
- [Global Timeouts](#global-timeouts)
3738
- [Development](#development)
3839
- [Testing](#testing)
@@ -350,6 +351,23 @@ const ipfs = create({
350351
})
351352
```
352353

354+
### Infura Header
355+
356+
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:
357+
358+
```js
359+
const auth =
360+
'Basic ' + Buffer.from(INFURA_ID + ':' + INFURA_SECRET_KEY).toString('base64');
361+
const client = ipfsClient.create({
362+
host: 'ipfs.infura.io',
363+
port: 5001,
364+
protocol: 'https',
365+
headers: {
366+
authorization: auth,
367+
},
368+
});
369+
```
370+
353371
### Global Timeouts
354372

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

0 commit comments

Comments
 (0)
This repository has been archived.