PHPackages                             preferred-pictures/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. preferred-pictures/client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

preferred-pictures/client
=========================

PreferredPictures PHP client library

v1.0.6(5y ago)05MITPHP

Since Jul 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/preferred-pictures/php)[ Packagist](https://packagist.org/packages/preferred-pictures/client)[ Docs](https://preferred.pictures)[ RSS](/packages/preferred-pictures-client/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

PreferredPictures PHP Client Library
====================================

[](#preferredpictures-php-client-library)

The [PreferredPictures](https://preferred.pictures) PHP library provides a convenient way to call the [PreferredPictures](https://preferred.pictures) API for applications written in PHP.

[View the PHP documentation of this module](https://preferred-pictures.github.io/php/api/classes/PreferredPictures-Client.html)

[View the documentation of the PreferredPicture's API](https://docs.preferred.pictures/api-sdks/api)

[Learn more about what PreferredPictures can do.](https://docs.preferred.pictures/)

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

[](#installation)

```
composer require preferred-pictures/client

```

To use the bindings, use Composer's autoload:

```
require_once('vendor/autoload.php')
```

Usage
-----

[](#usage)

The package needs to be configured with your account's identity and secret key, which is available in the PreferredPictures interface.

```
$client = new PreferredPictures\Client("testidentity", "secret123456");

# Create a basic URL to pick between three different images.
$url = $client->createChooseUrl(
    ["https://www.example.com/image-red.jpg",
     "https://www.example.com/image-green.jpg",
     "https://www.example.com/image-blue.jpg"],
    "test-tournament",
);

# Use a prefix and suffix to make specifying the options less verbose
$url = $client->createChooseUrl(
    ["red", "green", "blue"],
    "test-tournament",
    300,
    6000,
    "https://www.example.com/image-",
    ".jpg"
);

# The url returned will appear to be something like:
#
# https://api.preferred-pictures.com/choose-url?choices=red%2Cgreen%2Cblue&tournament=testing&expiration=[EXPIRATION]&uid=[UNIQUEID]&ttl=600&prefix=https%3A%2F%2Fexample.com%2Fjacket-&suffix=.jpg&identity=test-identity&signature=[SIGNATURE]
#
# which should be placed where it is needed in your application or templates.
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

6

Last Release

2106d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/68354351?v=4)[Preferred Pictures](/maintainers/preferred-pictures)[@preferred-pictures](https://github.com/preferred-pictures)

---

Top Contributors

[![rustyconover](https://avatars.githubusercontent.com/u/731941?v=4)](https://github.com/rustyconover "rustyconover (10 commits)")

---

Tags

ab-testingoptimizationphp-clientphp-librarythompson-sampling

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/preferred-pictures-client/health.svg)

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

###  Alternatives

[palantirnet/drupal-skeleton

A Drupal project template.

141.4k](/packages/palantirnet-drupal-skeleton)

PHPackages © 2026

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