Patreon / patreon-js

Use the Patreon API via OAuth.
MIT License
151 stars 30 forks source link

Breaking change between 0.1 and 0.4, incorrect docs #21

Closed dylanjha closed 6 years ago

dylanjha commented 6 years ago

The exposed API for the package has changed

0.1.0

const patreon = require('patreon')

Object.keys(patreon)   // ['oauth', 'default']
typeof patreon.oauth   // 'function'
typeof patreon.default // 'function'

0.4.0

const patreon = require('patreon')

Object.keys(patreon)       // [ 'oauth', 'patreon', 'jsonApiURL' ]
typeof patreon.oauth       // 'function'
typeof patreon.patreon     // 'function'
typeof patreon.jsonApiURL  // 'function'

Despite the new api, the docs have not been updated so the examples in Usage are not accurate. Using the example:

var patreon = require('patreon')
var patreonAPI = patreon.default
var patreonOAuth = patreon.oauth

patreonAPI(<access token>)
// ERROR patreonAPI is not a function
nperickson commented 6 years ago

Hey @dylanjha -

Thanks for reporting this. I've made a task for us to get this updated.

emosesPatreon commented 6 years ago

This is fixed in the README as of #22