# 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](https://github.com/umdjs/umd) format so your library works everywhere.
* ES6 test setup with [Mocha](http://mochajs.org/) and [Chai](http://chaijs.com/).
* Linting with [ESLint](http://eslint.org/).

## Getting started

1. Install all the dependencies
  * Run `yarn install` (recommended) or `npm install` to get the project's dependencies
  * Run `yarn build` or `npm run build` to produce minified version of your library and to run the tests at the same time.
3. Development mode
  * Having all the dependencies installed run `yarn dev` or `npm 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.
4. Running the tests
  * Run `yarn test` or `npm run test`

## Scripts

* `yarn build` or `npm run build` - produces production version of your library under the `lib` folder
* `yarn dev` or `npm run dev` - produces development version of your library and runs a watcher
* `yarn test` or `npm run test` - well ... it runs the tests :)
* `yarn test:watch` or `npm run test:watch` - same as above but in a watch mode

## Use of the library

* Build the library using `yarn build` or `npm 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)`.