backlog-js 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,8 +14,6 @@ $ npm install --save backlog-js
14
14
  Append your "API Key" or "OAuth2 Access Token" to requests to the API to return data.
15
15
 
16
16
  ``` javascript
17
- import 'isomorphic-form-data';
18
- import 'isomorphic-fetch';
19
17
  import * as backlogjs from 'backlog-js';
20
18
 
21
19
  // 'xxx.backlog.jp' or 'xxx.backlogtool.com' or 'your package host'
@@ -143,6 +141,24 @@ app.listen(3000);
143
141
  console.log('Express server started on port 3000');
144
142
  ````
145
143
 
144
+ ## HTTP proxy support
145
+
146
+ You can route requests through an HTTP proxy by injecting a custom `fetch` function
147
+ into `Backlog` and `OAuth2` constructors.
148
+
149
+ ```javascript
150
+ import { Backlog } from 'backlog-js';
151
+ import { ProxyAgent, fetch as undiciFetch } from 'undici';
152
+
153
+ const dispatcher = new ProxyAgent('https://proxy.example.com:8080');
154
+
155
+ const backlog = new Backlog({
156
+ host: 'example.backlog.com',
157
+ apiKey: 'YOUR_API_KEY',
158
+ fetch: (input, init) => undiciFetch(input, { ...init, dispatcher }),
159
+ });
160
+ ```
161
+
146
162
  ## License
147
163
 
148
164
  MIT License