> For the complete documentation index, see [llms.txt](https://mercure-technologies.gitbook.io/xprem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mercure-technologies.gitbook.io/xprem/installation-guide/geolocation-and-observe-configuration.md).

# Geolocation & Observe configuration

Both features are optional and disabled by default. This page lists what to set in the environment; the linked pages cover the details.

### Geolocation

Geolocation places each device (country, city, coordinates) on the [Identity](/xprem/identity/overview.md) dashboard. The server stores the resolved place only; it never stores device IP addresses. Pick one strategy.

If the server sits behind a CDN or proxy that adds visitor-location headers (Cloudflare, CloudFront, Vercel, and others), trust them:

```bash
TRUST_GEOIP_HEADERS=true
```

Only enable this when the server is reachable exclusively through that proxy, since a direct client could forge its own location.

Otherwise, let the server download the free MaxMind GeoLite2 database itself. [Sign up for a free MaxMind account](https://www.maxmind.com/en/geolite2/signup), [generate a license key](https://www.maxmind.com/en/accounts/current/license-key), and set both variables (the server refuses to start with only one):

```bash
MAXMIND_ACCOUNT_ID=<account-id>
MAXMIND_LICENSE_KEY=<license-key>
```

If both strategies are configured, the headers win. Header catalogs, custom header names and cache options are covered in [Geolocation](/xprem/identity/geolocation.md).

### Observe

Observe stores the telemetry (metrics, logs, crash signals) sent by apps that embed the `expo-observe` SDK, and needs a ClickHouse database to do it. An empty database is enough; the server runs its own migrations at startup:

```bash
CLICKHOUSE_URL=clickhouse://user:password@host:9000/xprem
```

{% hint style="info" %}
This variable only enables the server side. The app must embed the SDK and point it at your server; follow [Get started with Observe](/xprem/observe/get-started-with-observe.md) for both halves.
{% endhint %}

What the feature gives you is described in the [Observe overview](/xprem/observe/overview.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mercure-technologies.gitbook.io/xprem/installation-guide/geolocation-and-observe-configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
