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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@openpets/strava

v1.0.3

Published

Access your Strava data including activities, segments, clubs, and routes. View workout stats, analyze performance, and interact with the Strava community.

Downloads

19

Readme

Strava Pet

Access your Strava data including activities, segments, clubs, and routes. View workout stats, analyze performance, and interact with the Strava community.

Quick Start

1. Create a Strava API Application

  1. Go to https://www.strava.com/settings/api
  2. Create a new API application (or use existing)
  3. Note your Client ID and Client Secret

2. Get Your Access Token

For quick testing, copy the "Your Access Token" shown on your API settings page.

For production use, implement the OAuth flow:

  1. Redirect user to: https://www.strava.com/oauth/authorize?client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_CALLBACK&response_type=code&scope=read,activity:read_all
  2. Exchange the code for tokens at: POST https://www.strava.com/oauth/token

3. Configure Environment

Copy .env.example to .env and fill in your credentials:

cp .env.example .env
# Required
STRAVA_ACCESS_TOKEN=your_access_token_here

# Optional (for auto-refresh)
STRAVA_REFRESH_TOKEN=your_refresh_token_here
STRAVA_CLIENT_ID=your_client_id_here
STRAVA_CLIENT_SECRET=your_client_secret_here

4. Test Connection

opencode run "test strava connection"

Available Tools

Core Tools (Always Loaded)

| Tool | Description | |------|-------------| | strava-test-connection | Test API connection | | strava-get-logged-in-athlete | Get your athlete profile | | strava-get-stats | Get athlete statistics | | strava-get-logged-in-athlete-zones | Get heart rate/power zones | | strava-get-logged-in-athlete-activities | List your activities | | strava-get-activity-by-id | Get activity details | | strava-create-activity | Create manual activity | | strava-update-activity-by-id | Update an activity | | strava-get-laps-by-activity-id | Get activity laps | | strava-get-zones-by-activity-id | Get activity zones | | strava-get-comments-by-activity-id | Get activity comments | | strava-get-kudoers-by-activity-id | Get activity kudos | | strava-get-activity-streams | Get activity data streams | | strava-refresh-token | Refresh OAuth access token |

Optional Tool Groups

Enable with environment variables:

# Segments
STRAVA_LOAD_SEGMENTS_TOOLS=true
# → strava-get-segment-by-id, strava-explore-segments, strava-star-segment, etc.

# Segment Efforts
STRAVA_LOAD_SEGMENTEFFORTS_TOOLS=true
# → strava-get-efforts-by-segment-id, strava-get-segment-effort-by-id

# Clubs
STRAVA_LOAD_CLUBS_TOOLS=true
# → strava-get-club-by-id, strava-get-club-members-by-id, etc.

# Gear
STRAVA_LOAD_GEARS_TOOLS=true
# → strava-get-gear-by-id

# Routes
STRAVA_LOAD_ROUTES_TOOLS=true
# → strava-get-route-by-id, strava-get-route-as-g-p-x, strava-get-route-as-t-c-x

# Uploads
STRAVA_LOAD_UPLOADS_TOOLS=true
# → strava-create-upload, strava-get-upload-by-id

# Streams (additional)
STRAVA_LOAD_STREAMS_TOOLS=true
# → strava-get-segment-streams, strava-get-route-streams, etc.

Example Queries

# Get your profile
opencode run "get my strava athlete profile"

# List recent activities
opencode run "list my recent strava activities"

# Get activity details
opencode run "get strava activity 12345678"

# Get your stats
opencode run "get my strava stats for athlete ID 12345"

# Create a manual activity
opencode run "create a strava activity: 5k run, 25 minutes, today at 8am"

Token Refresh

Strava access tokens expire every 6 hours. To enable automatic refresh:

  1. Set all four environment variables (access token, refresh token, client ID, client secret)
  2. Use the strava-refresh-token tool when you get auth errors
  3. Update your .env with the new tokens returned
opencode run "refresh my strava token"

OAuth Scopes

| Scope | Access | |-------|--------| | read | Read public data | | read_all | Read all private data | | activity:read | Read activities | | activity:read_all | Read all activities including private | | activity:write | Create/update activities | | profile:read_all | Read all profile info | | profile:write | Update profile |

Rate Limits

  • 200 requests per 15 minutes
  • 2,000 requests per day

FAQ

Q: Why does my token expire? A: Strava access tokens are only valid for 6 hours. Set up refresh token support for automatic renewal.

Q: What scopes do I need? A: For read-only access: read,activity:read. For full access: read_all,activity:read_all,activity:write.

Q: How do I get activity streams? A: Use strava-get-activity-streams with the activity ID and specify which data streams you want (time, distance, heartrate, etc.).

Resources