Skip to main content
The PHP SDK is published to Packagist and to the Westyx GitLab Composer registry. Installing from Packagist needs no repository configuration.

Install

Pin a specific version (recommended for production services):

Installing from the GitLab Composer registry

To resolve the package from the Westyx registry instead of Packagist, add it to your composer.json before installing:
Add the autoload import to your bootstrap:

Requirements

  • PHP 8.3 or newer. The SDK is tested against 8.3, 8.4 and 8.5 on every commit.
  • Composer 2 - Composer 1 is not tested and is no longer supported upstream
  • A PSR-18 HTTP client and PSR-17 factories (see below)
  • Network access to <your-slug>.westyx.dev at runtime

HTTP client

The SDK depends on the PSR interfaces rather than on a concrete client, so it uses whichever HTTP stack your project already has - and does not install a second one alongside it. Most projects already have one. If yours does not, either of these works:
php-http/discovery locates the installed implementation automatically. You can also pass your own client and factories to NexusClient::create() - see HTTP client.

What gets installed

Installing westyx/nexus brings 6 packages, about 1 MB:

Optional

Full composer.json example

Verifying installation

Should print a block containing:
If you see an older version, run composer update westyx/nexus to upgrade.

Verifying connectivity

Before writing any code, confirm your endpoint and API key work with a plain curl:
A valid response returns a JSON snapshot with your configs, secrets, and flags. An HTTP 401 means the key is wrong; HTTP 404 means the slug is wrong. To watch the live SSE stream:
You should see event:resync arrive within a second. Press Ctrl+C to stop.

Troubleshooting

The repositories entry must be present before running composer require. If you add it after, Composer will not retry the lookup - remove the cached resolution from composer.lock and run composer install again.
  • Could not find package westyx/nexus - verify the repositories URL is in composer.json and that your build machine can reach gitlab.com.
  • Your requirements could not be resolved - check that your declared php version constraint allows 8.3+. Run php -v to confirm the active runtime version.
  • SSL certificate errors - PHP HTTP clients use the system CA bundle. On Alpine Linux or minimal Docker images, install ca-certificates (apk add ca-certificates).
  • Class WestyxNexus\NexusClient not found - ensure require_once __DIR__ . '/vendor/autoload.php' runs before any use statement.