JavaScript SDK for marketplace api-gateway
JavaScript
Latest commit c6e6b22 Sep 27, 2016 @fraserxu fraserxu committed on GitHub Merge pull request #12 from envato/bump-to-v0-4-0
0.4.0
Permalink
Failed to load latest commit information.
lib Fix the userAccountDetails API endpoint Sep 23, 2016
test Add user account details API Sep 21, 2016
.gitignore Initial commit Jun 16, 2016
.travis.yml add travis config Jun 22, 2016
LICENSE Initial commit Jun 16, 2016
README.md Add getAccountDetails() into README Sep 22, 2016
package.json 0.4.0 Sep 27, 2016

README.md

market-api-gateway-js

NPM version build status js-standard-style

JavaScript SDK for Envato marketplace api-gateway

Installation

npm install @envato-marketplace-foundation/market-api-gateway-js

Documentation

For detail documentation, check https://build.envato.com/api

API Overview

Create a new apiGateway instance:

const ApiGateway = require('@envato-marketplace-foundation/market-api-gateway-js')

const apiGateway = new ApiGateway('ACCESS_TOKEN')
// or
const apiGateway = new ApiGateway({
  accessToken: 'ACCESS_TOKEN',
  baseURL: 'new api endpint', // optional
  timeout: 3000 // optional
})

optional options:

  • baseURL String api base url, default to https://api.envato.com
  • timeout Integer request timeout, default to 2000

Each resource is under it's own category as documented on https://build.envato.com/api/ and it return a Promise:

apiGateway.stats.getTotalUsers()
  .then(function (res) {
    console.log('res', res)
  })
  .catch(function (err) {
    console.log('err', err)
  })

Available resources & methods

Development

$ npm install
$ npm test

Publish to npm.

npm publish --access=public

If you want to publish module to npm, check the documentation at Working with scoped packages for more detail.

License

MIT