API client
Overview#
Umami API Client is built in TypeScript and contains functions to call every API endpoint available in Umami.
Requirements#
- Node.js version 18.18 or newer
Installation#
Configure#
The following environment variables are required to call your own API.
To access Umami Cloud, these environment variables are required.
More details on accessing Umami Cloud can be found under API key.
Usage#
Import the configured api-client and query using the available class methods.
The result will come back in the following format.
API Client function mapping#
Me#
Users#
Teams#
Websites#
Event Data#
Environment Variables#
UMAMI_API_CLIENT_USER_ID = <user uuid>
The USER_ID of the User performing the API calls. Permission restrictions will apply based on application settings.
UMAMI_API_CLIENT_SECRET = <random string>
A random string used to generate unique values. This needs to match the APP_SECRET used in the Umami application.
UMAMI_API_CLIENT_ENDPOINT = <API endpoint>
The endpoint of your Umami API. Example: https://{yourserver}/api/
UMAMI_API_KEY = <API Key string>
A unique string provided by Umami Cloud.