mirafive/sdk-php
A PHP SDK for integrating Mirafive services into your applications. Install via Composer, configure your credentials, and interact with the API through a simple, consistent client designed for PHP and Laravel projects.
composer require mirafive/sdk-php delivers buffered event ingest and server-side flag evaluation. That moves roadmap capacity from plumbing (batching, retries, idempotency, cache invalidation) to product surfaces — a decision worth quantifying against an estimated build effort of several engineer-weeks plus permanent maintenance.MiraFlags with ETag revalidation and an optional PSR-16 cache means a PM can ship a feature dark, then ramp by segment without a deploy and without a network call on the hot path.if ($region) checks.flushDeadlineMs (3 s), connectTimeoutMs (1 s) and a 30 s circuit breaker after a failed flush or segment lookup give an explicit answer to "what happens to the user experience when the vendor is down?" — supporting a standing decision that analytics and flags are non-blocking, best-effort dependencies.validation_failed events are dropped and reported rather than retried forever.handOff / deliverPrepared() for queued delivery, flushOnShutdown, and enabled: false for local and test environments support the decision to treat collection as asynchronous infrastructure rather than inline work.document: accepting a MiraFlags::snapshot() JSON, mean the exit cost is configuration, not a rewrite.Adopt when:
document: from your own config, CI artifact, or snapshot().Look elsewhere or wait when:
flagsRefreshSeconds polling.For executives. One integration replaces weeks of internal plumbing for analytics and feature flags — the part we would otherwise build once and maintain forever. It ships with the guarantees teams usually discover they need after an incident: batching, deduplication, retries with jittered backoff, explicit timeouts and a circuit breaker so a vendor outage degrades gracefully instead of taking the product down. Consent modes let us answer privacy requirements per market without a rewrite, and the PSR standards mean we can swap HTTP clients and caches rather than marry the vendor. The honest risk: this is a first public release — so we adopt behind an enabled switch, with a staged rollout and a documented fallback.
For engineering. A small, standards-based client. Buffered track() / identify() with an explicit send() and flush(); batches capped at 1000 events and 1 MiB; idempotency keys per batch so retries resend a byte-identical body and never double-count. Retries cover 408, 429, 5xx, timeouts and network errors with full-jitter backoff and a bounded Retry-After; a collector-rejected event (validation_failed) is dropped and reported while the rest of the batch is resent under a derived batch id. Transports are cURL, PHP streams, or any PSR-18 client; cache is any PSR-16 store, which is also where exposure marks, segment memberships, lookup back-off and the circuit-breaker state live. The flag document is ETag-revalidated with segment lookups and server-counted exposures, and the evaluator passes the shared MIRA FIVE fixtures. handOff / deliverPrepared() push delivery onto the queue, flushOnShutdown covers PHP-FPM, enabled: false keeps local and CI clean, Mira::DEFAULT_HOST makes the endpoint overridable, and the bootstrap block for the browser SDK is escaped by default so we don't ship an XSS hole alongside our feature flags.
How can I help you explore Laravel packages today?