Download the PHP package adriengras/umami-php without Composer
On this page you can find all versions of the php package adriengras/umami-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adriengras/umami-php
More information about adriengras/umami-php
Files in adriengras/umami-php
Package umami-php
Short Description Client PHP transport-only pour l'API Umami Analytics (v3.1.0), bâti sur Saloon v4.
License MIT
Homepage https://github.com/AdrienGras/umami-php
Informations about the package umami-php
umami-php
A standalone, framework-free PHP client for the Umami Analytics API
(v3.1.0), built on Saloon v4. It covers the full API surface:
tracking (/api/send, /api/batch) as well as reporting and admin (auth, stats, websites,
users, teams).
The library is transport-only: it knows no business entities, persists nothing and decides nothing. You instantiate the connector explicitly with resolved values — no framework binding, no hidden configuration.
Requirements
- PHP
^8.2 - An Umami instance (self-hosted or cloud), version
3.1.0
Installation
Creating the client
The connector exposes one façade per domain: $umami->tracking, $umami->auth,
$umami->stats, $umami->websites, $umami->users, $umami->teams.
Tracking (no authentication)
Tracking endpoints are unauthenticated server-side. Always relay the visitor's userAgent —
otherwise Umami's bot filter drops the hit and the library raises a BotFilteredException.
Reporting & admin (authenticate first)
Call login() once: it stores the Bearer token on the connector, so every subsequent
reporting/admin call is authenticated automatically.
Stats
Event data
Explore custom-event properties (all windows are epoch-millisecond Periods):
Websites
Users (admin)
Teams
Reports
Saved-report CRUD plus nine on-the-fly generation endpoints. Generation parameters are passed
through as-is (the server validates them); the existing Filters value object is reused.
Error handling
Every failed request raises an exception (Saloon's AlwaysThrowOnErrors). All library
exceptions extend UmamiApiException.
BotFilteredException is the one case where a 200 response is turned into an error: Umami's
bot filter answers /api/send and /api/batch with a 200 body of {"beep":"boop"}, which
the library re-qualifies as a failure.
License
MIT © Adrien Gras