node-strava/node-strava-v3

Connection to strava does not work

alex8276 opened this issue · 1 comments

Hello,
I'm beginner to nodejs and i would like use your package.
I don't understand how to work. DO you have a complete tutorial for a beginner ?
When I make this:

strava.config({
    "access_token"  : "xxxmyTokenxxx",
    "client_id"     : "xxx",
    "client_secret" : "xxxxxxxxxxxxxxxxxx",
    "redirect_uri"  : "http://localhost:8082",
  });
strava.athlete.get({},function(err,payload,limits) {
        console.log(payload);
    });

I get an 401 error access_token code invalid, I don't understand why ? If I put my token in callback function it's ok !
How to call strava to connect my client ?

regards

You need to pass access_token to the endpoint function: strava.athlete.get({ access_token: "xxxmyTokenxxx" }, function () {..