This example app demonstrates Strava's 3-legged OAuth2 flow and displays basic profile information.
Project built with:
- TypeScript
- Koa
- Simple OAuth2
This project has been deployed on Render.
Fork or Clone this repository to your local development environement
cd strava-typescript-koa
npm install
Go to Strava.com to create your account. You will need to be a paying member to builid using Strava's API.
Go to your My Application API in your profile settings.
You'll find your client id and secret, which you'll use in the next section.
Before you leave, set the authorization callback domain to localhost:3000
Rename the file env.example
to .env
Copy and paste your client id and client secret into the .env
file.
CLIENT_ID="YOUR_STRAVA_CLIENT_ID"
CLIENT_SECRET="YOUR_STRAVA_CLIENT_SECRET"
REDIRECT_URI="http://localhost:3000/callback"
npm run build
npm run start
Open your browser to
http://localhost:3000
If everything went according to plan, you should see a Connect to Strava link. Click it, an authorize access to your Strava account. Upon successfully connecting, click Get My Profile to see some basic profile information.