This plugin enables downloading and visualizing your Strava activities to your Obsidian vault.
-
Install the plugin to your Obsidian vault.
-
To use this plugin in your Obsidian vault, you first need to enable API access to your own Strava account. Login to your Strava account on your browser and head over to the following URL https://www.strava.com/settings/api and create your API application. Some steps are detailed here https://developers.strava.com/docs/getting-started/. Use the following values:
Category: Other Website: https://github.com/saadsaifse/strava-obsidian Authorization Callback Domain: obsidianforstrava
Once created, note your
Client ID
andClient Secret
. We will enter these values once in the plugin settings. -
Head over to the plugin settings and enter your Strava Client ID and Client Secret and click on Save.
-
Click on the Authenticate button. It will take you to your browser to finish the OAuth process. After authorizing, you will be redirected to your Obsidian app.
-
Now, simply click on the
Synchronize Strava Activities
button on the left ribbon icon, to download all your Strava activities to your vault.
- Download the summary of all your Strava activities
- Download the details of all your Strava activities. The details include segment information, etc. Details are not downloaded automatically. Instead there is a context menu upon right clicking on the summary files to fetch the details of that activity. This is because there is a limit on the free Strava API usage.
- Activities are stored based on the following directory structure.
Vault Strava Activity Date e.g. 2023-09-17 Activity ID e.g. 0123456789 summary.md detail.md (this file is created when user sends a command) map.geojson (this file is created to store the polyline information for activities with location data. Hidden from the vault, but exists on the filesystem)
- Visualize your activities with maps data e.g., runs, rides, etc. on a leaflet map. For this to work, just install the Obsidian Leaflet plugin to your vault.
- The last downloaded date and time is remembered in order to only download the newer activities. Just click on the
Synchronize Strava Activities
to download newer activities. - Once you have all your activities synced, you can add links to your today's Strava activities in your daily notes by using
Insert today's Strava activity maps
orInsert today's Strava activities
commands. They will insert activity maps or full activities at your cursor location respectively e.g.,
- The leaflet map doesn't open centered. This is a bug in the Obsidian Leaflet plugin. Until that's fixed, please click on the Reset Zoom button on the left of map to zoom to the activity map.
Hi 👋🏼, if I made your life easier, consider buying me a coffee :) https://www.buymeacoffee.com/saadsaif
Quick starting guide for new plugin devs:
- Install NodeJS, then run
npm i
in the command line under the repo folder. - Run
npm run dev
to compile the plugin frommain.ts
tomain.js
. - Make changes to
main.ts
(or create new.ts
files). Those changes should be automatically compiled intomain.js
. - Reload Obsidian to load the new version of your plugin. Or use the hot reload plugin to load changes as they occur https://github.com/pjeby/hot-reload.
- Enable plugin in settings window.
- Update your
manifest.json
with your new version number, such as1.0.1
, and the minimum Obsidian version required for your latest release. - Update your
versions.json
file with"new-plugin-version": "minimum-obsidian-version"
so older versions of Obsidian can download an older version of your plugin that's compatible. - Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix
v
. E.g.,git tag -a 1.0.0 -m "1.0.0" git push origin 1.0.0
- Github actions will execute upon pushing a new tag and will create a draft release on Github.
- Specify release notes on github and publish the release.
You can simplify the version bump process by running
npm version patch
,npm version minor
ornpm version major
after updatingminAppVersion
manually inmanifest.json
. The command will bump version inmanifest.json
andpackage.json
, and add the entry for the new version toversions.json
- Copy over
main.js
,styles.css
,manifest.json
to your vaultVaultFolder/.obsidian/plugins/your-plugin-id/
.