RedirectHandlerOptions
Defined in: src/redirect.ts:69
Options for createRedirectHandler.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
analytics? |
AnalyticsSink |
Analytics sink, when no core is given (default: KV rollups). |
src/redirect.ts:75 |
basePath? |
string |
Serve path-prefixed links (acme.com/l/{slug}) on any host. Links are looked up on the request host when it is a registered domain, else on defaultDomain. |
src/redirect.ts:82 |
bots? |
"flag" | "drop" |
"flag" (default) records bot clicks with bot: true; "drop" records nothing. |
src/redirect.ts:97 |
cacheControl? |
string |
Cache-Control on redirects. Default "private, no-store" (every click counted). |
src/redirect.ts:101 |
conversions? |
object |
Conversion tracking: enabled turns it on for every link; param names the click-id parameter. |
src/redirect.ts:99 |
conversions.enabled? |
boolean |
- | src/redirect.ts:99 |
conversions.param? |
string |
- | src/redirect.ts:99 |
core? |
LinksCore |
A prebuilt core (share it with the admin panel). | src/redirect.ts:71 |
defaultDomain? |
string |
Shared default domain, when no core is given. |
src/redirect.ts:77 |
geo? |
GeoResolver |
Geo resolver. Default: edge headers (Cloudflare, Vercel, CloudFront, Fastly). | src/redirect.ts:88 |
getHost? |
(request) => string |
Request host. Default: X-Forwarded-Host, then the URL host. |
src/redirect.ts:94 |
getIp? |
(request) => string | undefined |
Client IP. Default: CF-Connecting-IP / X-Real-IP / first X-Forwarded-For. |
src/redirect.ts:92 |
ingestor? |
| false | Omit<ClickIngestorOptions, "sink"> | ClickIngestor |
Ingestor options, a prebuilt ingestor, or false to record nothing. |
src/redirect.ts:86 |
onClick? |
(event, link) => void |
Fire-and-forget tap for every recorded click. | src/redirect.ts:103 |
onError? |
(error) => void |
Errors from enrichment, storage or taps. Default console.warn. |
src/redirect.ts:105 |
parseUserAgent? |
UserAgentParser |
User-agent parser. Default: the built-in parser. | src/redirect.ts:90 |
privacy? |
PrivacyOptions |
- | src/redirect.ts:95 |
renderPage? |
(page, request) => Response | Promise<Response | null> | null |
Render built-in pages yourself. Return null to use the default page. |
src/redirect.ts:107 |
resolver? |
| ResolverOptions | Resolver |
Resolver options, or a prebuilt resolver. | src/redirect.ts:84 |
storage? |
KvStorage |
Storage, when no core is given. |
src/redirect.ts:73 |