PHPackages                             petersons/d2l-client - 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. [API Development](/categories/api)
4. /
5. petersons/d2l-client

ActiveLibrary[API Development](/categories/api)

petersons/d2l-client
====================

Client implementation for connecting to Brightspace/D2L APIs.

v0.17.0(2mo ago)35.7k↑120%1MITPHPPHP ^8.4CI passing

Since Oct 21Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/petersons/d2l-client)[ Packagist](https://packagist.org/packages/petersons/d2l-client)[ RSS](/packages/petersons-d2l-client/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (24)Versions (23)Used By (0)

Petersons D2L API client
========================

[](#petersons-d2l-api-client)

[![Build Status](https://github.com/petersons/d2l-client/workflows/Tests/badge.svg?branch=main)](https://github.com/petersons/d2l-client/actions)[![codecov](https://camo.githubusercontent.com/f100884bafd62d3794e5f92f0127664429025fc9dc65c57a485c75a690d79e91/68747470733a2f2f636f6465636f762e696f2f67682f7065746572736f6e732f64326c2d636c69656e742f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d43564f51323348314745)](https://codecov.io/gh/petersons/d2l-client)

Status
------

[](#status)

This package is currently in active development.

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

[](#installation)

1. Require the package using Composer:

```
composer require petersons/d2l-client
```

Features
--------

[](#features)

- Provides a PHP HTTP client to communicate with D2L APIs
- Provides integration with Laravel

Requirements
------------

[](#requirements)

- [PHP 8.4](https://www.php.net/releases/8.4/en.php) or greater

Usage example
-------------

[](#usage-example)

```
use Petersons\D2L\AuthenticatedUriFactory;
use Petersons\D2L\DTO\Enrollment\CreateEnrollment;
use Petersons\D2L\SymfonyHttpClient;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\ScopingHttpClient;

$client = new SymfonyHttpClient(
            ScopingHttpClient::forBaseUri(
                HttpClient::create(),
                'https://petersonstest.brightspace.com',
            ),
            new AuthenticatedUriFactory(
                'https://petersonstest.brightspace.com',
                'appId',
                'appKey',
                'lmsUserId',
                'lmsUserKey',
            ),
            'orgId',
            'installationCode',
            'pKey',
            'apiLpVersion', // e.g. 1.30
            'apiLeVersion', // e.g. 1.53
        );

$client->enrollUser(new CreateEnrollment(1, 2, 3));
```

Laravel integration
-------------------

[](#laravel-integration)

You may publish the configuration file using the vendor:publish Artisan command:

```
php artisan vendor:publish --tag=d2l-config
```

After setting up all the needed config env variables you can typehint the `\Petersons\D2L\Contracts\ClientInterface` interface via the constructor of your service and start using it.

Local development
-----------------

[](#local-development)

Docker dependencies for local development:

- [Docker Engine](https://docs.docker.com/engine/) &gt;= 19.03
- [Docker Compose](https://docs.docker.com/compose/) &gt;= 2.0

1. Clone project

    ```
    git clone git@github.com:petersons/d2l-client.git
    ```
2. Build the Docker image

    ```
    dev/bin/docker-compose build --build-arg PHP_VERSION=8.4 php
    ```
3. Install library dependencies

    ```
    dev/bin/php composer update
    ```
4. Running all tests with Xdebug debugging disabled

    ```
    dev/bin/php-test vendor/bin/phpunit
    ```
5. Running all tests with Xdebug debugging enabled

    ```
    dev/bin/php-debug vendor/bin/phpunit
    ```
6. Running linter

    ```
    dev/bin/php-test vendor/bin/php-cs-fixer fix
    ```
7. Clear Docker volumes

    ```
    dev/bin/docker-compose down --volumes
    ```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance83

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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 ~90 days

Recently: every ~12 days

Total

19

Last Release

87d ago

PHP version history (4 changes)v0.1.0PHP ^8.0

v0.10.0PHP ^8.1

v0.12.0PHP ^8.2

v0.14.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/01d9a41b7be255dcaa36edb32ff73f97d595f0a02fe3a5cde0150bd50c488906?d=identicon)[X-Coder264](/maintainers/X-Coder264)

---

Top Contributors

[![X-Coder264](https://avatars.githubusercontent.com/u/12602463?v=4)](https://github.com/X-Coder264 "X-Coder264 (64 commits)")[![kmaric69](https://avatars.githubusercontent.com/u/11028407?v=4)](https://github.com/kmaric69 "kmaric69 (2 commits)")[![antsunji](https://avatars.githubusercontent.com/u/3345385?v=4)](https://github.com/antsunji "antsunji (1 commits)")[![jolezg](https://avatars.githubusercontent.com/u/1141118?v=4)](https://github.com/jolezg "jolezg (1 commits)")

---

Tags

d2lBrightspace

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/petersons-d2l-client/health.svg)

```
[![Health](https://phpackages.com/badges/petersons-d2l-client/health.svg)](https://phpackages.com/packages/petersons-d2l-client)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[illuminate/filesystem

The Illuminate Filesystem package.

16165.1M3.2k](/packages/illuminate-filesystem)[illuminate/view

The Illuminate View package.

13047.0M2.2k](/packages/illuminate-view)

PHPackages © 2026

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