Async Websocket API for deriv.app
There are two ways to establish a connection:
-
Use a previously opened connection:
import DerivAPI from 'DerivAPI'; const connection = new WebSocket('ws://...'); const api = new DerivAPI({ connection });
-
Pass the arguments needed to create a connection:
import DerivAPI from 'DerivAPI'; const api = new DerivAPI({ endpoint: 'ws://...', appId: 1003, lang: 'EN' });
For more detailed examples see the wiki See also: DerivAPI reference
npm install
npm test
npm run devel
npm run syntax
npm run test_all
npm run prettify
npm run docs
Needs inotify
to work.
npm run devel_docs
npm run serve_docs
npm run gh-pages
npm run build
DERIV_TOKEN=YourTokenHere npm run examples