Dev.

Configuration

Every configuration option for OI Laravel Umami

Configuration

Publish the config file:

bash
php artisan vendor:publish --tag=oi-laravel-umami-config

Options

KeyEnvDefaultDescription
base_urlUMAMI_BASE_URL / UMAMI_URLhttps://api.umami.is/v1API root. Self-hosted must include the trailing /api.
api_keyUMAMI_API_KEYnullUmami Cloud API key. When set, the x-umami-api-key header is used and no login is performed.
usernameUMAMI_USERNAMEnullSelf-hosted username for the login token flow.
passwordUMAMI_PASSWORDnullSelf-hosted password.
website_idUMAMI_WEBSITE_IDnullDefault website UUID used by reporting methods when none is passed.
timezoneUMAMI_TIMEZONEapp timezone / UTCTimezone sent with reporting queries.
cache.prefixUMAMI_CACHE_PREFIXumamiPrefix for every cache key the client writes.
cache.ttlUMAMI_CACHE_TTL300Seconds to cache reporting responses.
cache.token_ttlUMAMI_TOKEN_CACHE_TTL3600Seconds to cache the self-hosted bearer token.

Authentication modes

The client picks its authentication mode automatically:

  • If api_key is set → requests send the x-umami-api-key header (Umami Cloud).
  • Otherwise → the client logs in with username / password against POST {base_url}/auth/login, then caches the bearer token for cache.token_ttl seconds.

If neither an API key nor credentials are available, the client throws an InvalidArgumentException on the first call.

Project under MIT License.
Design by