Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patreonOAuth not a function | incorrect documentation? #38

Open
Vilksian opened this issue Aug 26, 2020 · 1 comment
Open

patreonOAuth not a function | incorrect documentation? #38

Vilksian opened this issue Aug 26, 2020 · 1 comment

Comments

@Vilksian
Copy link

Vilksian commented Aug 26, 2020

var url = require('url')
var patreon = require('patreon')
var patreonAPI = patreon.patreon
var patreonOAuth = patreon.oauth
 
// Use the client id and secret you received when setting up your OAuth account
var CLIENT_ID = 'pppp'
var CLIENT_SECRET = 'pppp'
var patreonOAuthClient = patreonOAuth(CLIENT_ID, CLIENT_SECRET)

Using the example code with the correct CLIENT_ID and CLIENT_SECRET, results in the last line of the above code erroring, with the following error:

var patreonOAuthClient = patreonOAuth(CLIENT_ID, CLIENT_SECRET);
TypeError: patreonOAuth is not a function

According to the documentation, and the example therein, that should be a function, yet it isn't.

@Vilksian
Copy link
Author

Vilksian commented Aug 26, 2020

After a bit of digging through the library, I found that the following code seems to work much better:

var URL = require('url');
var { patreon, jsonApiURL, oauth } = require('patreon');
var patreonAPI = patreon
var patreonOAuth = oauth

var CLIENT_ID = 'pppp'
var CLIENT_SECRET = 'pppp'
var patreonOAuthClient = patreonOAuth(CLIENT_ID, CLIENT_SECRET)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant