westyx / nexus
Westyx Nexus PHP SDK - secrets, configs and feature flags
Requires
- php: >=8.3
- php-http/discovery: ^1.20
- psr/http-client: ^1.0
- psr/http-factory: ^1.1
- psr/http-message: ^1.1 || ^2.0
- psr/log: ^3.0
Requires (Dev)
- aws/aws-sdk-php: ^3.386
- friendsofphp/php-cs-fixer: ^3.95
- guzzlehttp/guzzle: ^7.0
- illuminate/collections: ^11.3 || ^12.0 || ^13.0
- illuminate/config: ^11.3 || ^12.0 || ^13.0
- illuminate/container: ^11.3 || ^12.0 || ^13.0
- illuminate/contracts: ^11.3 || ^12.0 || ^13.0
- illuminate/support: ^11.3 || ^12.0 || ^13.0
- myclabs/php-enum: ^1.8.1
- open-feature/sdk: ^2.1
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^12.0
- vlucas/phpdotenv: ^5.6.1
Suggests
- ext-curl: Required only for the SSE live-update stream (NexusClient::connectStream). Every other operation works without it.
- aws/aws-sdk-php: Required only for the aws_iam WIF provider (SigV4-signed STS GetCallerIdentity). Install with: composer require aws/aws-sdk-php
- guzzlehttp/guzzle: A PSR-18 HTTP client implementation. Any PSR-18 client works - install one if your project does not already provide one.
- illuminate/support: Required only for the Laravel service provider (WestyxNexus\Laravel\NexusServiceProvider), which Laravel auto-discovers.
- open-feature/sdk: Required only for the OpenFeature provider (WestyxNexus\OpenFeature\NexusProvider). Install with: composer require open-feature/sdk
Provides
None
Conflicts
None
Replaces
None
README
Official PHP SDK for the Westyx Nexus secrets, configs and feature flags platform. Reads are served from an in-memory snapshot refreshed on a TTL; a long-running worker can follow the live stream instead. Built on PSR-18 and PSR-17, so it uses the HTTP client your project already has. A Laravel service provider and an OpenFeature provider ship inside the package.
Documentation: docs.westyx.dev/sdks/php - start with Installation. The wiki carries the same pages.
Package
westyx/nexus on Packagist and on the
GitLab Composer registry. PHP 8.3 or newer;
every release is tested on 8.3, 8.4 and 8.5. Latest release: v0.19.1 - see the
version history.
Install
composer require westyx/nexus
You also need a PSR-18 HTTP client. Most projects already have one; if yours does not:
composer require guzzlehttp/guzzle # or
composer require symfony/http-client nyholm/psr7
Quick start
use WestyxNexus\NexusClient;
use WestyxNexus\NexusConfig;
$client = NexusClient::create(new NexusConfig(
baseUrl: 'https://blue-ocean-a5rx7.westyx.dev',
apiKey: (string) getenv('NEXUS_API_KEY'),
));
$host = $client->getConfig('db_host');
$pass = $client->getSecret('db_password');
$enabled = $client->getFlag('new-feature', false);
create performs the first sync and throws if it fails. In Laravel, installing the package is the
whole setup: app('nexus') and constructor injection of NexusClient both work.
Development
composer install
vendor/bin/phpunit # tests
vendor/bin/phpstan analyse --memory-limit=1G # static analysis, level 10
vendor/bin/php-cs-fixer fix --dry-run --diff # code style
Publishing
A pushed semver tag publishes the package to the GitLab Composer registry and notifies Packagist,
both taking the version from the tag. Committing to main releases nothing.
License
MIT