Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "okx-api", | ||
"version": "1.0.5", | ||
"description": "Node.js connector for OKX REST APIs and WebSockets, with TypeScript & integration tests.", | ||
"version": "1.0.6", | ||
"description": "Complete & robust Node.js SDK for OKX's REST APIs and WebSockets, with TypeScript & end-to-end tests.", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "types": "lib/index.d.ts", |
@@ -5,3 +5,3 @@ # Node.js & Typescript OKX (OKEX) API & WebSocket SDK | ||
[![connector logo](https://github.com/tiagosiebler/okx-api/blob/master/docs/images/logo1.png?raw=true)][1] | ||
[![okx okex SDK for nodejs rest & websockets api](https://github.com/tiagosiebler/okx-api/blob/master/docs/images/logo2.png?raw=true)][1] | ||
@@ -118,4 +118,34 @@ [1]: https://www.npmjs.com/package/okx-api | ||
## Browser Usage | ||
## Browser/Frontend Usage | ||
### Import | ||
This is the "modern" way, allowing the package to be directly imported into frontend projects with full typescript support. | ||
1. Install these dependencies | ||
```sh | ||
npm install crypto-browserify stream-browserify | ||
``` | ||
2. Add this to your `tsconfig.json` | ||
```json | ||
{ | ||
"compilerOptions": { | ||
"paths": { | ||
"crypto": [ | ||
"./node_modules/crypto-browserify" | ||
], | ||
"stream": [ | ||
"./node_modules/stream-browserify" | ||
] | ||
} | ||
``` | ||
3. Declare this in the global context of your application (ex: in polyfills for angular) | ||
```js | ||
(window as any).global = window; | ||
``` | ||
### Webpack | ||
This is the "old" way of using this package on webpages. This will build a minified js bundle that can be pulled in using a script tag on a website. | ||
Build a bundle using webpack: | ||
@@ -122,0 +152,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234865
183