Skip to content

Commit

Permalink
Add a react-native section to package.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrizagidulin authored and davidlehn committed Jan 26, 2024
1 parent dc1ecf9 commit f75e681
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# @digitalbazaar/http-client ChangeLog

### Added
- Add a `"react-native"` override section to `package.json`.

## 4.0.0 - 2023-09-12

### Changed
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# http-client
An opinionated, isomorphic HTTP client.
An opinionated, isomorphic HTTP client for Node.js, browsers, and React Native.

### Usage

#### Import httpClient
#### Import httpClient (Node.js)
```js
import https from 'https';
import {httpClient} from '@digitalbazaar/http-client';
```

#### Import httpClient (browsers or React Native)
```js
import {httpClient} from '@digitalbazaar/http-client';
```

#### Import and initialize a custom Bearer Token client
```js
import {httpClient} from '@digitalbazaar/http-client';
Expand Down Expand Up @@ -37,7 +42,7 @@ try {
}
```

#### GET a JSON response in Node with a HTTP Agent
#### GET a JSON response in Node with an HTTP Agent
```js
import https from 'https';
// use an agent to avoid self-signed certificate errors
Expand Down Expand Up @@ -84,7 +89,7 @@ try {
}
```

#### POST a JSON payload in Node with a HTTP Agent
#### POST a JSON payload in Node with an HTTP Agent
```js
import https from 'https';
// use an agent to avoid self-signed certificate errors
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"./lib/agentCompatibility.js": "./lib/agentCompatibility-browser.js",
"./tests/utils.cjs": "./tests/utils-browser.cjs"
},
"react-native": {
"./lib/agentCompatibility.js": "./lib/agentCompatibility-browser.js"
},
"scripts": {
"rollup": "rollup -c rollup.config.js",
"build": "npm run clear && npm run rollup",
Expand Down

0 comments on commit f75e681

Please sign in to comment.