Skip to content

Add a react-native section to package.json. #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2024
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
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
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';
@@ -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
@@ -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
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",