node-strava/node-strava-v3

Package Authorization Failure

yoshiohasegawa opened this issue · 1 comments

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)
})```

We already have something like that:

#112

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