PHPackages                             ethical-jobs/sdk-php - 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. ethical-jobs/sdk-php

ActiveLibrary[API Development](/categories/api)

ethical-jobs/sdk-php
====================

EthicalJobs API client and SDK

v8.0.2(2y ago)038.0k[2 PRs](https://github.com/ethical-jobs/sdk-php/pulls)MITPHPPHP ~8.0

Since May 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ethical-jobs/sdk-php)[ Packagist](https://packagist.org/packages/ethical-jobs/sdk-php)[ RSS](/packages/ethical-jobs-sdk-php/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (6)Versions (47)Used By (0)

Deprecation warning
-------------------

[](#deprecation-warning)

All current EJ packages will be taken offline by mid-2021 in order to re-released under a single package.

Compatibility
-------------

[](#compatibility)

- `v8.*` - Laravel 8 or higher, PHP &gt;8.x,&lt;9.x
- `v4.*` - Laravel 8 or higher, PHP 7.3
- `v3.*` - Laravel 7 or lower (possibly only 5.6 to 5.9)

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

[](#installation)

`composer require ethical-jobs/@ethical-jobs/sdk`

For Laravel &lt; `5.5.x` include the service provider and facade in you `config/app.php` file `EthicalJobs\SDK\Laravel\ServiceProvider::class`, `'EthicalJobs' => EthicalJobs\SDK\Laravel\ApiFacade::class,`. For Laravel &gt;= `5.5.x` the package will auto-include the service provider and facade.

Authentication
--------------

[](#authentication)

You will need to set 4 environment variables to enable authentication:

```
{
    "AUTH_CLIENT_ID": "The client id of the oauth grant",
    "AUTH_CLIENT_SECRET": "The client secret of the oauth grant",
    "AUTH_SERVICE_USERNAME": "Username or email of the user",
    "AUTH_SERVICE_PASSWORD": "Base64 encoded password of the user",
}
```

When using an endpoint that requires authentication you first need to call `EthicalJobs::authenticate()`.

Making Requests
---------------

[](#making-requests)

There are many ways to access api resources, following are some examples:

```
// GET /jobs
EthicalJobs::get('/jobs', ['status' => 'APPROVED']);

// GET /jobs/drafts
EthicalJobs::get('/jobs/drafts', ['status' => 'APPROVED']);

// GET /jobs/214
EthicalJobs::get('/jobs/214');

// GET /jobs { status: APPROVED, expired: false }
EthicalJobs::resource('jobs')->approved();

// GET /jobs { expired: true }
EthicalJobs::resource('jobs')->expired();

// POST /jobs { ... }
EthicalJobs::post('/jobs', ['title' => 'React Developer', 'description' => 'We are looking for...']);
```

Responses
---------

[](#responses)

Responses are returned as `EthicalJobs\SDK\Collection` that extends `Illuminate\Support\Collection`. If there are no results an empty collection is returned. This class has extended methods for selecting nested response items: `$collection->entities('jobs');`. Also there are

Testing and mocking
-------------------

[](#testing-and-mocking)

For easy mocking of SDK responses there exists a response stack helper function on the `ApiClient` or `EthicalJobs` facade. This returns a fully mocked instance of the `ApiClient` that you may inject into the Laravel IOC container or use directly.

For mocking actual SDK responses there are also up-to-date mock JSON responses accessible within `EthicalJobs\SDK\Testing\ResponseFactory`.

```
// Mocking a set of api calls and their responses
$api = ApiClient::mock([
    ResponseFactory::response(204, ResponseFactory::jobs()),
    ResponseFactory::response(201, ResponseFactory::job()),
    ResponseFactory::response(200, ResponseFactory::user()),
]);

// Subsequent calls will return the above responses in order
$jobs = $api->get('/jobs');
$job = $api->get('/job/17263');
$user = $api->get('/user/2827');
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~50 days

Total

41

Last Release

925d ago

Major Versions

v3.1.2 → v4.0.0-alpha12021-03-29

v4.1.1 → v8.0.02022-08-02

v4.1.2 → v8.0.12023-04-19

v3.1.3 → v4.1.32023-10-30

v4.1.3 → v8.0.22023-10-30

PHP version history (3 changes)v1.1.0PHP ^7.0

v4.0.0-alpha1PHP ^7.3

v8.0.0PHP ~8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/311251bff9b30184fcdaa12857975bcd0b7dcd9b409fe37e428bec2a19681f12?d=identicon)[developerdino](/maintainers/developerdino)

![](https://www.gravatar.com/avatar/d2309163519ed0bc5df5b00472f2d9d052d4f6cf207c65bf2885d53b2e6af350?d=identicon)[andrewmclagan](/maintainers/andrewmclagan)

![](https://www.gravatar.com/avatar/9bccd5df1d41f7900b6b75606cada6848606f0559939254ea88adf694266f749?d=identicon)[dev@ej](/maintainers/dev@ej)

---

Top Contributors

[![andrewmclagan](https://avatars.githubusercontent.com/u/1073259?v=4)](https://github.com/andrewmclagan "andrewmclagan (34 commits)")[![00dani](https://avatars.githubusercontent.com/u/610876?v=4)](https://github.com/00dani "00dani (24 commits)")[![mattwithoos](https://avatars.githubusercontent.com/u/5545627?v=4)](https://github.com/mattwithoos "mattwithoos (11 commits)")[![VeryStrongFingers](https://avatars.githubusercontent.com/u/7744427?v=4)](https://github.com/VeryStrongFingers "VeryStrongFingers (8 commits)")[![developerdino](https://avatars.githubusercontent.com/u/747501?v=4)](https://github.com/developerdino "developerdino (6 commits)")[![nasimoyz](https://avatars.githubusercontent.com/u/1500565?v=4)](https://github.com/nasimoyz "nasimoyz (5 commits)")[![ofhope](https://avatars.githubusercontent.com/u/1826459?v=4)](https://github.com/ofhope "ofhope (3 commits)")[![wieartha783](https://avatars.githubusercontent.com/u/97416279?v=4)](https://github.com/wieartha783 "wieartha783 (2 commits)")[![david-ethicaljobs](https://avatars.githubusercontent.com/u/84300645?v=4)](https://github.com/david-ethicaljobs "david-ethicaljobs (2 commits)")[![mbudm](https://avatars.githubusercontent.com/u/2467577?v=4)](https://github.com/mbudm "mbudm (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ethical-jobs-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/ethical-jobs-sdk-php/health.svg)](https://phpackages.com/packages/ethical-jobs-sdk-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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