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

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

getjoystick/joystick-php
========================

Joystick is a modern remote configuration and dynamic content service designed specifically for operating apps and games. Upgrade to more agility and evolve your product faster. Change or hot-update your content and configurations instantly at scale without code. Segment, ab test, feature flag, schedule events and more. Joystick is a breeze to use yet powerful.

v0.1.0(3y ago)21.2k[2 issues](https://github.com/getjoystick/joystick-php/issues)[1 PRs](https://github.com/getjoystick/joystick-php/pulls)MITPHPPHP &gt;=7.2

Since Mar 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/getjoystick/joystick-php)[ Packagist](https://packagist.org/packages/getjoystick/joystick-php)[ Docs](https://github.com/getjoystick/joystick-php)[ RSS](/packages/getjoystick-joystick-php/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (11)Versions (8)Used By (0)

PHP client for [Joystick](https://www.getjoystick.com/)
=======================================================

[](#php-client-for-joystick)

[![GitHub Actions](https://github.com/getjoystick/joystick-php/actions/workflows/main.yml/badge.svg)](https://github.com/getjoystick/joystick-php/actions/workflows/main.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/4e7fec67603dd78ce91f2879ccadfd9f60a926dfe6464eb31a011f3e23a8ecd2/68747470733a2f2f706f7365722e707567782e6f72672f6765746a6f79737469636b2f6a6f79737469636b2d7068702f762f737461626c652e737667)](https://packagist.org/packages/getjoystick/joystick-php)[![Total Downloads](https://camo.githubusercontent.com/a7c113c6c2ced30ada23f15d36ee99767726cd0b8287f81d0036e81af68a0282/68747470733a2f2f706f7365722e707567782e6f72672f6765746a6f79737469636b2f6a6f79737469636b2d7068702f646f776e6c6f6164732e737667)](https://packagist.org/packages/getjoystick/joystick-php)[![License](https://camo.githubusercontent.com/ce9db48181f0d8a6147d952fdce2c5b010fc53d4d525c96ad60a17f123fefc5a/68747470733a2f2f706f7365722e707567782e6f72672f6765746a6f79737469636b2f6a6f79737469636b2d7068702f6c6963656e73652e737667)](https://packagist.org/packages/getjoystick/joystick-php)

This is the library that simplifies the way how you can communicate with [Joystick API](https://docs.getjoystick.com/).

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

[](#requirements)

PHP 7.2 and later

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

[](#installation)

You can install the package via [Composer](http://getcomposer.org/):

```
composer require getjoystick/joystick-php
```

We will try to find the PSR-18 compatible HTTP client within your dependencies using [`php-http/discovery`](https://docs.php-http.org/en/latest/discovery.html), if you don't have one installed, just run this command to install [Guzzle HTTP client](https://docs.guzzlephp.org/en/stable/):

```
composer require guzzlehttp/guzzle
```

Usage
-----

[](#usage)

To use the client, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once 'vendor/autoload.php';
```

Simple usage looks like this:

```
$config = \Joystick\ClientConfig::create()->setApiKey(getenv('JOYSTICK_API_KEY'));

$client = \Joystick\Client::create($config);

$getContentsResponse = $client->getContents(['content-id1', 'content-id2']);

$getContentsResponse->myProperty1
$getContentsResponse->myProperty2
```

### Requesting Content by single Content Id

[](#requesting-content-by-single-content-id)

```
$getContentResponse = $client->getContent('content-id1');
$getContentResponse->myProperty1
```

### Specifying additional parameters:

[](#specifying-additional-parameters)

When creating the `ClientConfig` object, you can specify additional parameters which will be used by all API calls from the client, for more details see [API documentation](https://docs.getjoystick.com/api-reference/):

```
$config = \Joystick\ClientConfig::create()
    ->setApiKey(getenv('JOYSTICK_API_KEY'))
    ->setCacheExpirationSeconds(600) // 10 mins
    ->setSerialized(true)
    ->setParams([
        'param1' => 'value1',
        'param2' => 'value2',
     ])
     ->setSemVer('0.0.1')
     ->setUserId('user-id-1');
```

### Options

[](#options)

#### `fullResponse`

[](#fullresponse)

In most of the cases you will be not interested in the full response from the API, but if you're you can specify `fullResponse` option to the client methods. The client will return you raw API response:

```
$getContentResponse = $client->getContent('content-id1', ['fullResponse' => true]);
// OR
$getContentsResponse = $client->getContents(['content-id1', 'content-id2'], ['fullResponse' => true]);
```

#### `serialized`

[](#serialized)

When `true`, we will pass query parameter `responseType=serialized`to [Joystick API](https://docs.getjoystick.com/api-reference-combine/).

```
$getContentResponse = $client->getContent('content-id1', ['serialized' => true]);
// OR
$getContentsResponse = $client->getContents(['content-id1', 'content-id2'], ['serialized' => true]);
```

#### `refresh`

[](#refresh)

If you want to ignore existing cache and request the new config – pass this option as `true`.

```
$getContentResponse = $client->getContent('content-id1', ['refresh' => true]);
// OR
$getContentsResponse = $client->getContents(['content-id1', 'content-id2'], ['refresh' => true]);
```

This option can be set for every API call from the client by setting `setSerialized(true)`:

```
$config = \Joystick\ClientConfig::create()
    ->setApiKey(getenv('JOYSTICK_API_KEY'))
    ->setSerialized(true)
```

### Caching

[](#caching)

By default, the client uses [array caching](https://packagist.org/packages/cache/array-adapter), which means that if you build the HTTP application where each process exits after the request has been processed – the cache will be erased after the process is finished.

You can specify your [cache implementation which conforms PSR-16](https://packagist.org/providers/psr/simple-cache-implementation).

See [`examples/file-cache`](./examples/file-cache) for more details.

#### Clear the cache

[](#clear-the-cache)

If you want to clear the cache – run `$client->clearCache()`.

> Note that we will call `clear()` on the PSR-16 interface. Make sure that you use different cache instances in different places of your app

### HTTP Client

[](#http-client)

If you want to provide custom HTTP client, which may be useful for use-cases like specifying custom proxy, collecting detailed metrics about HTTP requests,

You can specify your [HTTP client implementation which conforms PSR-18](https://packagist.org/providers/psr/simple-cache-implementation).

See [`examples/custom-http-client`](./examples/custom-http-client) for more details.

Testing
-------

[](#testing)

To run unit tests, just run:

```
phpunit
```

### Security

[](#security)

If you discover any security related issues, please email [letsgo@getjoystick.com](letsgo@getjoystick.com)instead of using the issue tracker.

Credits
-------

[](#credits)

- [Joystick](https://github.com/getjoystick)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT. Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance9

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

3

Last Release

1208d ago

### Community

Maintainers

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

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

---

Tags

json-apijson-configjson-configurationjson-serverphp-jsonremote-configremote-configurationfeature flaggingsegmentationab-testingremote configurationdynamic contentremote configslive-opsgame opsdynamic jsonupdate jsonremote json

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/getjoystick-joystick-php/health.svg)

```
[![Health](https://phpackages.com/badges/getjoystick-joystick-php/health.svg)](https://phpackages.com/packages/getjoystick-joystick-php)
```

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)[anthropic-ai/sdk

Anthropic PHP SDK

163583.3k17](/packages/anthropic-ai-sdk)[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[sylius/sylius

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

8.5k5.9M737](/packages/sylius-sylius)

PHPackages © 2026

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