Skip to content

Strava

import { Steps, Aside } from ‘@astrojs/starlight/components’;

Strava is an activity-tracking platform designed around outdoor and fitness workouts — particularly running, cycling, swimming, and other endurance sports. VitaSync syncs Strava activities as structured events with GPS, heart rate, and performance metrics.

Strava uses OAuth 2.0 with standard authorization code flow.

  • Authorization URL: https://www.strava.com/oauth/authorize
  • Token URL: https://www.strava.com/oauth/token
  • API Base URL: https://www.strava.com/api/v3
  1. Go to Strava API Settings

    Visit strava.com/settings/api and sign in.

  2. Create an application

    Fill in the form:

    • Application Name: Your app name
    • Category: Choose the most appropriate category
    • Club: Optional
    • Website: Your app URL
    • Authorization Callback Domain:
      • For development: localhost
      • For production: api.yourdomain.com
  3. Copy credentials

    Note the Client ID (numeric) and Client Secret from the API settings page.

  4. Add to environment

    Terminal window
    STRAVA_CLIENT_ID=12345
    STRAVA_CLIENT_SECRET=your_client_secret

VitaSync requests the following Strava scopes:

ScopeData Access
activity:read_allAll activities including private ones
readBasic profile information

Strava is activity-centric. VitaSync syncs Strava data primarily through the Events API:

Metric TypeNotes
workoutEach Strava activity becomes an Event (see below)
distanceExtracted from activities per day
caloriesCalories from activity data
heart_rateAverage/max HR per activity if recorded with HR monitor

Strava activities sync to the VitaSync Events API with full sport metadata:

{
"eventType": "workout",
"activityType": "running",
"startedAt": "2025-06-06T06:00:00.000Z",
"endedAt": "2025-06-06T06:52:00.000Z",
"durationSeconds": 3120,
"distanceMeters": 8400,
"caloriesKcal": 612,
"avgHeartRate": 158,
"maxHeartRate": 182,
"providerId": "strava",
"data": {
"name": "Morning Run",
"description": "Easy aerobic run",
"type": "Run",
"sportType": "Run",
"commute": false,
"trainer": false,
"elevationGain": 65,
"avgSpeed": 2.69,
"maxSpeed": 3.81,
"avgCadence": 168,
"avgWatts": null,
"kilojoules": null,
"kudosCount": 4,
"achievementCount": 2
}
}

VitaSync maps all Strava sport_type values into the activityType field. Common types include:

activityTypeStrava sport_type
runningRun, TrailRun, VirtualRun
cyclingRide, VirtualRide, GravelRide, MountainBikeRide
swimmingSwim
walkingWalk, Hike
skiingAlpineSki, BackcountrySki, NordicSki
rowingRowing, VirtualRow
workoutWeightTraining, Crossfit, Elliptical, Workout
SettingValue
Minimum sync interval15 minutes
Initial sync windowLast 30 days
Rate limit100 req/15min, 1000 req/day

Strava supports push subscriptions that notify VitaSync when new activities are uploaded. This reduces the need for frequent polling and can make new activity data available within seconds of the user finishing a workout.

To enable Strava push subscriptions, configure the public webhook URL in your Strava app settings.

FeatureStravaFitbitGarminWHOOP
GPS workout dataExcellentLimitedExcellentGood
24/7 heart rateNoYesYesYes
Sleep trackingNoYesYesYes
Recovery/HRVNoPartialYesYes
Activity varietyExcellentLimitedGoodGood

Strava excels at workout logging and social features but does not track passive health metrics like resting HR, sleep, or continuous HR. For comprehensive health monitoring, pair Strava with Fitbit, Garmin, or WHOOP.

SymptomLikely Cause
No activities syncingActivities may be set to private with tighter visibility; check activity:read_all scope
Missing heart rate on activitiesActivity was recorded without a heart rate monitor
Rate limit errorsToo many users syncing simultaneously — VitaSync queues jobs to stay within limits
401 on syncToken expired; Strava access tokens expire after 6 hours — VitaSync refreshes automatically