Configuration
Every configuration option for OI Laravel Umami
Configuration
Publish the config file:
bash
php artisan vendor:publish --tag=oi-laravel-umami-configOptions
| Key | Env | Default | Description |
|---|---|---|---|
base_url | UMAMI_BASE_URL / UMAMI_URL | https://api.umami.is/v1 | API root. Self-hosted must include the trailing /api. |
api_key | UMAMI_API_KEY | null | Umami Cloud API key. When set, the x-umami-api-key header is used and no login is performed. |
username | UMAMI_USERNAME | null | Self-hosted username for the login token flow. |
password | UMAMI_PASSWORD | null | Self-hosted password. |
website_id | UMAMI_WEBSITE_ID | null | Default website UUID used by reporting methods when none is passed. |
timezone | UMAMI_TIMEZONE | app timezone / UTC | Timezone sent with reporting queries. |
cache.prefix | UMAMI_CACHE_PREFIX | umami | Prefix for every cache key the client writes. |
cache.ttl | UMAMI_CACHE_TTL | 300 | Seconds to cache reporting responses. |
cache.token_ttl | UMAMI_TOKEN_CACHE_TTL | 3600 | Seconds to cache the self-hosted bearer token. |
Authentication modes
The client picks its authentication mode automatically:
- If
api_keyis set → requests send thex-umami-api-keyheader (Umami Cloud). - Otherwise → the client logs in with
username/passwordagainstPOST {base_url}/auth/login, then caches the bearer token forcache.token_ttlseconds.
If neither an API key nor credentials are available, the client throws an
InvalidArgumentException on the first call.