cot-javascript-api-sdk
v0.0.1
Published
Capital On Tap public API SDK
Downloads
4
Maintainers
Readme
Capital On Tap public API - Javascript SDK
Javascript SDK to use with the Capital On Tap public API.
Features
- Webpack 3 based.
- ES6 as a source.
- Exports in a umd format so your library works everywhere.
- ES6 test setup with Mocha and Chai.
- Linting with ESLint.
Getting started
- Install all the dependencies
- Run
yarn install
(recommended) ornpm install
to get the project's dependencies - Run
yarn build
ornpm run build
to produce minified version of your library and to run the tests at the same time.
- Development mode
- Having all the dependencies installed run
yarn dev
ornpm run dev
. This command will generate an non-minified version of your library and will run a watcher so you get the compilation on file change.
- Running the tests
- Run
yarn test
ornpm run test
Scripts
yarn build
ornpm run build
- produces production version of your library under thelib
folderyarn dev
ornpm run dev
- produces development version of your library and runs a watcheryarn test
ornpm run test
- well ... it runs the tests :)yarn test:watch
ornpm run test:watch
- same as above but in a watch mode
Use of the library
- Build the library using
yarn build
ornpm run build
. - Copy the
library.min.js
in your library folder. - Start using the library using
import Client from './library/library.min.js'
. - Create a Client object using
let client = new Client(clientId, apiKey);
. - Connect to a customer account using
client.login(username, password)
.