PHPackages                             rokka/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. [Image &amp; Media](/categories/media)
4. /
5. rokka/client

ActiveLibrary[Image &amp; Media](/categories/media)

rokka/client
============

Rokka.io client library

1.21.4(2mo ago)7330.4k↓11.4%9[2 PRs](https://github.com/rokka-io/rokka-client-php/pulls)6MITPHPPHP ^8.0CI passing

Since Mar 18Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/rokka-io/rokka-client-php)[ Packagist](https://packagist.org/packages/rokka/client)[ Docs](https://rokka.io/)[ RSS](/packages/rokka-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (61)Used By (6)

Rokka PHP Client
================

[](#rokka-php-client)

[![Build Status](https://github.com/rokka-io/rokka-client-php/actions/workflows/ci.yml/badge.svg)](https://github.com/rokka-io/rokka-client-php/actions/workflows/ci.yml)[![Static analysis](https://github.com/rokka-io/rokka-client-php/actions/workflows/static.yml/badge.svg)](https://github.com/rokka-io/rokka-client-php/actions/workflows/static.yml)[![Latest Stable Version](https://camo.githubusercontent.com/b81609ee7fc984efa4425a3449c4a0fc7e7c5f33af0d46888fe6d98460280221/68747470733a2f2f706f7365722e707567782e6f72672f726f6b6b612f636c69656e742f76657273696f6e2e706e67)](https://packagist.org/packages/rokka/client)

A [PHP](https://www.php.net/) library to access the API of the [Rokka](https://rokka.io/) image service.

If you are using the Symfony framework, have a look at the [Rokka Symfony Bundle](https://github.com/rokka-io/rokka-client-bundle) which integrates this library into Symfony.

About
-----

[](#about)

[rokka](https://rokka.io) is digital image processing done right. Store, render and deliver images. Easy and blazingly fast. This library allows to upload and manage your image files to rokka and deliver them in the right format, as light and as fast as possible. And you only pay what you use, no upfront and fixed costs.

Free account plans are available. Just install the plugin, register and use it.

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

[](#installation)

Require the library using composer:

`composer require rokka/client`

Bootstrapping
-------------

[](#bootstrapping)

You will need to register for a Rokka.io account and use the API key you receive. The recommended way to do so is by using the [rokka-cli](https://github.com/rokka-io/rokka-client-php-cli/releases).

The `Rokka\Client\Factory` is the entry point for creating the API client.

You then need to set the credentials you created with the cli command.

### User Client

[](#user-client)

The user client is used for user and organization management.

```
use Rokka\Client\Factory;

$apiKey = 'myKey';

$userClient = Factory::getUserClient($organization = null, $apiKey =null, $options = []);
$userClient->setCredentials($apiKey);
```

There is an optional parameter to specify the base URL of the Rokka API. This usually does not need to be adjusted.

### Image Client

[](#image-client)

The image client is used to upload images into an organization and manage rendering stacks.

```
use Rokka\Client\Factory;

$organization = 'testorganization';
$apiKey = 'myKey';

$imageClient = Factory::getImageClient($organization, $apiKey);
```

There is an optional parameter to specify the base URL of the Rokka API. This usually does not need to be adjusted.

### Options for clients

[](#options-for-clients)

You can add an options array as last parameter to Factory::getUserClient`or`Factory::getImageClient`. It takes the following format:

```
[
   Factory::API_BASE_URL => 'https://some-other-api.rokka.io',
   Factory::RENDER_BASE_URL => 'https://myimages.example.com', // you you want/have another render base url
   Factory::PROXY => 'http://proxy:8888', // if you need to use a proxy
   Factory::GUZZLE_OPTIONS => ['verify' => false] // any guzzle option you need/want
]
```

Usage
-----

[](#usage)

Read the [Getting Started](https://rokka.io/documentation/guides/get-started.html) guide of the [rokka.io documentation](https://rokka.io/documentation) to learn about the basic concepts of rokka.

The image and user clients provide the operations described in the API Reference section of the rokka documentation.

See als the [API Docs](https://rokka.io/client-php-api/master/) for further information.

Running tests
-------------

[](#running-tests)

Run `vendor/bin/phpunit` in the project root.

Running PHP-CS-Fixer
--------------------

[](#running-php-cs-fixer)

```
composer run lint:fix

```

Running phpstan
---------------

[](#running-phpstan)

```
composer run phpstan

```

Running PHP compatibility check
-------------------------------

[](#running-php-compatibility-check)

```
composer run phpcompatibility

```

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity42

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 77.6% 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 ~72 days

Recently: every ~176 days

Total

51

Last Release

87d ago

Major Versions

0.10.0 → 1.0.02017-11-04

PHP version history (11 changes)0.2.0PHP &gt;=5.5.0

0.5.0PHP ^5.5 || ^7.0

0.9.0PHP ^5.6 || ^7.0

1.2.0PHP ^5.6|^7.0

1.11.0PHP ^7.0

1.12.0PHP &gt;=7.0

1.13.2PHP &gt;=7.1

1.14.0PHP ^7.1|^8.0

1.18.0PHP ^7.2|^8.0

1.20.0PHP ^7.3|^8.0

1.21.0PHP ^8.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/803a02308898d7176ad6601cc9f1bc9b057a725d5b35f6c0c54995b02a97a977?d=identicon)[rokka](/maintainers/rokka)

![](https://www.gravatar.com/avatar/04293348c41a664329fc652b5885ec3c073e8cca5ab159312eab2a6e8983bcd5?d=identicon)[chregu](/maintainers/chregu)

---

Top Contributors

[![chregu](https://avatars.githubusercontent.com/u/47106?v=4)](https://github.com/chregu "chregu (298 commits)")[![dbu](https://avatars.githubusercontent.com/u/76576?v=4)](https://github.com/dbu "dbu (29 commits)")[![ChristianRiesen](https://avatars.githubusercontent.com/u/1446701?v=4)](https://github.com/ChristianRiesen "ChristianRiesen (23 commits)")[![thePanz](https://avatars.githubusercontent.com/u/226021?v=4)](https://github.com/thePanz "thePanz (15 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (6 commits)")[![pfrenssen](https://avatars.githubusercontent.com/u/442924?v=4)](https://github.com/pfrenssen "pfrenssen (3 commits)")[![michellesanver](https://avatars.githubusercontent.com/u/570982?v=4)](https://github.com/michellesanver "michellesanver (2 commits)")[![williamdes](https://avatars.githubusercontent.com/u/7784660?v=4)](https://github.com/williamdes "williamdes (2 commits)")[![pixelplan-digitalweb](https://avatars.githubusercontent.com/u/77323795?v=4)](https://github.com/pixelplan-digitalweb "pixelplan-digitalweb (2 commits)")[![mms-uret](https://avatars.githubusercontent.com/u/900354?v=4)](https://github.com/mms-uret "mms-uret (1 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (1 commits)")[![bellisk](https://avatars.githubusercontent.com/u/903490?v=4)](https://github.com/bellisk "bellisk (1 commits)")[![pascalvb](https://avatars.githubusercontent.com/u/261884?v=4)](https://github.com/pascalvb "pascalvb (1 commits)")

---

Tags

processingresizeimagespicturesoptimizationcdntranscodingcroppingrokka

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[cloudinary/cloudinary_php

Cloudinary PHP SDK

39913.5M90](/packages/cloudinary-cloudinary-php)[jbzoo/image

A PHP class that simplifies working with images

171126.9k3](/packages/jbzoo-image)[wp-media/imagify-plugin

Image optimization plugin for WordPress by WP Media.

7960.9k](/packages/wp-media-imagify-plugin)[ace-of-aces/laravel-image-transform-url

Easy, URL-based image transformations inspired by Cloudflare Images.

1756.4k](/packages/ace-of-aces-laravel-image-transform-url)[ayvazyan10/nova-imagic

Imagic is a Laravel Nova field package that allows for image manipulation capabilities, such as cropping, resizing, quality adjustment, and WebP conversion. It utilizes the powerful Intervention Image class for image manipulation.

144.3k1](/packages/ayvazyan10-nova-imagic)[craffft/contao-photoalbums2

Photoalbums2 for Contao OpenSource CMS

121.2k1](/packages/craffft-contao-photoalbums2)

PHPackages © 2026

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