@scaleway/sdk 0.0.2-alpha.0 → 0.1.0-alpha.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 +3 -3
- package/dist/index.cjs +29 -7078
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -6,15 +6,15 @@ The project is in an early alpha phase. Only a few APIs are available, the rest
|
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
This SDK is based on the [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) API and use `Request`, `Response` & `Headers` interfaces. Those interfaces are native in modern
|
|
9
|
+
This SDK is based on the [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) API and use `Request`, `Response` & `Headers` interfaces. Those interfaces are native in modern browsers, node >=18 & deno environments.
|
|
10
10
|
|
|
11
|
-
For `node` & `React Native` environments,
|
|
11
|
+
For `node` < 18 & `React Native` environments, the commonJS build requires [cross-fetch](https://www.npmjs.com/package/cross-fetch) package, it is listed in `dependencies` but not used in esm build.
|
|
12
12
|
|
|
13
13
|
## Troubleshooting
|
|
14
14
|
|
|
15
15
|
In node environment, the commonJS module defined in `dist/index.cjs` entry file is used by default, thanks to the "main" `package.json` field.
|
|
16
16
|
|
|
17
|
-
If you want to use the ES module from `dist/index.js`
|
|
17
|
+
If you want to use the ES module from `dist/index.js` with node < 18 & `React Native` environments, we recommend you to explicitly import [cross-fetch](https://www.npmjs.com/package/cross-fetch) polyfill:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
20
|
import 'cross-fetch/polyfill'
|