This is a simple Cloudflare Worker allowing unauthenticated access to personal and global Strava heatmaps. If you want to use your personal Strava heatmap in Gaia or Locus, this will give you a URL that you can use for that.
Important
You will need to be a Strava premium subscriber to use the personal heatmap, while the global heatmaps are available to all Strava accounts. Personal use only, please. Strava will rate limit you.
You have a few options to deploy the worker code to Cloudflare.
Cloudflare Workers supports connecting directly to your GitHub repository.
- Go to your Cloudflare Dashboard -> Workers & Pages.
- Create an application and connect it to your GitHub repo.
- Cloudflare will automatically deploy changes when you push to the repository.
- Install wrangler:
npm install -g wrangler - Login to Cloudflare:
wrangler login - Deploy the worker:
wrangler deploy
This repository includes a deploy.yml workflow, but it is disabled by default. You can trigger it manually from the "Actions" tab in your repository if you configure the following repository secrets:
CF_ACCOUNT_IDCF_API_TOKEN
Strava's map tiles are protected, so the Worker needs valid session cookies to access them. The Worker handles refreshing short-lived CloudFront tokens automatically, but it needs a valid _strava4_session cookie to start.
This method automatically syncs your Strava cookies to the Cloudflare Worker whenever you visit Strava in your browser.
Note
You will need a Userscript manager installed in your browser. We recommend:
- Tampermonkey (Chrome, Firefox, Safari, Edge, etc.)
- ScriptCat (Chrome, Firefox, Edge)
-
Install the Userscript: Click here to install the script (requires a Userscript manager): Install strava_cookie_syncer.user.js
[!WARNING] If you are using a fork, verify the
@updateURLin the script matches your repository or install manually fromscripts/strava_cookie_syncer.user.js. -
Configure the Script:
- Go to Strava.com and log in.
- Open your Userscript manager menu (usually an icon in the browser toolbar).
- Select "Configure Cloudflare Credentials".
- Enter the required information when prompted:
- Cloudflare Account ID: Found in the URL of your Cloudflare Dashboard or on the Overview page.
- Cloudflare API Token: Create one at Cloudflare Profile > API Tokens.
- Template: Edit Cloudflare Workers
- Permissions: Account -> Workers Scripts -> Edit, Account -> Account Settings -> Read
- Worker Script Name: The name of your worker (default:
strava-heatmap-proxy).
-
Sync:
- Refresh the Strava page. The script will detect your cookies and upload them to your Worker's
STRAVA_COOKIESsecret. - You will see a notification if the update is successful.
- Refresh the Strava page. The script will detect your cookies and upload them to your Worker's
If you prefer not to use a userscript, you can manually extract the cookies and set the secret.
-
Log in to Strava in your browser.
-
Open Developer Tools (F12) -> Application/Storage tab -> Cookies.
-
Find the cookies for
strava.com. -
Construct a cookie string containing the following values:
_strava4_sessionCloudFront-PolicyCloudFront-Key-Pair-IdCloudFront-Signature
Format:
key=value; key=value; ... -
Update the secret in Cloudflare: Using Wrangler:
wrangler secret put STRAVA_COOKIES # Paste the cookie string when promptedUsing Cloudflare Dashboard:
- Go to your Worker -> Settings -> Variables and Secrets.
- Add/Edit
STRAVA_COOKIESand paste the cookie string.
You will also need to set your Strava ID (required for personal heatmaps):
wrangler secret put STRAVA_ID
# Enter your numeric Strava athlete IDIf you want to use these heatmaps as a tile layer in another app (like Gaia GPS or Locus Map), here are the template URLs:
- Personal:
https://strava-heatmap-proxy.YOUR_SUBDOMAIN.workers.dev/personal/orange/all/{zoom}/{x}/{y}@2x.png - Global:
https://strava-heatmap-proxy.YOUR_SUBDOMAIN.workers.dev/global/orange/all/{zoom}/{x}/{y}@2x.png
Check https://strava-heatmap-proxy.YOUR_SUBDOMAIN.workers.dev/ for a full list of supported tile colors, activities, and sizes.
The _strava4_session cookie typically lasts a long time (weeks/months/year).
- If using the Userscript: Just visit Strava.com occasionally while logged in. The script will detect if cookies have changed and update the Worker.
- If using Manual: If your maps stop loading (401/403 errors), repeat the Manual Configuration steps to get fresh cookies.