Configuration
Configure Nuxt Umami to work with your app.
You can configure nuxt-umami
in your Nuxt config.
nuxt.config.ts
Environment Variables
You can provide the host
and id
as env variables.
Simply add NUXT_UMAMI_HOST
and NUXT_UMAMI_ID
to your .env file.
Provided env variables will override the base config in nuxt.confi.ts
.
If you are upgrading from v2, rest assured v3 will also
pick up NUXT_PUBLIC_UMAMI_HOST
and NUXT_PUBLIC_UMAMI_ID
.
Config Options
Options
enabledboolean
true
hostrequiredstring
- Example:
'https://ijkml.xyz/'
.
idrequiredstring
- Example:
'3c255b6d-678a-42dd-8074-272ee5b78484'
.
domainsstring[]
undefined
- Example:
['mywebsite.com', 'mywebsite2.com']
.
autoTrackboolean
true
ignoreLocalhostboolean
false
customEndpointstring
COLLECT_API_ENDPOINT
, which is:/api/collect
by default in Umami v1./api/send
by default in Umami v2.
Read more in Umami Docs
excludeQueryParamsboolean
false
false
=>/page/link?search=product-abc&filter=asc
.true
=>/page/link
.
useDirectiveboolean
false
v-umami
directive. logErrorsboolean
false
proxyfalse | 'direct' | 'cloak'
false
trailingSlash'any' | 'always' | 'never'
'any'
any
=> default option, leave as is.always
=> always include trailing slash.always
=> always remove trailing slash.
Type
types.d.ts
Proxy Mode
Nuxt Umami can leverage Nitro route rules and Nuxt server endpoints to proxy requests to your Umami endpoint.
There are currently 3 proxy options:
false
: Requests go directly to your Umami endpoint.direct
: Simple proxy using route rules.cloak
: Proxy with "sensitive" data kept out of your client bundle.
With cloak
, your website id
and host
are only available
server-side unlike direct
or none.