Comparing version 0.0.3 to 0.1.0
@@ -10,2 +10,4 @@ "use strict"; | ||
var _package = require("../package.json"); | ||
require("core-js/stable"); | ||
@@ -117,3 +119,2 @@ | ||
var version = '0.0.3'; | ||
this.session = _axios["default"].create({ | ||
@@ -123,3 +124,3 @@ baseURL: url, | ||
'Content-Type': 'application/json', | ||
'User-Agent': "belvo-js (".concat(version, ")") | ||
'User-Agent': "belvo-js (".concat(_package.version, ")") | ||
} | ||
@@ -126,0 +127,0 @@ }); |
{ | ||
"name": "belvo", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "The node.js module for the Belvo API", | ||
@@ -5,0 +5,0 @@ "main": "lib/belvo.js", |
<h1 align="center">Belvo Js</h1> | ||
<p align="center"> | ||
<a href="https://www.npmjs.com/package/belvo"><img alt="npm" src="https://img.shields.io/npm/v/belvo?style=for-the-badge"></a> | ||
<img alt="Github build" src="https://img.shields.io/github/workflow/status/belvo-finance/belvo-js/Tests?style=for-the-badge"> | ||
@@ -9,3 +10,55 @@ <a href="https://coveralls.io/github/belvo-finance/belvo-js"><img alt="Coveralls github" src="https://img.shields.io/coveralls/github/belvo-finance/belvo-js?style=for-the-badge"></a> | ||
## Installation | ||
Install the package using npm | ||
``` | ||
$ npm install belvo --save | ||
``` | ||
## Usage | ||
```javascript | ||
var belvo = require("belvo").default; | ||
var client = new belvo( | ||
'YOUR-KEY-ID', | ||
'YOUR-SECRET', | ||
'https://sandbox.belvo.co' | ||
); | ||
client.connect() | ||
.then(function () { | ||
client.links.list() | ||
.then(function (res) { | ||
console.log(res); | ||
}) | ||
.catch(function (error) { | ||
console.log(error); | ||
}); | ||
}); | ||
``` | ||
Or if you prefer to use ES6 and async/await | ||
```javascript | ||
import Client from 'belvo'; | ||
const client = new Client( | ||
'YOUR-KEY-ID', | ||
'YOUR-SECRET', | ||
'https://sandbox.belvo.co' | ||
); | ||
async function getLinks() { | ||
try { | ||
const links = await client.links.list(); | ||
console.log(links); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
} | ||
``` | ||
## Development | ||
After checking out the repo, run `npm install` to install dependencies. Then, run `npm test` to run the tests. | ||
To release a new version, use `npm version` to bump a new version, and when all is ready you can upload the new version using `npm publish`. | ||
## Contributing | ||
@@ -12,0 +65,0 @@ |
115097
71