@rainway/api
v0.2.3
Published
OpenAPI client for @rainway/api
Downloads
3
Readme
@rainway/api
This is a TypeScript/JavaScript wrapper for the Rainway API that utilizes axios. The module can be used in the following environments:
Environment
- Node.js
- Webpack
- Browserify
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system (in Typescript or with a transpiler like Babel, the actual modules are CommonJS)
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via package.json
. (Reference)
Usage
npm install @rainway/api
Example usage:
import {Configuration, PeersApi} from "@rainway/api"
async function main() {
const api = new PeersApi(new Configuration({
username: "pk_live_xxx",
password: "sk_live_xxx"
}))
const peers = (await api.getPeers("123456")).data //123456 being an orgId, found in the url bar when you're logged into the Rainway Hub
console.log(peers)
}
main()
Building
To build and compile the TypeScript source use:
npm install
npm run build