Skip to main content
The PHP SDK is published to the GitLab Composer registry. Because GitLab-hosted Composer packages are not indexed by Packagist, you must add a repositories entry to your composer.json before running composer require.

Repository configuration

Add the following to your composer.json before installing:

Install

Pin a specific version (recommended for production services):
Add the autoload import to your bootstrap:

Requirements

  • PHP 8.3 or newer (PHP 8.1 and 8.2 are end-of-life)
  • Composer 2 - Composer 1 is not tested and is no longer supported upstream
  • Guzzle 7 (guzzlehttp/guzzle ^7.0) - installed automatically as a dependency
  • Network access to <your-slug>.westyx.dev at runtime
Guzzle 7 requires guzzlehttp/promises ^2.0 and guzzlehttp/psr7 ^2.0. Composer resolves these transitively - you do not need to declare them explicitly.

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 - Guzzle uses 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.