PHPackages                             chrismou/dexcom-socialite-provider - 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. chrismou/dexcom-socialite-provider

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

chrismou/dexcom-socialite-provider
==================================

Dexcom provider for Laravel Socialite

v1.0.1(7mo ago)077MITPHPPHP ^8.1

Since Sep 26Pushed 7mo agoCompare

[ Source](https://github.com/chrismou/dexcom-socialite-provider)[ Packagist](https://packagist.org/packages/chrismou/dexcom-socialite-provider)[ RSS](/packages/chrismou-dexcom-socialite-provider/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Dexcom provider for Laravel Socialite
=====================================

[](#dexcom-provider-for-laravel-socialite)

```
composer require chrismou/dexcom-socialite-provider
```

Installation &amp; Basic Usage
------------------------------

[](#installation--basic-usage)

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

[](#add-configuration-to-configservicesphp)

Register your app at , then add the relevant credentials to your `.env` file (see below). Once this done, add the following to your `config/services` file.

```
'dexcom' => [
  'client_id' => env('DEXCOM_CLIENT_ID'),
  'client_secret' => env('DEXCOM_CLIENT_SECRET'),
  'redirect' => env('DEXCOM_REDIRECT_URI'),
  'mode' => env('DEXCOM_MODE', 'sandbox'), // 'us', 'eu', jp' or 'sandbox'
],
```

The `mode` can be one of `us`, `eu`, `jp` or `sandbox` (default is `sandbox`). You'll need to develop with the sandbox initially, but when you switch to using production data you'll need to change this to the appropriate region - `us` if in America, `jp` for Japan or `eu` for the rest of the world.

### Add provider event listener

[](#add-provider-event-listener)

#### Laravel 11+

[](#laravel-11)

In Laravel 11, the default `EventServiceProvider` provider was removed. Instead, add the listener using the `listen` method on the `Event` facade, in your `AppServiceProvider` `boot` method.

- Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.

```
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('dexcom', \SocialiteProviders\Dexcom\src\Provider::class);
});
```

Laravel 10 or below Configure the package's listener to listen for `SocialiteWasCalled` events. Add the event to your `listen[]` array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.

```
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Dexcom\DexcomExtendSocialite::class.'@handle',
    ],
];
```

### Usage example

[](#usage-example)

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed), ie:

```
Route::get('/auth/dexcom', function () {
    return Socialite::driver('dexcom')->redirect();
});
```

Assuming you registered /auth/callback as your redirect URL, you can handle the callback like so:

```
Route::get('/auth/callback', function () {
    $dexcomUser = Socialite::driver('dexcom')->user();
    $user = User::updateOrCreate([
        'dexcom_user_id' => $dexcomUser->id,
    ], [
        'dexcom_access_token' => $dexcomUser->token,
        'dexcom_refresh_token' => $dexcomUser->refreshToken,
    ]);

    Auth::login($user, true);

    return redirect()->intended('/dashboard');
});
```

Now you should have a user logged in with their Dexcom account, and an access/refresh token available for API requests

```
Route::get('/dashboard', function () {
    $user = Auth::user();

    $client = new \GuzzleHttp\Client\Client();
    $request = $client->request('GET', Socialite::driver('dexcom')->getApiUrl() . '/v3/users/self/egvs', [
        'query' => [
            'startDate' => now()->subDay()->format('Y-m-d\TH:i:s'),
            'endDate' => now()->format('Y-m-d\TH:i:s'),
        ],
        'headers' => [
            'Authorization' => 'Bearer ' . $user->dexcom_access_token,
            'Accept' => 'application/json',
        ]
    ]);

    var_dump(json_decode($request->getBody()->getContents());
    exit;

})->middleware('auth');
```

The above example assumes you've added the following fields to your `users` table:

```
$table->string('dexcom_user_id')->unique();
$table->string('dexcom_access_token', 1000)->nullable();
$table->string('dexcom_refresh_token')->nullable();
```

### Returned User fields

[](#returned-user-fields)

The Dexcom API doesn't provide a user endpoint so the user ID is retrieved by a call to the `devices` endpoint. Therefore, the only fields returned are `id`, which should at least be enough to ensure the you can match the dexcom to a laravel user.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance64

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~7 days

Total

2

Last Release

220d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.0.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/98e0798db43673fb89fe589cbb45fb4c6547d3bdbe76d7efa30d96f24ffc677e?d=identicon)[chrismou](/maintainers/chrismou)

---

Top Contributors

[![chrismou](https://avatars.githubusercontent.com/u/319883?v=4)](https://github.com/chrismou "chrismou (5 commits)")

---

Tags

laravelprovideroauthsocialitedexcom

### Embed Badge

![Health badge](/badges/chrismou-dexcom-socialite-provider/health.svg)

```
[![Health](https://phpackages.com/badges/chrismou-dexcom-socialite-provider/health.svg)](https://phpackages.com/packages/chrismou-dexcom-socialite-provider)
```

###  Alternatives

[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

326.1M13](/packages/socialiteproviders-microsoft)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

421.9M5](/packages/socialiteproviders-instagram)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

2073.7k](/packages/kovah-laravel-socialite-oidc)[socialiteproviders/kakao

Kakao OAuth2 Provider for Laravel Socialite

10484.7k4](/packages/socialiteproviders-kakao)

PHPackages © 2026

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