Skip to content

Commercial Use

The commercialUse flag in app/commercial-use.ts marks the app as a commercial deployment. When true, defaults that aren't cleared for commercial use are excluded from the build, and the app refuses to boot if a restricted config is still in place.

// app/commercial-use.ts
export const commercialUse = false

Why its own file

Unlike the rest of your configuration, this flag doesn't live in settings.ts. It's read by vite.config.ts at build time, so restricted content is dead-code-eliminated from the production bundle rather than merely hidden at runtime — and vite.config.ts can't import settings.ts itself, since settings.ts depends on path aliases that don't exist yet at that point in the build. commercial-use.ts is a small, dependency-free file that both settings.ts and vite.config.ts can read directly.

Restarting after a change

Editing commercial-use.ts needs a dev-server restart to take effect. It's substituted as a build-time constant when Vite starts, not re-read live the way an ordinary settings.ts edit is.

What gets restricted

Field Effect when commercialUse is true
BasemapEntry.license: 'restricted' The entry is excluded from settings.basemaps and removed from the build entirely. Today, only Satellite (ESRI) is marked this way — see the default catalog
search.geocoder.provider: 'nominatim' The app throws a boot error instead of shipping a non-compliant geocoder — Nominatim's usage policy doesn't allow commercial use. Switch to 'maptiler' with an apiKey, or remove search.geocoder

Omitting license on a BasemapEntry defaults it to commercial-safe — a basemap you add yourself is never stripped unless you mark it 'restricted' yourself.