{"id":17420050,"url":"https://github.com/bendrucker/scriptable-strava-oauth","last_synced_at":"2025-03-21T22:28:31.344Z","repository":{"id":65992472,"uuid":"398958393","full_name":"bendrucker/scriptable-strava-oauth","owner":"bendrucker","description":"Scriptable (iOS) script for obtaining a Strava API token","archived":false,"fork":false,"pushed_at":"2021-08-23T03:32:40.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T22:03:49.987Z","etag":null,"topics":["ios","scriptable","strava"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendrucker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-23T03:08:18.000Z","updated_at":"2023-12-20T19:19:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9be8acc-cdb1-46af-9ab7-8cd46fb69f18","html_url":"https://github.com/bendrucker/scriptable-strava-oauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fscriptable-strava-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fscriptable-strava-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fscriptable-strava-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fscriptable-strava-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/scriptable-strava-oauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244878284,"owners_count":20525185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","scriptable","strava"],"created_at":"2024-10-17T02:39:40.133Z","updated_at":"2025-03-21T22:28:31.315Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","readme":"# Strava OAuth for [Scriptable](https://scriptable.app)\n\n\u003e Scriptable (iOS) script for obtaining a Strava API token\n\n## Setup\n\n1. [Register a new Strava API application](https://developers.strava.com/docs/getting-started/#account). Set the _Authorization Callback Domain_ to `open.scriptable.app`.\n2. Add the [script](strava-oauth.js) to Scriptable.\n3. Run the script and input your client ID and secret.\n4. Authenticate in the presented Safari window and authorize your API application to access your account data.\n\nUpon successful authorization, Strava will redirect to a Scriptable URL, re-triggering the script and passing an authorization code in a query parameter. The script will use your client secret and the code to obtain a token object, which will be saved as JSON to the keychain (key: `strava`).\n\n## Usage\n\nFrom other scripts, you can load the `strava` authentication data from the keychain and include it in requests to the Strava API:\n\n```js\nconst token = JSON.parse(Keychain.get('strava'))\n\nconst req = new Request('https://www.strava.com/api/v3/athlete/activities')\nreq.headers.authorization = `Bearer ${token.access_token}`\n\nconst activities = await req.loadJSON()\n// ...\n```\n\nNote that access tokens expire frequently so you will likely want to use the refresh token to obtain a new access token first.\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fscriptable-strava-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Fscriptable-strava-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fscriptable-strava-oauth/lists"}