Skip to content

Commit f75e681

Browse files
dmitrizagidulindavidlehn
authored andcommitted
Add a react-native section to package.json.
1 parent dc1ecf9 commit f75e681

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# @digitalbazaar/http-client ChangeLog
22

3+
### Added
4+
- Add a `"react-native"` override section to `package.json`.
5+
36
## 4.0.0 - 2023-09-12
47

58
### Changed

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# http-client
2-
An opinionated, isomorphic HTTP client.
2+
An opinionated, isomorphic HTTP client for Node.js, browsers, and React Native.
33

44
### Usage
55

6-
#### Import httpClient
6+
#### Import httpClient (Node.js)
77
```js
88
import https from 'https';
99
import {httpClient} from '@digitalbazaar/http-client';
1010
```
1111

12+
#### Import httpClient (browsers or React Native)
13+
```js
14+
import {httpClient} from '@digitalbazaar/http-client';
15+
```
16+
1217
#### Import and initialize a custom Bearer Token client
1318
```js
1419
import {httpClient} from '@digitalbazaar/http-client';
@@ -37,7 +42,7 @@ try {
3742
}
3843
```
3944

40-
#### GET a JSON response in Node with a HTTP Agent
45+
#### GET a JSON response in Node with an HTTP Agent
4146
```js
4247
import https from 'https';
4348
// use an agent to avoid self-signed certificate errors
@@ -84,7 +89,7 @@ try {
8489
}
8590
```
8691

87-
#### POST a JSON payload in Node with a HTTP Agent
92+
#### POST a JSON payload in Node with an HTTP Agent
8893
```js
8994
import https from 'https';
9095
// use an agent to avoid self-signed certificate errors

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"./lib/agentCompatibility.js": "./lib/agentCompatibility-browser.js",
1414
"./tests/utils.cjs": "./tests/utils-browser.cjs"
1515
},
16+
"react-native": {
17+
"./lib/agentCompatibility.js": "./lib/agentCompatibility-browser.js"
18+
},
1619
"scripts": {
1720
"rollup": "rollup -c rollup.config.js",
1821
"build": "npm run clear && npm run rollup",

0 commit comments

Comments
 (0)