Skip to content

Commit

Permalink
Generate new library version
Browse files Browse the repository at this point in the history
First cut at generating a new version of the wrapper library using
code-gen tools.
  • Loading branch information
brettmortensen committed Nov 29, 2018
1 parent 1f2b7a9 commit 31f176e
Show file tree
Hide file tree
Showing 22 changed files with 5,890 additions and 1,846 deletions.
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

62 changes: 28 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,42 @@
# MX Atrium
[![npm version](https://badge.fury.io/js/mx-atrium.svg)](http://badge.fury.io/js/mx-atrium) [![Build Status](https://travis-ci.org/mxenabled/mx-atrium-node.svg?branch=master)](https://travis-ci.org/mxenabled/mx-atrium-node)
# MX API
The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium is designed according to resource-oriented REST architecture and responds with JSON bodies and HTTP response codes. Use Atrium's development environment, vestibule.mx.com, to quickly get up and running. The development environment limits are 100 users, 25 members per user, and access to the top 15 institutions. Contact MX to purchase production access.

## Description
This is a Node wrapper for the [MX Atrium API](https://atrium.mx.com). It is intended to be used as a helper for the implementation of a proxy server. To get an API key and Client ID, [click here](https://atrium.mx.com/developers/sign_up).
## Installation & Usage

## Installation
```
npm install mx-atrium
### Install Required npm Packages
```sh
npm install request --save
npm install bluebird --save
npm install @types/node --save
```

## Usage
### Generate JavaScript file
```sh
tsc --target es5 api.ts
```
const Atrium = require('mx-atrium');

const AtriumClient = new Atrium.Client('API_KEY', 'CLIENT_ID', Atrium.environments.sand);
```
## Example Usage

Sample Express.js route
```
app.get('/institutions', (request, response) => {
AtriumClient.listInstitutions(request)
.then(json => {
response.json(json);
});
});
```
Please see `docs` directory for additional endpoint examples

For a complete express.js server example, [click here](https://github.com/mxenabled/mx-atrium-express).
```javascript
var api = require('./api.js');

## Helpers
var client = new api.AccountsApi();

There are two constants returned with the Atrium instance, `endpoints` and `environments`.
client.setApiKey(0, "YOUR API-KEY");
client.setApiKey(1, "YOUR CLIENT-ID");

#### Atrium.environments
This returns a `sand` and `production` URL that must be passed to the new client.
var accountGuid = "accountGuid_example"; // string | The unique identifier for an `account`.
var userGuid = "userGuid_example"; // string | The unique identifier for a `user`.
var fromDate = "fromDate_example"; // string | Filter transactions from this date. (optional)
var toDate = "toDate_example"; // string | Filter transactions to this date. (optional)
var page = 12; // number | Specify current page. (optional)
var recordsPerPage = 12; // number | Specify records per page. (optional)

#### Atrium.endpoints
This returns an array of objects that can be used to build routes for the server.
var response = client.listAccountTransactions(accountGuid, userGuid, fromDate, toDate, page, recordsPerPage);

Sample object
```
{
method: 'post',
url: '/users',
clientMethod: 'createUser'
}
response.then(function(value) {
console.log(value);
});
```
Loading

0 comments on commit 31f176e

Please sign in to comment.