npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strava_api_v3_pig

v3.0.1

Published

The__Swagger_Playground_httpsdevelopers_strava_complayground_is_the_easiest_way_to_familiarize_yourself_with_the_Strava_API_by_submitting_HTTP_requests_and_observing_the_responses_before_you_write_any_client_code__It_will_show_what_a_response_will_look_li

Downloads

5

Readme

strava_api_v3

StravaApiV3 - JavaScript client for strava_api_v3 The Swagger Playground is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with different endpoints depending on the authorization scope you receive from your athletes. To use the Playground, go to https://www.strava.com/settings/api and change your “Authorization Callback Domain” to developers.strava.com. Please note, we only support Swagger 2.0. There is a known issue where you can only select one scope at a time. For more information, please check the section “client code” at https://developers.strava.com/docs. This SDK is automatically generated by the Swagger Codegen project:

  • API version: 3.0.0
  • Package version: 3.0.0
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install strava_api_v3 --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your strava_api_v3 from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('strava_api_v3') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var StravaApiV3 = require('strava_api_v3');

var defaultClient = StravaApiV3.ApiClient.instance;

// Configure OAuth2 access token for authorization: strava_oauth
var strava_oauth = defaultClient.authentications['strava_oauth'];
strava_oauth.accessToken = "YOUR ACCESS TOKEN"

var api = new StravaApiV3.ActivitiesApi()

var name = "name_example"; // {String} The name of the activity.

var sportType = "sportType_example"; // {String} Sport type of activity. For example - Run, MountainBikeRide, Ride, etc.

var startDateLocal = new Date("2013-10-20T19:20:30+01:00"); // {Date} ISO 8601 formatted date time.

var elapsedTime = 56; // {Number} In seconds.

var opts = { 
  'type': "type_example", // {String} Type of activity. For example - Run, Ride etc.
  'description': "description_example", // {String} Description of the activity.
  'distance': 3.4, // {Number} In meters.
  'trainer': 56, // {Number} Set to 1 to mark as a trainer activity.
  'commute': 56 // {Number} Set to 1 to mark as commute.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createActivity(name, sportType, startDateLocal, elapsedTime, opts, callback);

Documentation for API Endpoints

All URIs are relative to https://www.strava.com/api/v3

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- StravaApiV3.ActivitiesApi | createActivity | POST /activities | Create an Activity StravaApiV3.ActivitiesApi | getActivityById | GET /activities/{id} | Get Activity StravaApiV3.ActivitiesApi | getCommentsByActivityId | GET /activities/{id}/comments | List Activity Comments StravaApiV3.ActivitiesApi | getKudoersByActivityId | GET /activities/{id}/kudos | List Activity Kudoers StravaApiV3.ActivitiesApi | getLapsByActivityId | GET /activities/{id}/laps | List Activity Laps StravaApiV3.ActivitiesApi | getLoggedInAthleteActivities | GET /athlete/activities | List Athlete Activities StravaApiV3.ActivitiesApi | getZonesByActivityId | GET /activities/{id}/zones | Get Activity Zones StravaApiV3.ActivitiesApi | updateActivityById | PUT /activities/{id} | Update Activity StravaApiV3.AthletesApi | getLoggedInAthlete | GET /athlete | Get Authenticated Athlete StravaApiV3.AthletesApi | getLoggedInAthleteZones | GET /athlete/zones | Get Zones StravaApiV3.AthletesApi | getStats | GET /athletes/{id}/stats | Get Athlete Stats StravaApiV3.AthletesApi | updateLoggedInAthlete | PUT /athlete | Update Athlete StravaApiV3.ClubsApi | getClubActivitiesById | GET /clubs/{id}/activities | List Club Activities StravaApiV3.ClubsApi | getClubAdminsById | GET /clubs/{id}/admins | List Club Administrators StravaApiV3.ClubsApi | getClubById | GET /clubs/{id} | Get Club StravaApiV3.ClubsApi | getClubMembersById | GET /clubs/{id}/members | List Club Members StravaApiV3.ClubsApi | getLoggedInAthleteClubs | GET /athlete/clubs | List Athlete Clubs StravaApiV3.GearsApi | getGearById | GET /gear/{id} | Get Equipment StravaApiV3.RoutesApi | getRouteAsGPX | GET /routes/{id}/export_gpx | Export Route GPX StravaApiV3.RoutesApi | getRouteAsTCX | GET /routes/{id}/export_tcx | Export Route TCX StravaApiV3.RoutesApi | getRouteById | GET /routes/{id} | Get Route StravaApiV3.RoutesApi | getRoutesByAthleteId | GET /athletes/{id}/routes | List Athlete Routes StravaApiV3.SegmentEffortsApi | getEffortsBySegmentId | GET /segment_efforts | List Segment Efforts StravaApiV3.SegmentEffortsApi | getSegmentEffortById | GET /segment_efforts/{id} | Get Segment Effort StravaApiV3.SegmentsApi | exploreSegments | GET /segments/explore | Explore segments StravaApiV3.SegmentsApi | getLoggedInAthleteStarredSegments | GET /segments/starred | List Starred Segments StravaApiV3.SegmentsApi | getSegmentById | GET /segments/{id} | Get Segment StravaApiV3.SegmentsApi | starSegment | PUT /segments/{id}/starred | Star Segment StravaApiV3.StreamsApi | getActivityStreams | GET /activities/{id}/streams | Get Activity Streams StravaApiV3.StreamsApi | getRouteStreams | GET /routes/{id}/streams | Get Route Streams StravaApiV3.StreamsApi | getSegmentEffortStreams | GET /segment_efforts/{id}/streams | Get Segment Effort Streams StravaApiV3.StreamsApi | getSegmentStreams | GET /segments/{id}/streams | Get Segment Streams StravaApiV3.UploadsApi | createUpload | POST /uploads | Upload Activity StravaApiV3.UploadsApi | getUploadById | GET /uploads/{uploadId} | Get Upload

Documentation for Models

Documentation for Authorization

strava_oauth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://www.strava.com/api/v3/oauth/authorize
  • Scopes:
    • read: Read public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards
    • read_all: Read private routes, private segments, and private events for the user
    • profile:read_all: Read all profile information even if the user has set their profile visibility to Followers or Only You
    • profile:write: Update the user's weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf
    • activity:read: Read the user's activity data for activities that are visible to Everyone and Followers, excluding privacy zone data
    • activity:read_all: The same access as activity:read, plus privacy zone data and access to read the user's activities with visibility set to Only You
    • activity:write: Access to create manual activities and uploads, and access to edit any activities that are visible to the app, based on activity read access level