|
| 1 | +*This project is currently in **Beta**. Please open up an issue [here](https://github.com/mxenabled/mx-platform-node/issues) to report issues using the MX Platform Node.js library.* |
| 2 | + |
| 3 | +# MX Platform Node.js |
| 4 | + |
| 5 | +The [MX Platform API](https://www.mx.com/products/platform-api) is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions. |
| 6 | + |
| 7 | +## Documentation |
| 8 | + |
| 9 | +Examples for the API endpoints can be found [here.](https://docs.mx.com/api) |
| 10 | + |
| 11 | +## Requirements |
| 12 | + |
| 13 | +The generated Node module can be used in the following environments: |
| 14 | + |
| 15 | +Environment |
| 16 | +* Node.js |
| 17 | +* Webpack |
| 18 | +* Browserify |
| 19 | + |
| 20 | +Language level |
| 21 | +* ES5 - you must have a Promises/A+ library installed |
| 22 | +* ES6 |
| 23 | + |
| 24 | +Module system |
| 25 | +* CommonJS |
| 26 | +* ES6 module system |
| 27 | + |
| 28 | +## Installation |
| 29 | + |
| 30 | +To build and compile the TypeScript sources to JavaScript use: |
| 31 | + |
| 32 | +```shell |
| 33 | +npm install mx-platform-node |
| 34 | +``` |
| 35 | + |
| 36 | +## Getting Started |
| 37 | + |
| 38 | +In order to make requests, you will need to [sign up](https://dashboard.mx.com/sign_up) for the MX Platform API and get a `Client ID` and `API Key`. |
| 39 | + |
| 40 | +Please follow the [installation](#installation) procedure and then run the following code to create your first User: |
| 41 | + |
| 42 | +```javascript |
| 43 | +import { Configuration, MxPlatformApi } from 'mx-platform-node'; |
| 44 | + |
| 45 | +const configuration = new Configuration({ |
| 46 | + // Configure with your Client ID/API Key from https://dashboard.mx.com |
| 47 | + username: 'Your Client ID', |
| 48 | + password: 'Your API Key', |
| 49 | +
|
| 50 | + // Configure environment. https://int-api.mx.com for development, https://api.mx.com for production |
| 51 | + basePath: 'https://int-api.mx.com', |
| 52 | +
|
| 53 | + baseOptions: { |
| 54 | + headers: { |
| 55 | + Accept: 'application/vnd.mx.api.v1+json' |
| 56 | + } |
| 57 | + } |
| 58 | +}); |
| 59 | + |
| 60 | +const client = new MxPlatformApi(configuration); |
| 61 | + |
| 62 | +const requestBody = { |
| 63 | + user: { |
| 64 | + metadata: 'Creating a user!' |
| 65 | + } |
| 66 | +}; |
| 67 | + |
| 68 | +const response = await client.createUser(requestBody); |
| 69 | + |
| 70 | +console.log(response.data); |
| 71 | +``` |
| 72 | + |
| 73 | +## Development |
| 74 | + |
| 75 | +This project was generated by the [OpenAPI Generator](https://openapi-generator.tech). To generate this library, verify you have the latest version of the `openapi-generator-cli` found [here.](https://github.com/OpenAPITools/openapi-generator#17---npm) |
| 76 | + |
| 77 | +Running the following command in this repo's directory will generate this library using the [MX Platform API OpenAPI spec](https://github.com/mxenabled/openapi/blob/master/openapi/mx_platform_api_beta.yml) with our [configuration and templates.](https://github.com/mxenabled/mx-platform-ruby/tree/master/openapi) |
| 78 | +```shell |
| 79 | +openapi-generator-cli generate \ |
| 80 | +-i https://raw.githubusercontent.com/mxenabled/openapi/master/openapi/mx_platform_api_beta.yml \ |
| 81 | +-g typescript-axios \ |
| 82 | +-c ./openapi/config.yml \ |
| 83 | +-t ./openapi/templates |
| 84 | +``` |
| 85 | + |
| 86 | +## Contributing |
| 87 | + |
| 88 | +Please [open an issue](https://github.com/mxenabled/mx-platform-node/issues) or [submit a pull request.](https://github.com/mxenabled/mx-platform-node/pulls) |
0 commit comments