Documentation
07Reference

Configuration

Variables, secrets, and bindings that configure an InsightFlare deployment.

Variables

Set in the [vars] table of wrangler.toml, or override at build time (see configuration overrides).

NameDefaultMeaning
SESSION_WINDOW_MINUTES30Session window in minutes. Values are limited to the range 1 to 1440; a missing, invalid, or non-positive value falls back to 30.
SCRIPT_CACHE_TTL_SECONDS600Cache lifetime of the generated /script.js response. The effective value is capped at 12 hours.
PARQUET_WASM_URLA jsDelivr URL for parquet-wasm 0.7.1Reserved for the upcoming data archiving feature. Not used by the current version; you normally do not need to change it.
DEMO_MODEunsetSet to 1 to run in Demo Mode.
DISABLE_CRON_TASKSunsetSet to 1 to disable scheduled tasks. Always disabled in Demo Mode.
INSIGHTFLARE_ANALYTICS_ENGINE_DISABLEDunsetSet to 1 automatically when the deployment had to drop the Analytics Engine bindings. See Analytics Engine.

External services

Some dashboard features rely on external services. They are all open source, so you can host them yourself and point the variables below at your own deployment. Values must start with https://; invalid values fall back to the default.

NameDefaultUsed for
MAP_RELAY_BASE_URLhttps://maprelay.ravelloh.comMap basemaps and localized place labels, relayed by the server. Source: map-relay.
CANIUSE_API_BASE_URLhttps://caniuse.ravelloh.comFeature compatibility analysis on the Browsers page (Can I Use data). Source: can-i-use-api.
GEO_LOCALE_API_BASE_URLhttps://locale.ravelloh.comLocalized state, province, and city names. Source: iso-3166-2-locale.
SITE_META_API_BASE_URLhttps://meta.ravelloh.comTitles and icons of referring sites. Source: Gist.

Secrets

NameMeaning
MAIN_SECRETRoot secret from which session keys, API key hash keys, visitor salts, collect token signing keys, and encryption keys for stored credentials are derived. Required. Use a random string; at least 32 characters is recommended.
BOOTSTRAP_ADMIN_PASSWORDPassword of the initial admin account. If unset, the default insightflare is used.
DAILY_SALT_SECRETLegacy fallback for MAIN_SECRET. Used only when MAIN_SECRET is not set.

Do not rotate MAIN_SECRET casually. Sessions, API keys, and the encrypted credentials stored in System Settings depend on it.

Bindings

BindingTypeRequiredNotes
DBD1YesPrimary database. Migrations are in migrations/.
SITE_SETTINGS_KVKVYesPer-site tracking settings.
INGEST_DODurable ObjectYesIngestDurableObject.
REQUEST_ANALYTICSAnalytics EngineNoDataset insightflare_request_events.
TRAFFIC_ANALYTICSAnalytics EngineNoDataset insightflare_traffic_events.
EVENT_ANALYTICSAnalytics EngineNoDataset insightflare_event_facts.
ARCHIVE_BUCKETR2NoSee R2 archive.

Cookies and browser storage

NameWherePurpose
if_sessionDashboard cookieSign-in session.
if_localeDashboard cookieInterface language preference.
__insightflare_visitor_<siteId>__Visitor's localStorageAnonymous visitor identifier. See how visitors are identified.

Per-site settings

Tracking strength, URL handling, outbound links, performance sampling, request protection, and blocking rules are configured per site in the dashboard. See tracking settings.