PHPackages                             terminal42/rokka-io-api-platform-bridge - 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. terminal42/rokka-io-api-platform-bridge

ActiveSymfony-bundle[API Development](/categories/api)

terminal42/rokka-io-api-platform-bridge
=======================================

Provides collection and item providers, data persisters and more to easily integrate ApiPlatform and rokka.io

1.1.1(3y ago)21.0kMITPHPPHP ^7.1 || ^8.0CI failing

Since Jan 4Pushed 3y ago3 watchersCompare

[ Source](https://github.com/terminal42/rokka-io-api-platform-bridge)[ Packagist](https://packagist.org/packages/terminal42/rokka-io-api-platform-bridge)[ RSS](/packages/terminal42-rokka-io-api-platform-bridge/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (14)Versions (9)Used By (0)

rokka.io - ApiPlatform Bridge
=============================

[](#rokkaio---apiplatform-bridge)

Seamlessly integrates your [rokka.io](https://rokka.io/) account with [ApiPlatform](https://api-platform.com/).

[![Screenshot](docs/screenshot.png)](docs/screenshot.png)

Why?
----

[](#why)

Why would you bridge an API that is already an API? These are the main reasons:

- Using the bundle, you can hide the API key of rokka.io behind your already existing API.
- You can use the same authentication mechanism that already protects your API to also protect rokka.io image handling.
- It automatically updates the Swagger docs of your API based on the docs of rokka.io so it's always up to date.
- It brings a consistent feeling to the developers using your API.

It works by simply bridging all the requests you make to your API to rokka.io by using the same path and enhancing it with the authorization header for rokka.io. By default it does that using the `/rokka` bridge endpoint but this can be configured.

Example: Let's say you want to create a new source image. In rokka.io that would be a `POST` request to `/sourceimages/{organization}`. So instead of sending a `POST` request to `https://api.rokka.io/sourceimages/{organization}` you would send a `POST` request to `https://myapi.com/rokka/sourceimages/{organization}`.

Because you never want to expose the whole API for rokka.io (otherwise one could also modify your account), the allowed endpoints have to be configured (see `Configuration` section). Thus you can bridge any endpoint you like. The cool thing with this concept is that if you wanted to allow some users to modify your account, you can enable this endpoint and protect it using your authentication mechanisms very easily.

Also, you can omit the whole `{organization}` part by configuring a `default_organization`, it will automatically use this one whenever you request anything.

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

[](#installation)

1. Use [Composer](https://getcomposer.org/) and run

    ```
    $ composer require terminal42/rokka-io-api-platform-bridge

    ```

    **Important:** This bundle uses [HTTPlug](http://httplug.io/) to decouple from any specific HTTP client. This means that if you already use one of the available clients, it will simply re-use this one. If you haven't got any client yet, you have to choose one and install these first (or at the same time). E.g. if you want to use `Guzzle`, install the bundle like so:

    ```
    $ composer require terminal42/rokka-io-api-platform-bridge php-http/guzzle6-adapter php-http/message

    ```
2. Configure the [rokka.io Symfony Bundle as documented in their docs](https://github.com/rokka-io/rokka-client-bundle#configuration).
3. Load the bundle in your kernel which is done automatically if you use Symfony Flex, otherwise use

    ```
    $bundles = [
        ...
        new Terminal42\RokkaApiPlatformBridge\RokkaApiPlatformBridgeBundle(),
    ];
    ```
4. Add the route loader of this bundle to your routing configuration:

    ```
    # config/routes.yaml (or if you're still on SF 3: app/routing.yml)
    rokka_api_platform_bridge:
        resource: .
        type: rokka_api_platform_bridge
    ```
5. Configure this bundle as shown in the `Configuration` section.

Configuration
-------------

[](#configuration)

```
# config/rokka_api_platform_bridge.yaml
rokka_api_platform_bridge:
    api_key: '' # Required
    bridge_endpoint: '/images' # Default: '/rokka'
    default_organization: ~ # Default: null
    http_client: ~ # Default: null
    endpoints:
        - { path: '/sourceimages/{organization}', methods: ['POST'] }
        - // etc.
```

Custom Http Client
------------------

[](#custom-http-client)

You can pass a service id via `rokka_api_platform_bridge.http_client` which must be an instance of the PSR `Http\Client\HttpClient`. Thanks to this you can create your own instance that implements logging etc. or even reuse existing Symfony bundles such as the very popular [eightpoints/guzzle-bundle](https://github.com/8p/EightPointsGuzzleBundle). You only need to wrap the Guzzle client with the PSR compatible adapter you get using `php-http/guzzle6-adapter`. You can then configure the Guzzle service like so:

```
# config/eight_points_guzzle.yaml
eight_points_guzzle:
    logging: true
    profiling: true
        rokka_api_platform_bridge: ~

# config/rokka_api_platform_bridge.yaml
rokka_api_platform_bridge:
    http_client: 'app.my_rokka_api_platform_bridge_service'

# config/services.yaml
app.my_rokka_api_platform_bridge_service:
    class: Http\Adapter\Guzzle6\Client
    arguments: ['@eight_points_guzzle.client.rokka_api_platform_bridge']
```

Roadmap / Ideas
---------------

[](#roadmap--ideas)

- Thumbnail endpoint to hide the rokka.io URL?
- Your ideas?

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity71

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

Recently: every ~271 days

Total

8

Last Release

1383d ago

PHP version history (2 changes)1.0.0PHP ^7.1

1.1.0PHP ^7.1 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/481937?v=4)[Yanick Witschi](/maintainers/Toflar)[@Toflar](https://github.com/Toflar)

---

Top Contributors

[![Toflar](https://avatars.githubusercontent.com/u/481937?v=4)](https://github.com/Toflar "Toflar (27 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/terminal42-rokka-io-api-platform-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/terminal42-rokka-io-api-platform-bridge/health.svg)](https://phpackages.com/packages/terminal42-rokka-io-api-platform-bridge)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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