node-strava / node-strava-v3

API wrapper for Strava's v3 API, in Node
MIT License
356 stars 109 forks source link

Package Authorization Failure #112

Closed yoshiohasegawa closed 3 years ago

yoshiohasegawa commented 3 years ago

Hey all,

I've been trying to set up an authorized connection to Strava API using node-strava-v3, and I'm having trouble with the instructions in the README.

I've followed the instructions posted, and I keep getting back 401 errors. I've even forked and cloned the repo to try and get it to work after tweaking some things. I still can't seem to make a connection. It seems as thought the strava client gets instantiated upon import. The config doesn't seem to overwrite anything.

Would you mind updating the README.md to show proper setup? I'll share my code with you here:


// Node Strava V3
// Testing Code Block:
const strava = require('strava-v3')

strava.config({
  "access_token"  : "ACCESS_TOKEN",
  "client_id"     : "CLIENT_ID",
  "client_secret" : "CLIENT_SECRET",
  "redirect_uri"  : "localhost",
})

strava.athlete.get({}).then((data) => {
  console.log(data)
})```
markstos commented 3 years ago

We already have something like that:

https://github.com/UnbounDev/node-strava-v3/issues/112

Submit a PR to patch the docs If you've like.