getsidekicker / flagr-client
Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is "/api/v1".
Installs: 19 039
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/getsidekicker/flagr-client
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2 || ^7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- rector/rector: ^0.11.47
This package is auto-updated.
Last update: 2025-10-17 06:50:28 UTC
README
Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is "/api/v1".
Installation & Usage
Requirements
PHP 7.4 and later.
Composer
To install the bindings via Composer, add the following to composer.json:
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/getsidekicker/flagr-client.git"
    }
  ],
  "require": {
    "getsidekicker/flagr-client": "*@dev"
  }
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new Flagr\Client\Api\ConstraintApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $flag_id = 56; // int | numeric ID of the flag $segment_id = 56; // int | numeric ID of the segment $body = new \Flagr\Client\Model\CreateConstraintRequest(); // \Flagr\Client\Model\CreateConstraintRequest | create a constraint try { $result = $apiInstance->createConstraint($flag_id, $segment_id, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling ConstraintApi->createConstraint: ', $e->getMessage(), PHP_EOL; }
API Endpoints
All URIs are relative to http://localhost/api/v1
| Class | Method | HTTP request | Description | 
|---|---|---|---|
| ConstraintApi | createConstraint | POST /flags/{flagID}/segments/{segmentID}/constraints | |
| ConstraintApi | deleteConstraint | DELETE /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} | |
| ConstraintApi | findConstraints | GET /flags/{flagID}/segments/{segmentID}/constraints | |
| ConstraintApi | putConstraint | PUT /flags/{flagID}/segments/{segmentID}/constraints/{constraintID} | |
| DistributionApi | findDistributions | GET /flags/{flagID}/segments/{segmentID}/distributions | |
| DistributionApi | putDistributions | PUT /flags/{flagID}/segments/{segmentID}/distributions | |
| EvaluationApi | postEvaluation | POST /evaluation | |
| EvaluationApi | postEvaluationBatch | POST /evaluation/batch | |
| ExportApi | getExportEvalCacheJSON | GET /export/eval_cache/json | |
| ExportApi | getExportSqlite | GET /export/sqlite | |
| FlagApi | createFlag | POST /flags | |
| FlagApi | deleteFlag | DELETE /flags/{flagID} | |
| FlagApi | findFlags | GET /flags | |
| FlagApi | getFlag | GET /flags/{flagID} | |
| FlagApi | getFlagEntityTypes | GET /flags/entity_types | |
| FlagApi | getFlagSnapshots | GET /flags/{flagID}/snapshots | |
| FlagApi | putFlag | PUT /flags/{flagID} | |
| FlagApi | restoreFlag | PUT /flags/{flagID}/restore | |
| FlagApi | setFlagEnabled | PUT /flags/{flagID}/enabled | |
| HealthApi | getHealth | GET /health | |
| SegmentApi | createSegment | POST /flags/{flagID}/segments | |
| SegmentApi | deleteSegment | DELETE /flags/{flagID}/segments/{segmentID} | |
| SegmentApi | findSegments | GET /flags/{flagID}/segments | |
| SegmentApi | putSegment | PUT /flags/{flagID}/segments/{segmentID} | |
| SegmentApi | putSegmentsReorder | PUT /flags/{flagID}/segments/reorder | |
| TagApi | createTag | POST /flags/{flagID}/tags | |
| TagApi | deleteTag | DELETE /flags/{flagID}/tags/{tagID} | |
| TagApi | findAllTags | GET /tags | |
| TagApi | findTags | GET /flags/{flagID}/tags | |
| VariantApi | createVariant | POST /flags/{flagID}/variants | |
| VariantApi | deleteVariant | DELETE /flags/{flagID}/variants/{variantID} | |
| VariantApi | findVariants | GET /flags/{flagID}/variants | |
| VariantApi | putVariant | PUT /flags/{flagID}/variants/{variantID} | 
Models
- Constraint
- CreateConstraintRequest
- CreateFlagRequest
- CreateSegmentRequest
- CreateTagRequest
- CreateVariantRequest
- Distribution
- Error
- EvalContext
- EvalDebugLog
- EvalResult
- EvaluationBatchRequest
- EvaluationBatchResponse
- EvaluationEntity
- Flag
- FlagSnapshot
- Health
- PutDistributionsRequest
- PutFlagRequest
- PutSegmentReorderRequest
- PutSegmentRequest
- PutVariantRequest
- Segment
- SegmentDebugLog
- SetFlagEnabledRequest
- Tag
- Variant
Authorization
All endpoints do not require authorization.