Strava Sync

by Howard Wilson
5
4
3
2
1
Score: 23/100

Description

Category: 3rd Party Integrations

The Strava Sync plugin enables users to import and sync their Strava activities directly into Obsidian. It supports bulk imports using Strava's export feature and real-time synchronization through the Strava API. Users can customize the way their activity data is stored and displayed by using templates that integrate with other plugins such as Dataview and Charts. The plugin provides options to organize activities by date and sport type, visualize progress through contribution graphs, and enhance the note-taking experience with per-sport icons.

Reviews

No reviews yet.

Stats

28
stars
4,090
downloads
6
forks
556
days
118
days
564
days
7
total PRs
5
open PRs
1
closed PRs
1
merged PRs
4
total issues
4
open issues
0
closed issues
72
commits

Latest Version

2 years ago

Changelog

Updates requested by official review.

README file from

Github

GitHub manifest version GitHub Actions Workflow Status GitHub Downloads (all assets, all releases)

Obsidian Strava Sync

This plugin synchronizes activities from Strava into Obsidian.

The purpose of this plugin is not to provide a data backup, or to replace the functionality of the Strava apps. It's simply to allow activities to be more easily referenced, tracked and visualized within Obsidian, especially through integration with existing plugins like Obsidian Dataview.

Examples

These are some examples of what can be achieved along with the Dataview, Charts and Contribution Graph plugins. See the Dataview Integration section below for more ideas.

Installation

  1. Open Obsidian settings
  2. Go to Community plugins and turn off Restricted mode
  3. Under Community plugins, click "Browse" and search for "Strava Sync"
  4. Click Install, then Enable

It's also possible to install an unreleased (beta) version using the BRAT plugin:

  1. Install BRAT from the Community plugins in Obsidian
  2. Open the command palette and run the command "BRAT: Add a beta plugin for testing"
  3. Paste https://github.com/watsonbox/obsidian-strava-sync into the modal that opens up
  4. Click on Add Plugin 🎉

Manually installing the plugin

Alternatively you can install the plugin manually:

  1. Download the latest release from the releases page.
  2. Copy main.js, styles.css, and manifest.json to your vault's VaultFolder/.obsidian/plugins/obsidian-strava-sync/ directory.

Sync Configuration

In order to configure the plugin, you will need to obtain an access token from Strava. You can do this by going to "My API Applications" here and creating a new application as follows:

Strava Personal App

Once that's done, copy the Client ID and Client Secret into the plugin settings, and click "Connect with Strava". You will be redirected to Strava to login and authorize access. After successful authorization, you will be redirected back to your Obsidian vault and can close the browser window.

Basic Usage

Typically, once the plugin is enabled and configured, you'll want to set up templates for the activities as you import them. This can be done for the file path, the content itself, and the properties to be added.

Templating

Templates can be set up in the plugin settings.

The default file path template is Strava/{{start_date}}/{{id}} {{name}}, which will create a folder for each day, and a file for each activity within that folder for example Strava/2024-02-20/1234567890 Running with the bears.md.

The date formats themselves can also be adjusted in the plugin settings.

[!TIP] If you prefer to group files differently, that's possible too. For example, create a folder structure like 2024/09-September (with all September's activities inside) by setting the folder date format to yyyy/MM-MMMM.

Content

The default content template is:

# {{name}}

[https://www.strava.com/activities/{{id}}](https://www.strava.com/activities/{{id}})
{{#if description}}

Description: {{description}}
{{/if}}
{{#if private_note}}

> [!NOTE] Private note
> {{private_note}}
{{/if}}

#Strava

This will produce a file similar to the following:

# Running with the bears

[https://www.strava.com/activities/1234567890](https://www.strava.com/activities/1234567890)

Description: This is a description

> [!NOTE] Private note
> This is a private note

The templating language used is Handlebars.js. The available fields are as follows (more info here):

Field Example(s) Description
id 1218940553 Unique identifier for the activity
start_date "2024-08-28 05:07:43" Start date and time of the activity
name "Dynamo Challenge 2024" Name of the activity
sport_type "Ride", "Run", "Swim", etc. Type of sport
description "Great weather and company" Description of the activity
private_note "Take two inner tubes next time" Private note for the activity
elapsed_time 38846 Total elapsed time in seconds
moving_time 26010 Moving time in seconds
distance 154081.0 Distance in meters
max_heart_rate 180 Maximum heart rate
max_speed 18.8 Maximum speed in meters per second
average_speed 11.1 Average speed in meters per second
total_elevation_gain 1338.0 Total elevation gain in meters
elev_low 50.7 Lowest elevation in meters
elev_high 60.2 Highest elevation in meters
calories 1234 Calories burned
icon 🚴‍♂️🏃🏊⛷️🏸🛶🏋️🚶🚵⛳🦽🥾⛸️🛼🏄🏓🧘🧗🚣⛵🛹🏂⚽🎾 Activity icon
Properties

Finally, you can also specify any of these fields to be added to the properties / front matter of each imported activity. By default the properties are name, start_date, sport_type, description, private_note, elapsed_time, moving_time, distance, and icon, for example:

---
id: 1014355555
name: Evening Run
start_date: 2024-06-02T18:31:27.000Z
sport_type: Run
distance: 4372.5
elapsed_time: 1651
moving_time: 1511
description: "Great run"
private_note: "Push it to 10km next time"
icon: 🏃
---

The property id is always added.

Importing Recent Activities

Next, either by clicking the Strava icon in the ribbon or using the command "Import new activities from Strava", the plugin will fetch and import your 30 most recent activities from Strava using the API.

Each time new activities are imported, the start date of the last imported activity is saved. Next time you import new activities, only activities after that date will be imported.

Importing a Strava Bulk Export

Strava allows you to download your activities as a bulk export as described here. This export contains all historical activities. Either in the plugin settings, or by using the "Import Strava activities from bulk export CSV" command directly, you can select the activities.csv file from the bulk export to import the entire history.

[!NOTE] Note that the Strava bulk export CSV format is not the same as the Web API activity format (JSON). This plugin allows both formats to be imported, but some fields that are not common to both formats are not imported.

[!TIP] You may prefer to exclude imported activities from the Obsidian search and graph views by adding the sync folder to "Options -> Files and links -> Excluded files" in the settings.

Dataview Integration

Once you've selected the activity attributes you'd like to include as properties, the real power of this plugin comes from the Dataview integration. You can install it through the Community Plugins tab in Obsidian, and then refer to the detailed documentation to learn how to use it.

The following are some examples of what you can do with Dataview and the Strava plugin.

List all activities with "knee" in private note

```dataview
TABLE WITHOUT id name, dateformat(start_date, "yyyy-MM-dd") AS date, private_note
FROM "Apps/Strava"
WHERE icontains(private_note, "knee")
```

List all activities for the current month in a callout

> [!EXAMPLE] This Month's Activities
>
> ```dataview
> TABLE WITHOUT id
>   link(file.path, name) AS Activity,
>   dateformat(localtime(start_date), "yyyy-MM-dd") AS Date,
>   dur(round(elapsed_time/60) + "m") as Duration,
>   choice(length(private_note) > 0, "📝", "") AS "📝",
>   choice(icontains(private_note, "pain"), "🤕", "") AS "🤕"
> FROM "Strava"
> WHERE dateformat(start_date, "yyyy-MM") = dateformat(date(now),"yyyy-MM")
> ```

Show a chart of total distance per year by activity type

Using DataviewJS gives us much more flexibility, for example the ability to use the Charts plugin to visualize historical activity data.

```dataviewjs
const pages = dv.pages('#Strava')
const dates = pages.map(p => p.start_date).values
const yearData = {};

pages.forEach(page => {
  const year = moment(page.start_date.ts).startOf('week').format('YYYY');
  const ridingDistance = page.sport_type === 'Ride' ? page.distance : 0;
  const runningDistance = page.sport_type === 'Run' ? page.distance : 0;

  if (!yearData.hasOwnProperty(year)) {
    yearData[year] = {
      ridingDistance: 0,
      runningDistance: 0
    };
  }

  yearData[year].ridingDistance += ridingDistance;
  yearData[year].runningDistance += runningDistance;
});

const years = Object.keys(yearData);
const ridingDistance = Object.values(yearData).map(data => data.ridingDistance);
const runningDistance = Object.values(yearData).map(data => data.runningDistance);

const chartData = {
  type: 'bar',
  data: {
    labels: years,
    datasets: [
      {
        label: '🚴 Riding distance',
        data: ridingDistance,
        backgroundColor: [ 'rgba(255, 99, 132, 0.2)' ],
        borderColor: [ 'rgba(255, 99, 132, 1)' ],
        borderWidth: 1
      },
      {
        label: '🏃 Running distance',
        data: runningDistance,
        backgroundColor: [ 'rgba(54, 162, 235, 0.2)' ],
    borderColor: [ 'rgba(54, 162, 235, 1)' ],
        borderWidth: 1
      }
    ]
  }
}
window.renderChart(chartData, this.container)
```

Display a contribution heat map with Contribution Graph

Not technically a Dataview integration. This example requires that the Contribution Graph plugin first be installed and enabled.

```contributionGraph
graphType: default
dateRangeValue: 365
dateRangeType: LATEST_DAYS
startOfWeek: "1"
showCellRuleIndicators: true
titleStyle:
  textAlign: left
  fontSize: 15px
  fontWeight: normal
dataSource:
  type: PAGE
  value: "#Strava"
  dateField:
    type: PAGE_PROPERTY
    value: start_date
  countField:
    type: PAGE_PROPERTY
    value: elapsed_time
fillTheScreen: false
enableMainContainerShadow: false
cellStyleRules:
  - id: Ocean_a
    color: "#8dd1e2"
    min: 1
    max: 3600
  - id: Ocean_b
    color: "#63a1be"
    min: 3600
    max: 7800
  - id: Ocean_c
    color: "#376d93"
    min: 7800
    max: 21600
  - id: Ocean_d
    color: "#012f60"
    min: 21600
    max: 100000
cellStyle:
  minWidth: 10px
  minHeight: 10px
```

Development Guidelines

  • Clone this repo to a local development folder. For convenience, you can place this folder in your .obsidian/plugins/obsidian-strava-sync folder.
  • Install NodeJS, then run yarn install in the command line under the repo folder.
  • Run yarn dev to compile the plugin to main.js. Changes should be automatically compiled into main.js.
  • Reload Obsidian to load the new version of the plugin.
  • Enable the plugin in the settings window.

Live Reloading

In order to avoid reloading Obsidian every time you make a change, you can use the Hot-Reload plugin as they suggest.

Releasing

Run yarn version after updating minAppVersion manually in manifest.json. The command will bump version in manifest.json and package.json, and add the entry for the new version to versions.json

Run yarn version, enter a new version number, then push to build and prepare a draft release on GitHub.

[!NOTE] You may need to run yarn config set version-tag-prefix "" before running yarn version to ensure the version tag is created correctly.

Resources

Powered by Strava

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Tressel Sync for Obsidian
4 years ago by Tressel
Official Tressel plugin to export various content from the Internet (like Twitter, Reddit, Kindle and more) into Obsidian
KOReader Sync
4 years ago by Federico "Edo" Granata
Obsidian.md plugin to sync highlights/notes from koreader
Pinboard Sync
4 years ago by Mathew Spolin
Obsidian plugin to sync Pinboard.in links to Daily Notes
Vim Multibyte Char Search
4 years ago by anselmwang
Search multibyte characters by the corresponding input method encoding. For example, for Chinese, search "用来" by "yl"
Weread Plugin
4 years ago by hank zhao
Obsidian Weread Plugin is a plugin to sync Weread(微信读书) hightlights and annotations into your Obsidian Vault.
Douban
4 years ago by Wanxp
an obsidian plugin that can pull data from douban to your markdown file
Readavocado Sync
4 years ago by Cyrus Zhang
Readavocado obsidian plugin to sync your favorite highlights.
Vika Sync
4 years ago by romantic-black
Awesome Flashcard
4 years ago by AwesomeDog
Handy Anki integration for Obsidian.
SamePage
3 years ago by SamePage
Sync Graph Settings
3 years ago by Xallt
This is a plugin for syncing graph settings (Color Groups and Search Filters) to Local Graphs
Awesome Reader
3 years ago by AwesomeDog
Make Obsidian a proper Reader.
WuCai highlights Official
3 years ago by 希果壳五彩
WuCai highlights Official, for Sync highlights into your obsidian notes
Askify Sync
3 years ago by Kishlay Raj
Invio
3 years ago by frontend-engineering
Publish obsidian docs online
Syncthing Integration
3 years ago by LBF38
Obsidian plugin for Syncthing integration
TickTick
3 years ago by Viduy Cheung
Share to NotionNext
3 years ago by EasyChris, jxpeng98
Share obsidian markdown file to any Notion database and generate notion share link 同步obsdian文件到任意Notion数据库。
AnkiSync+
3 years ago by RochaG0
Notes Sync Share
3 years ago by Alt-er
Sync and share (publish) your notes in your own private service.
Tracker+
3 years ago by GreaterThan (original by pyrochlore)
A plugin for Obsidian that tracks and visualizes in your notes. A continuation of the plugin originally developed by @pyrochlore
TickTickSync
2 years ago by thesamim
Peerdraft
2 years ago by Peerdraft
Collaboration for Obsidian – Sync, Share, and Edit anywhere
Instapaper
2 years ago by Instapaper
Official Instapaper plugin for Obsidian
Settings profiles
2 years ago by 4Source
This is a plugin for Obsidian (https://obsidian.md). Allows you to create various global settings profiles. You can sync them between different vaults. To keep all your settings in sync, you'll never have to manually adjust them again for every vault you have or create in the future.
GitHub Sync
2 years ago by Kevin Chin
Sync Obsidian vault to personal GitHub
BookFusion
2 years ago by BookFusion
BookFusion Obsidian Plugin
Confluence Sync
2 years ago by Prateek Grover
Obsidian plugin for obsidian confluence sync
Cicada Synchronizer
2 years ago by Adapole, Adapole, Mahyar Mirrashed
Sync config folder to common folder
2 years ago by codeonquer
Voicenotes Sync
2 years ago by Andrew Lombardi
Official Obsidian plugin that syncs your notes from VoiceNotes.com into your vault
Memos Sync
2 years ago by RyoJerryYu
Syncing Memos to Obsidian daily note. Fully compatible with official Daily Notes plugin, Calendar plugin and Periodic Notes plugin.
DocBase (Unofficial)
2 years ago by yurikuvanov
Unofficial DocBase plugin for Obsidian
Vikunja Sync
2 years ago by Peter Heiss
Manage your tasks in vikunja.
AnySocket Sync
2 years ago by Andrei Vaduva
Securely Synchronize your Vault on a self-hosted server
Todoist Sync
6 years ago by jamiebrynes7
Materialize Todoist tasks in Obsidian notes
Filename Heading Sync
5 years ago by dvcrn
Obisdian.md plugin to keep the filename and the first header of the file in sync
Readwise Mirror
5 years ago by jsonmartin
Taskbone
5 years ago by Dominik Schlund
Obsidian OCR plugin - extract text from images
Lineup Builder
4 years ago by James Fallon
An Obsidian plugin that lets you build football lineups
Remotely Save
4 years ago by fyears
Sync notes between local and cloud with smart conflict: S3 (Amazon S3/Cloudflare R2/Backblaze B2/...), Dropbox, webdav (NextCloud/InfiniCLOUD/Synology/...), OneDrive, Google Drive (GDrive), Box, pCloud, Yandex Disk, Koofr, Azure Blob Storage.
BookXNote Sync
2 years ago by CodeListening
将bookxnote中的笔记同步到obsidian指定的文件夹中
Cloud Storage
2 years ago by Jiajun Ma
Obsidian Cloud Storage is a powerful and user-friendly plugin designed to seamlessly integrate cloud storage capabilities into your Obsidian workflow. This plugin allows you to effortlessly upload your attachments to the cloud, freeing up local storage space and enabling easy sharing and access across all your devices.
ExMemo Client
2 years ago by Yan.Xie
exmemo obsidian plugin
Unearthed (Kindle Sync)
a year ago by CheersCal
Workout Tracker
a year ago by wanabeunique
Obsidian plugin for track workouts
HackMD Sync
a year ago by thor kampefner
obsidian extension to push and pull notes from hackmd conveniently
Google Drive Sync
a year ago by Richard Xiong
A plugin to make Obsidian work in Google Drive to enable access to iOS.
Sync to Hugo
a year ago by Cray Huang
Sync the selected notes from Obsidian to Hugo
Sync Cnblog
a year ago by zhanglei
同步文章到博客园
WikiDocs
a year ago by pahkey
BetaX NAS Sync
a year ago by Skye
Obsidian NAS Sync
Hoarder Sync
a year ago by Jordan Hofker
An Obsidian.md community plugin that allows syncing with https://karakeep.app/
Feedly Annotations Sync
a year ago by Nick Felker
Download my Feedly annotations
Glasp
a year ago by Glasp
Obsidian plugin to import highlights and notes from Glasp
Minote Sync
a year ago by Emac Shen
Minote Sync is a Obsidian plugin to sync Minote(小米笔记) into your Vault.
Checkbox Sync
a year ago by Grol
Keep parent/child checkboxes in sync automatically within your Obsidian task lists.
VaultSync
a year ago by Justin Bird
Obsidian plugin to link your vault to a cloud storage provider.
KOI Sync
a year ago by Luke Miller
Memos AI Sync
a year ago by leoleelxh
obsidian-memos-sync-plugin,将 Memos 内容同步到 Obsidian 的插件,提供无缝集成体验。
Jade Publisher
a year ago by Lucas Ji
This is a simple plugin to help publish your Obsidian vault to a public website(build with Jade).
Sync Vault CE
a year ago by Camus Qiu
The missing bridge between your 10+ TB cloud drive and your AI brain.
InfoFlow
a year ago by RockieStar Inc.
Obsidian plugin for InfoFlow.app - This plugin integrates InfoFlow with Obsidian, allowing you to sync your saved articles, web pages, notes, and highlights directly into your Obsidian vault.
LINE Notes Sync
a year ago by onikun94
GitHub Gitless Sync
a year ago by Silvano Cerza
Sync a GitHub repository with vaults on different platforms without requiring git installation
GitHub Tracker
a year ago by schaier-io
Browser History
a year ago by noy4
Sync your browser history to notes.
Anki Integration
a year ago by Noah Boos AKA Rift
Create flashcards from your notes with a seamless interface, structuring them with metadata and syncing effortlessly via AnkiConnect.
Jira Issue Manager
a year ago by Alamion
Obisdian plugin to sync tasks between Obsidian and Jira
Cubox
a year ago by delphi-2015
Cubox Official Obsidian Plugin
Limitless Lifelogs
a year ago by Maclean Dunkin
Sync your Limitless AI lifelog entries directly into Obsidian markdown files.
Markwhen File Sync
a year ago by rouvenjahnke
Synchronize properties from your Obsidian notes with a Markwhen timeline file.
Markdown Hijacker
a year ago by Yongmini
Beyond the Vault. One hub for every Markdown, everywhere
Google Contacts
a year ago by aleksejs1
Obsidian plugin for sync Google Contacts with obsidian notes
Yandex Wiki Integration
10 months ago by Pavel Sokolov
Github Issues
10 months ago by LonoxX
An Obsidian plugin that integrates with GitHub to track issues and pull requests directly in your vault.
Sync-safe file names
6 months ago by j-maas
Ensure your Obsidian files can always be synced across all your devices.
MrDoc
6 months ago by zmister
An Obsidian plugin for MrDoc that enables two-way synchronization between local Obsidian documents and MrDoc.一个 Obsidian 的 MrDoc 插件,用于 Obsidian 本地文档与 MrDoc 的双向同步
Nutstore Sync
5 months ago by nutstore-dev
Workout Planner
4 months ago by Rares Spatariu
Hardcover
3 months ago by aliceinwaterdeep