PHPackages                             kaibotan/strava-login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. kaibotan/strava-login

Abandoned → [codetoad/strava](/?search=codetoad%2Fstrava)ArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

kaibotan/strava-login
=====================

A package that uses the Strava api to login, and has basic get and post requests. For laravel

1211[1 issues](https://github.com/KaiBotan/strava-login/issues)PHP

Since Jan 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/KaiBotan/strava-login)[ Packagist](https://packagist.org/packages/kaibotan/strava-login)[ RSS](/packages/kaibotan-strava-login/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Strava Login and Calls
----------------------

[](#strava-login-and-calls)

This package helps you to easily login your Strava account, and access the API. To use this package you will need to make a Strava app for more info checkout the documentation of the Strava API

Installation
------------

[](#installation)

Require this package with composer. It is recommended to only require the package for development.

```
composer require KaiBotan/strava-login
```

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Don't forget to edit your .env file with your Strava app values.

```
STRAVA_KEY=yourkeyfortheservice
STRAVA_SECRET=yoursecretfortheservice
STRAVA_REDIRECT_URI=https://example.com/login
```

### Laravel 5.5+:

[](#laravel-55)

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

```
KjellKnapen\Strava\StravaServiceProvider::class,
```

If you want to use the facade to log messages, add this to your facades in app.php:

```
'Strava' => KjellKnapen\Strava\StravaFacade::class,
```

Usage
-----

[](#usage)

### Login user

[](#login-user)

```
Strava::redirect(); //redirects user to Strava to login
```

You will then be redirected to the url you put in your .env file. Let's say its The url will have code you can use to send with the tokenexchange and get the user in return.

```
$code = request()->code;

// Send code to strava to request token en get user
$result = Strava::tokenExchange($code);
```

now you can go and save the user.

### Post

[](#post)

The post method takes 2 variables, $url &amp; $config. The url will be the api url you need to post to, like  to upload a activity. If we look at the documentation we see we need to send some headers and fields with the request, so our code would look something like this.

```
$url = 'https://www.strava.com/api/v3/activities';

// the token for the header was given to you when Strava returned the user. Make sure you save it in the database per user.
$config = [
    'headers' => [
        'Authorization' => 'Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9'
    ],
    'form_params' => [
        "name" => "Most Epic Ride EVER!!!"
        "elapsed_time" => 18373
        "distance" => 1557840
        "start_date_local" => "2013-10-23T10:02:13Z"
        "type" => "Ride"
    ]
];
$res = Strava::post($url, $config);

return $res;
```

### Get

[](#get)

The get method is similar to the post method and takes 2 variables, $url &amp; $config. The url will be the api url you need to get, like  to upload a activity. For the get method we wil only need to put a header in our config for authentification

```
$url = 'https://www.strava.com/api/v3/athlete/activities';

// the token for the header was given to you when Strava returned the user. Make sure you save it in the database per user.
$config = [
    'headers' => [
        'Authorization' => 'Bearer 83ebeabdec09f6670863766f792ead24d61fe3f9'
    ],
];
$res = Strava::get($url, $config);

return $res;
```

If there are any questions be sure to ask. More options like PUT will be added in the future

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13765389?v=4)[Kjell](/maintainers/kjellknapen)[@kjellknapen](https://github.com/kjellknapen)

### Embed Badge

![Health badge](/badges/kaibotan-strava-login/health.svg)

```
[![Health](https://phpackages.com/badges/kaibotan-strava-login/health.svg)](https://phpackages.com/packages/kaibotan-strava-login)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
