NodeJS: Not able to find the npm package for strava_api_v3

713 views Asked by At

I'm working on the starva to get the athletes details. While referring their site they have mentioned to install the package "strava_api_v3" but it was not available in the npm package. Kindly share the link (or) npm installation process for the package strava_api_v3.

Thanks in advance.

1

There are 1 answers

0
Vaššo On

Strava javascript API package is generated with swagger-codegen tool.

For MacOS install the tool and Maven with brew install swagger-codegen@2 maven -g. Then generate the package and link it so that you can use it locally like this (make sure to replace PATH to wherever swagger-codegen binary is installed):

  export PATH=$PATH:/usr/local/Cellar/swagger-codegen@2/2.4.26/bin
  swagger-codegen generate -i https://developers.strava.com/swagger/swagger.json -l javascript -o strava-api-v3
  cd strava-api-v3
  npm link
  cd ../{your-project-root}
  npm link strava_api_v3

After this you will be able to import is as const StravaApiV3 = require('strava_api_v3')

References: https://developers.strava.com/docs The information on how to use the generated javascript module is in the generated README.md