0.2.2 • Published 4 years ago
rainway-api v0.2.2
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-apiExample 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