Sink provides some configuration options, which can be referred to in .env.example.
When using Worker deployment, please note that variables with the
NUXT_PUBLIC_prefix need to be configured in Workers' Settings -> Build -> Variables and Secrets and Settings -> Variables and Secrets.
If you are using Worker deployment, this variable needs to be configured in Settings -> Build -> Variables and Secrets and Settings -> Variables and Secrets.
Sets the site to demo mode, the generated links will expire after 5 minutes, and the links cannot be edited or deleted.
If you are using Worker deployment, this variable needs to be configured in Settings -> Build -> Variables and Secrets and Settings -> Variables and Secrets.
Sets the default length of the generated SLUG.
If you are using Worker deployment, this variable needs to be configured in Settings -> Build -> Variables and Secrets and Settings -> Variables and Secrets.
Sets the maximum number of KV operations per request for import/export. Default is 50 (Cloudflare Workers limit per request). Import operations use half of this value since each link requires 2 KV operations (check existence + write).
Redirects default to use HTTP 301 status code, you can set it to 302/307/308.
Cache links can speed up access, but setting them too long may result in slow changes taking effect. The default value is 60 seconds.
URL parameters are not carried during link redirection by default and it is not recommended to enable this feature. This is the global default; individual links can override this via the Redirect with Query Parameters toggle in Link Settings.
If you are using Worker deployment, this variable needs to be configured in Settings -> Build -> Variables and Secrets and Settings -> Variables and Secrets.
The default Sink homepage is the introduction page, you can replace it with your own website.
The Analytics Engine DATASET, it is not recommended to modify unless you need to switch databases and clear historical data.
You can modify the large model yourself. The supported names can be viewed at Workers AI Models.
Supports custom prompts, it is recommended to keep the placeholder {slugRegex}.
Default prompt:
You are a URL shortening assistant, please shorten the URL provided by the user into a SLUG. The SLUG information must come from the URL itself, do not make any assumptions. A SLUG is human-readable and should not exceed three words and can be validated using regular expressions {slugRegex} . Only the best one is returned, the format must be JSON reference {"slug": "example-slug"}Set URL case sensitivity.
Set the maximum query data volume for the Metric list.
Access statistics do not count bot traffic.
Set the environment variable NUXT_API_CORS=true during build to enable CORS support for the API.
Set to true to disable the automatic daily KV backup to R2 storage. Default is false.
This feature requires:
- R2 bucket binding configured in
wrangler.jsonc - Create R2 bucket:
wrangler r2 bucket create sink
Backups are stored in R2 with the path backups/links-{timestamp}.json and run daily at 00:00 UTC.
Set to a DNS over HTTPS (DoH) endpoint URL to enable automatic unsafe link detection when creating or editing links. When enabled, Sink queries the DoH service to check if the destination domain is flagged as malicious. If the domain resolves to 0.0.0.0, the link is automatically marked as unsafe and visitors will see a warning page before being redirected.
Recommended values:
https://family.cloudflare-dns.com/dns-query— Cloudflare Family DNS (blocks malware and adult content)- Custom Cloudflare Zero Trust Gateway DoH URL — supports custom block lists, domain risk categories, and more granular control
Default is empty (disabled). Users can still manually mark links as unsafe in the dashboard regardless of this setting.
Optional custom redirect target when a slug is not found. If this is not set, Sink will fall back to its default 404 page.