PHP Server SDK Getting Started
Please follow the installation procedure and then run the following:
Initializing SDK
require_once(__DIR__ . '/vendor/autoload.php');
use DevCycle\Api\DevCycleClient;
use DevCycle\Model\DevCycleOptions;
use DevCycle\Model\DevCycleUser;
$options = new DevCycleOptions();
$devCycleClient = new DevCycleClient(
sdkKey: getenv("DEVCYCLE_SERVER_SDK_KEY"),
dvcOptions: $options);
$user_data = new DevCycleUser(array(
"user_id"=>"my-user"
));
try {
$result = $devcycleClient->allFeatures($user_data);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DevCycleClient->allFeatures: ', $e->getMessage(), PHP_EOL;
}
Initialization Options
The SDK exposes various initialization options which can be set when creating a new DevCycleClient:
$options = new DevCycleOptions();
$devCycleClient = new DevCycleClient(
sdkKey: getenv("DEVCYCLE_SERVER_SDK_KEY"),
dvcOptions: ($options);
$user_data = new DevCycleUser(array(
"user_id"=>"my-user"
));
DevCycle Option | Type | Description |
---|---|---|
enableEdgeDB | bool | Enables the usage of EdgeDB for DevCycle that syncs User Data to DevCycle. NOTE: This is only available with Cloud Bucketing. |
bucketingApiHostname | string | Contact support for usage instructions. |
unixSocketPath | string | Contact DevCycle support for instructions on how to configure this option. |
httpOptions | array | Contact DevCycle support for instructions on how to configure this option. |