Skip to content

ProxyConfig

ProxyConfig = object

The settings readConfig parses, each from an EDGEKIT_ environment variable.

accessDefault: string

The access fact unless the page marks itself free. From EDGEKIT_ACCESS_DEFAULT, default metered.


axiom: { dataset: string; token: string; } | null

Where the adapter may ship warnings: an ingest token and a dataset. Set both or neither; one alone is a config warning and is ignored.


bodySelector: string | null

CSS selector for the gated region, from EDGEKIT_BODY_SELECTOR. Without it, the proxy tries a gated selector the page declares in its structured data, then the edgekit-gated class, and uses the first that occurs in the page.


bypassBotCategories: readonly string[]

Verified-bot categories that skip decide and get the whole page (bot mode). From EDGEKIT_BYPASS_BOT_CATEGORIES, a JSON array, default ["Search Engine Crawler"].


clientIpKey: Uint8Array | null

From EDGEKIT_CLIENT_IP_KEY, a 32-byte base64url key. Signs the requesting IP so the tenant rate-limits each client on its own. Without it the proxy sends no IP, and the tenant’s rate limit can treat many users as one client.


factOverrides: Record<string, string>

From EDGEKIT_FACT_OVERRIDES, a JSON object from fact name to source: ld:<path> reads the page’s structured data, <selector>@<attribute> reads the first matching element’s attribute, and any other string is the value itself.


ignorePaths: RegExp | null

From EDGEKIT_IGNORE_PATHS, a regular expression tested against the path. A matching page skips decide and keeps its own caching headers; the script and decision island are still injected.


previewChildren: number

Child elements of the gated region kept on a truncated page. From EDGEKIT_PREVIEW_CHILDREN, default 2.


sectionDefault: string

The section fact when the page declares none. From EDGEKIT_SECTION_DEFAULT, default empty.


signInUrl: string | null

The sign-in link the injected client offers. From EDGEKIT_SIGN_IN_URL, an absolute http(s) URL.


siteId: string

The site this proxy fronts. From EDGEKIT_SITE_ID, required.


subscribeUrl: string | null

The subscribe link the injected client offers. From EDGEKIT_SUBSCRIBE_URL, an absolute http(s) URL.


tenantOrigin: string

Origin of the tenant, such as https://edgekit.example.com. From EDGEKIT_TENANT_HOST, required; the scheme defaults to https://. No trailing slash.


upstreamOrigin: string

Origin of the site’s own server. From EDGEKIT_UPSTREAM_URL, required; a path in it is ignored with a warning. No trailing slash.