Cloudsteading
Analytics
Analytics

Sink

Cloudflare short links with analytics, QR codes and routing controls.

Sink is a self-hosted Bitly/Rebrandly alternative built on Cloudflare (Analytics Engine, D1, KV, R2, Workers). Free tier eligible within limits. Inspect the source and license in the linked repository.

Source & license

Upstream license: AGPL-3.0-only

License TL;DR

You can use and change it, even commercially. If people use your modified version over a network, offer them its corresponding source under the AGPL. Sharing copies has source-sharing duties too. Sharing source code is different from sharing users’ content.

Explain AGPL v3 in plain English →

Summary of the main license. Separate packages and assets can have different terms.

Inspect repository ↗Read this project’s actual license ↗

Repository owner

@miantiao-me

See the upstream repository for the original creator and contributors.

Maintain this project? Maintainer verification →README badge, corrections or removal →

Cloudflare hosting

Free tier eligible within limits

The reviewed Cloudflare deployment is eligible for Free-plan allowances for the stated small workload and feature scope. Usage limits, CPU, required account setup and separate services apply.

Hosting requirements
  • Replace committed resource IDs using the documented DEPLOY configuration and configure a private NUXT_SITE_TOKEN.
  • Keep dynamic requests/CPU, D1 row/storage and KV read/write quotas within Workers Free limits; links are not limited only by the request allowance.
  • Analytics Engine Free currently includes 100,000 written points/day and 10,000 read queries/day; future billing/pricing must be rechecked.
  • If optional AI is used, stay below 10,000 Neurons/day; if R2 snapshots are enabled, include retention in Standard R2 storage/operation quotas.
  • Exclude the docs Worker from app topology; AI and backup storage are optional features and may add costs when enabled beyond quotas.
  • Workers Free dynamic requests are shared across this account (100,000/day), with 10 ms CPU per invocation; workload fit is conditional and has not been measured.
  • D1 Free allowance: 5 million rows read/day, 100,000 rows written/day and 5 GB total storage; unindexed scans and history retention consume quota.
  • KV Free allowance: 100,000 keys read/day and 1,000 each writes/deletes/list requests/day; this may constrain updates before Worker request limits.
  • R2 Standard allowance: 10 GB-month storage, 1 million Class A and 10 million Class B operations/month; account activation may require billing setup, and other storage classes are excluded.
Check current pricing ↗
Review findings & limitations
  • Source-reviewed at a pinned commit; deployment, screenshots and behavior were not runtime-tested.
  • Base config actively declares Workers AI and R2 even though README describes runtime functionality as optional.
  • Near-real-time analytics explicitly use 10-second polling, not WebSockets/SSE.
  • AGPL-3.0-only owner credit miantiao-me; no managed-service parity claims.
  • Pinned runtime source review now includes 64 TS/JS files and recognizes handler/router declarations. This is static source evidence, not verification of running deployment, authentication or external service delivery.
Sources checked 01/10/2026

Repository snapshot: bafa4e1. Hosting eligibility reflects the deployment documentation and listed assumptions.

  • bitly ↗

    o/badge/License-AGPL--3.0-blue?style=flat) ![Hero](./public/image.png) --- ## ✨ Features - **🔗 URL Shortening:** Compress your URLs to their minimal length. - **📈 Analytics:** Monitor link analytics and gather insightful statistics. - **☁️ Serverless:** Deploy without the need for traditional servers. - **🎨 Customizable Slug:** Support personalized slugs, UTM parameters, and optional case-sensitive slug matching through configuration. - **🪄 AI Assistance:** Optionally use Cloudflare Workers AI to generate slugs and OpenGraph metadata from page content. - *

  • rebrandly ↗

    ge content. - **⏰ Link Control:** Set expirations, passwords, and unsafe-link warning pages. - **📱 Smart Routing:** Redirect visitors by device or country. - **🖼️ Social Preview:** Customize social previews with titles, descriptions, and images. - **📊 Near-real-time Analytics:** Display a live 3D globe and event logs using 10-second analytics polling and client-side replay, not SSE or WebSocket. - **🔲 QR Code:** Generate QR codes for your short links. - **📦 Import/Export:** Transfer links via JSON and export access analytics via CSV. - **🌍 Multi-language:**

  • workers ↗

    { "$schema": "node_modules/wrangler/config-schema.json", "name": "sink", "main": ".output/server/index.mjs", "assets": { "binding": "ASSETS", "directory": ".output/public", "html_handling": "drop-trailing-slash" }, "compatibility_date": "2025-05-08", "compatibility_flags": [ "nodejs_compat" ], "keep_vars": true, "upload_source_maps": true, "observability": { "logs": { "enabled": true }, "traces": { "enabled": true } }, "ai": { "binding": "AI", "remote": true }, //

  • d1 ↗

    dd3" // Override with DEPLOY_KV_NAMESPACE_ID } ], "d1_databases": [ { "binding": "DB", "database_name": "sink", // Override with DEPLOY_D1_DATABASE_NAME (default: sink) "database_id": "ef964055-65bf-4b78-b109-ac9c9290ae62", // Override with DEPLOY_D1_DATABASE_ID (required for CLI deploy) "migrations_dir": "drizzle" } ], "r2_buckets": [ { "binding": "R2", // preview_bucket_name: DEPLOY_R2_PREVIEW_BUCKET_NAME (falls back to DEPLOY_R2_BUCKET_NAME) // omit DEPLOY_R2_BUCKET_NAME to drop R2 from generated

  • kv ↗

    Keep in sync with NUXT_DATASET at runtime. } ], "kv_namespaces": [ { "binding": "KV", "preview_id": "ef93d42dc4b34969bab404d2e80f8dd3", // Override with DEPLOY_KV_PREVIEW_NAMESPACE_ID (falls back to DEPLOY_KV_NAMESPACE_ID) "id": "ef93d42dc4b34969bab404d2e80f8dd3" // Override with DEPLOY_KV_NAMESPACE_ID } ], "d1_databases": [ { "binding": "DB", "database_name": "sink", // Override with DEPLOY_D1_DATABASE_NAME (default: sink) "database_id": "ef964055-65bf-4b78-b109-ac9c9290ae62", // Override with DEPLOY_D1

  • r2 ↗

    CLI deploy) "migrations_dir": "drizzle" } ], "r2_buckets": [ { "binding": "R2", // preview_bucket_name: DEPLOY_R2_PREVIEW_BUCKET_NAME (falls back to DEPLOY_R2_BUCKET_NAME) // omit DEPLOY_R2_BUCKET_NAME to drop R2 from generated deploy config "preview_bucket_name": "sink", "bucket_name": "sink" // Override with DEPLOY_R2_BUCKET_NAME } ], "triggers": { "crons": ["0 0 * * *"] // Run backup task daily at 00:00 UTC } }

  • workers-ai ↗

    "enabled": true }, "traces": { "enabled": true } }, "ai": { "binding": "AI", "remote": true }, // Values marked with DEPLOY_* below are placeholders for local/dev. // CLI deploy (pnpm deploy:worker / deploy:config) rewrites them into gitignored wrangler.deploy.jsonc. // Prefer setting DEPLOY_* in .env or Workers Builds / Pages variables — do not hardcode production IDs here. "analytics_engine_datasets": [ { "binding": "ANALYTICS", "dataset": "sink" // Override with DEPLOY_ANALYTICS_DATASET (default: sink).

  • analytics-engine ↗

    les — do not hardcode production IDs here. "analytics_engine_datasets": [ { "binding": "ANALYTICS", "dataset": "sink" // Override with DEPLOY_ANALYTICS_DATASET (default: sink). Keep in sync with NUXT_DATASET at runtime. } ], "kv_namespaces": [ { "binding": "KV", "preview_id": "ef93d42dc4b34969bab404d2e80f8dd3", // Override with DEPLOY_KV_PREVIEW_NAMESPACE_ID (falls back to DEPLOY_KV_NAMESPACE_ID) "id": "ef93d42dc4b34969bab404d2e80f8dd3" // Override with DEPLOY_KV_NAMESPACE_ID } ], "d1_databases": [ {

  • free-tier-eligible ↗

    { "$schema": "node_modules/wrangler/config-schema.json", "name": "sink", "main": ".output/server/index.mjs", "assets": { "binding": "ASSETS", "directory": ".output/public", "html_handling": "drop-trailing-slash" }, "compatibility_date": "2025-05-08", "compatibility_flags": [ "nodejs_compat" ], "keep_vars": true, "upload_source_maps": true, "observability": { "logs": { "enabled": true }, "traces": { "enabled": true } }, "ai": { "binding": "AI", "remot

  • free-tier-eligible ↗

    ount Manager. | | Requests<sup>1, 2, 3, 4</sup> | Duration | CPU time | | --- | --- | --- | --- | | **Free** | 100,000 per day | No charge for duration | 10 milliseconds of CPU time per invocation | | **Standard** | 10 million included per month <br> +$0.30 per additional million | No charge or limit for duration | 30 million CPU milliseconds included per month<br> +$0.02 per additional million CPU milliseconds<br><br> Max of [5 minutes of CPU time](https://developers.cloudflare.com/workers/platform/limits/#account-plan-limits) per invocation (default: 30 second

  • free-tier-eligible ↗

    rs Paid](https://developers.cloudflare.com/workers/platform/pricing/#workers) | | --- | --- | --- | | Rows read | 5 million / day | First 25 billion / month included + $0.001 / million rows | | Rows written | 100,000 / day | First 50 million / month included + $1.00 / million rows | | Storage (per GB stored) | 5 GB (total) | First 5 GB included + $0.75 / GB-mo | Track your D1 usage To accurately track your usage, use the [meta object](https://developers.cloudflare.com/d1/worker-api/return-object/), [GraphQL Analytics API](https://developers.cloudflare.com/d1/obs

  • free-tier-eligible ↗

    flare.com/workers/platform/pricing/). | | Free plan<sup>1</sup> | Paid plan | | --- | --- | --- | | Keys read | 100,000 / day | 10 million/month, + $0.50/million | | Keys written | 1,000 / day | 1 million/month, + $5.00/million | | Keys deleted | 1,000 / day | 1 million/month, + $5.00/million | | List requests | 1,000 / day | 1 million/month, + $5.00/million | | Stored data | 1 GB | 1 GB, + $0.50/ GB-month | <sup>1</sup> The Workers Free plan includes limited Workers KV usage. All limits reset daily at 00:00 UTC. If you exceed any one of these limits, further o

  • free-tier-eligible ↗

    f you have retrieved data (for infrequent access storage) for 1.1 GB, you will be billed for 2 GB. ### Free tier You can use the following amount of storage and operations each month for free. | | Free | | --- | --- | | Storage | 10 GB-month / month | | Class A Operations | 1 million requests / month | | Class B Operations | 10 million requests / month | | Egress (data transfer to Internet) | Free <sup>[1](#user-content-fn-1)</sup> | Caution The free tier only applies to Standard storage, and does not apply to Infrequent Access storage. ### Storage usage S

  • free-tier-eligible ↗

    evelopers.cloudflare.com/workers/platform/pricing/) and is priced at **$0.011 per 1,000 Neurons**. Our free allocation allows anyone to use a total of **10,000 Neurons per day at no charge**. To use more than 10,000 Neurons per day, you need to sign up for the [Workers Paid plan](https://developers.cloudflare.com/workers/platform/pricing/#workers). On Workers Paid, you will be charged at $0.011 / 1,000 Neurons for any usage above the free allocation of 10,000 Neurons per day. You can monitor your Neuron usage in the [Cloudflare Workers AI dashboard ↗︎](https://d

  • free-tier-eligible ↗

    r> (+$0.25 per additional million) | 1 million included per month (+$1.00 per additional million) | | **Workers Free** | 100,000 included per day | 10,000 included per day | Pricing availability Currently, you will not be billed for your use of Workers Analytics Engine. Pricing information here is shared in advance, so that you can estimate what your costs will be once Cloudflare starts billing for usage in the coming months. If you are an Enterprise customer, contact your account team for information about Workers Analytics Engine pricing and billing. ### Dat

  • AGPL-3.0-only ↗

    GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.

  • architecture ↗

    { "$schema": "node_modules/wrangler/config-schema.json", "name": "sink", "main": ".output/server/index.mjs", "assets": { "binding": "ASSETS", "directory": ".output/public", "html_handling": "drop-trailing-slash" }, "compatibility_date": "2025-05-08", "compatibility_flags": [ "nodejs_compat" ], "keep_vars": true, "upload_source_maps": true, "observability": { "logs": { "enabled": true }, "traces": { "enabled": true } }, "ai": { "binding": "AI", "remote": true }, //

Upstream screenshot · miantiao-me/Sink repository contributors ↗. Depicts the upstream project. We have not deployed and tested a fresh installation here.

What it can replace

Compare the workflow you need. These mappings describe overlap; full feature parity requires a separate comparison.

Bitly logoBitly ↗

Editorial workflow alternative: Short URLs, custom slugs, QR codes and link analytics for individuals/small teams; no managed SLA or multi-user parity.

See supporting source ↗
Rebrandly logoRebrandly ↗

Editorial workflow alternative: Personal short-link management, analytics and device/country routing; branded-domain portfolio and team-workflow parity are not verified.

See supporting source ↗
Workflow overlap
Pricing not verified
Workflow overlap
Pricing not verified

How it works

The shape of Sink on Cloudflare, and how it stacks up against the rented tools it replaces.

Architecture

Diagram of deployment declarations at the reviewed commit. Each app has its own entrypoint; declared resources do not prove runtime calls. Follow file and line sources below.

View upstream source ↗
Public interface
Configured entry points1
sink
wrangler.jsonc
↓
App
sink
entry
Cloudflare Workers
Entrypoint: .output/server/index.mjsConfigured cron (UTC): 0 0 * * *
↓

Configuration and workflow sources

Reviewed commit bafa4e1f7e3e. This configuration evidence comes from reading source files. Execution checks, when available, appear in the project's runtime review.

Deployment configuration · 2 files
wrangler.jsonc ↗

Cloudflare Workers · compatibility 2025-05-08

sink · default

Entrypoint: .output/server/index.mjs

Static assets: .output/public

Cron triggers (UTC): 0 0 * * *

  • DB → D1
  • KV → KV
  • R2 → R2
  • AI → Workers AI
  • ANALYTICS → Analytics Engine
  • ASSETS → Static assets
docs/wrangler.jsonc ↗

Cloudflare Workers · example/template, excluded from overview · compatibility 2026-07-12

sink-docs · default

Static assets: ./.vitepress/dist · 404-page

  • Static assets → Static assets

Named environments are separate deployments. Bindings are shown only where declared. Configured routes are URL patterns, not verified application endpoints.

Runtime source · handlers, binding usage and workflow steps

Observed TypeScript/JavaScript declarations from Worker entrypoints and resolved relative imports. Calls and workflow steps may run conditionally; their listed order is not a proven end-to-end request flow. Router declarations may be mounted under a prefix or may not be registered. This shows code wiring, not a successful deployment or runtime test. Dynamic wiring, aliases and generated code may not resolve.

nuxt.config.ts ↗

    Environment references: process.env.NUXT_SITE_TOKEN · process.env.NUXT_HOME_URL · process.env.NUXT_API_CORS · env.CF_PAGES

    server/api/link/count.get.ts ↗
    • L40 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, countLinks
    server/api/backup.post.ts ↗
    • L8 · Nuxt auto-imported H3 HTTP handler exported · calls backupLinksToR2, createError, requireR2Bucket
    server/api/link/ai.get.ts ↗
    • L42 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, z.object, z.url, createError, useRuntimeConfig, useAppConfig, fetchPageMarkdown, aiPrompt.replace, slugRegex.toString, AI.run, console.warn, fallbackSlug, parseAiResponse, trim, String, normalizeSlug
    • L22 · fallbackSlug calls (conditional paths may differ): filter, urlObj.pathname.split, pathSegments.at, replace, slice, source.replace, normalizeSlug
    server/api/link/create.post.ts ↗
    • L27 · Nuxt auto-imported H3 HTTP handler exported · calls readValidatedBody, saveNewLink, setResponseStatus
    server/api/link/check.post.ts ↗
    • L25 · Nuxt auto-imported H3 HTTP handler exported · calls readValidatedBody, checkLinksPage
    server/api/link/delete.post.ts ↗
    • L24 · Nuxt auto-imported H3 HTTP handler exported · calls assertLinkWritesAllowed, readValidatedBody, removeLink
    server/api/link/edit.put.ts ↗
    • L14 · Nuxt auto-imported H3 HTTP handler exported · calls assertLinkWritesAllowed, readValidatedBody, replaceLink, setResponseStatus
    server/api/link/export.get.ts ↗
    • L32 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, useRuntimeConfig, listLinks, links.push, protectLinkPasswordForExport, toISOString, setResponseHeader
    server/api/link/import.post.ts ↗
    • L23 · Nuxt auto-imported H3 HTTP handler exported · calls assertLinkWritesAllowed, readValidatedBody, useRuntimeConfig, createError, importData.links.slice, Promise.all, chunk.map, normalizeSlug, Math.floor, Date.now, nanoid, normalizeLinkPasswordForStorage, prepared.filter, createLinks, writable.map, result.failedItems.push, describeImportError, result.skippedItems.push, result.successItems.push, setResponseHeader
    server/api/link/list.get.ts ↗
    • L47 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, listLinks, sanitizeLinksPassword
    server/api/link/migration/run.post.ts ↗
    • L81 · Nuxt auto-imported H3 HTTP handler exported · calls readBody, LinkMigrationRunSchema.parse, Object.assign, getQuery, drizzle, Math.floor, Date.now, decodeMigrationCursor, limit, where, from, db.select, eq, createError, readCompletedLinkMigrationMarker, completedResult, crypto.randomUUID, values, db.insert, KV.list, encodeMigrationCursor, KV.getWithMetadata, parseLegacyKvLink, key.name.slice, join, parsed.error.issues.map, normalizeSlug, getExpiration, migrateKvLink, result.failedItems.push, String, db.delete, isNull, returning, set, db.update, and
    • L50 · encodeMigrationCursor calls (conditional paths may differ): btoa, JSON.stringify
    • L54 · decodeMigrationCursor calls (conditional paths may differ): cursor.startsWith, createError, JSON.parse, atob, cursor.slice
    server/api/link/og-ai.get.ts ↗
    • L60 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, z.object, z.url, optional, z.string, createError, useRuntimeConfig, resolveMetadataLocale, fetchPageMarkdown, AI.run, console.warn, fallbackMetadata, parseAiResponse, trim, String
    • L29 · fallbackMetadata calls (conditional paths may differ): hostname.replace
    • L46 · resolveMetadataLocale calls (conditional paths may differ): resolveRedirectLocale, Intl.getCanonicalLocales
    server/api/link/query.get.ts ↗
    • L19 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, normalizeSlug, getLinkWithMetadata, sanitizeLinkPassword, createError
    server/api/link/migration/status.get.ts ↗
    • L11 · Nuxt auto-imported H3 HTTP handler exported · calls readCompletedLinkMigrationMarker
    server/api/link/search.get.ts ↗
    • L47 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, searchLinks
    server/api/link/search.post.ts ↗
    • L14 · Nuxt auto-imported H3 HTTP handler exported · calls readValidatedBody, searchLinks
    server/api/link/tags.get.ts ↗
    • L8 · Nuxt auto-imported H3 HTTP handler exported · calls listTags
    server/api/link/upsert.post.ts ↗
    • L14 · Nuxt auto-imported H3 HTTP handler exported · calls readValidatedBody, upsertLink, setResponseStatus
    server/api/logs/events.get.ts ↗
    • L39 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, useWAE, buildEventsQuery, events2logs
    • L7 · eventId calls (conditional paths may differ): join, map, sort, Object.keys, source.charCodeAt, Math.imul, toString
    • L21 · events2logs calls (conditional paths may differ): events.map, Array.from, Object.keys, eventId, occurrences.get, occurrences.set, blobs2logs, doubles2logs, Math.floor, getTime
    server/api/location.get.ts ↗
    • L12 · Nuxt auto-imported H3 HTTP handler exported
    server/api/mcp.ts ↗
    • L26 · Nuxt auto-imported H3 HTTP handler exported · calls setResponseHeader, createError, handleMcpRequest, response.headers.set
    server/api/logs/locations.get.ts ↗
    • L3 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, useWAE, buildLocationsQuery
    server/api/stats/heatmap.get.ts ↗
    • L1 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, useWAE, buildHeatmapQuery
    server/api/stats/[action].get.ts ↗
    • L18 · Nuxt auto-imported H3 HTTP handler exported · calls getRouterParam, createError, getValidatedQuery, useWAE, buildAccessExportQuery, toCsv, setResponseHeader, createExportFilename
    • L14 · toCsv calls (conditional paths may differ): generateCsv, rows.map, CsvColumns.map
    server/api/stats/metrics.get.ts ↗
    • L1 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, useWAE, buildMetricsQuery
    server/api/stats/counters.get.ts ↗
    • L3 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, useWAE, buildCountersQuery
    server/api/upload/image.post.ts ↗
    • L27 · Nuxt auto-imported H3 HTTP handler exported · calls requireR2Bucket, readFormData, formData.get, createError, slugValidator.safeParse, IMAGE_ALLOWED_TYPES.includes, file.type.split, nanoid, file.arrayBuffer, R2.put
    server/middleware/2.auth.ts ↗
    • L3 · Nuxt auto-imported H3 HTTP handler exported · calls event.path.startsWith, getHeader, verifySiteToken, useRuntimeConfig, getRequestURL, verifyCloudflareAccess, isCloudflareAccessRequestAllowed, Object.assign, mapCloudflareAccessIdentity, createError, setResponseHeader
    • L46 · verifySiteToken calls (conditional paths may differ): Promise.all, crypto.subtle.digest, encoder.encode, timingSafeEqual
    server/api/stats/views.get.ts ↗
    • L1 · Nuxt auto-imported H3 HTTP handler exported · calls getValidatedQuery, useWAE, buildViewsQuery
    server/api/verify.get.ts ↗
    • L15 · Nuxt auto-imported H3 HTTP handler exported · calls createError, useRuntimeConfig, isCloudflareAccessConfigured
    server/middleware/1.redirect.ts ↗
    • L51 · Nuxt auto-imported H3 HTTP handler exported · calls parsePath, event.path.replace, useAppConfig, useRuntimeConfig, sendRedirect, reserveSlug.includes, slugRegex.test, slug.toLowerCase, getLink, console.log, resolveRedirectLocale, setHeader, getHeader, getQuery, withQuery, country.toUpperCase, buildTarget, getDeviceRedirectUrl, verifyLinkPassword, createError, readBody, sendNoStoreHtml, generatePasswordHtml, getLocale, generateUnsafeWarningHtml, collectAccessLog, console.error, writeAccessLog, queueLinkClickedWebhook, isSocialBot, hasOgConfig, getRequestProtocol, getRequestHost, generateOgHtml, sendWebResponse, proxyLinkRequest, generateCloakingHtml
    • L25 · isSocialBot calls (conditional paths may differ): userAgent.toLowerCase, SOCIAL_BOTS.some, ua.includes
    • L30 · getDeviceRedirectUrl calls (conditional paths may differ): userAgent.toLowerCase, ua.includes, APPLE_DEVICE_UA_MARKERS.some
    server/middleware/3.link-store-gate.ts ↗
    • L8 · Nuxt auto-imported H3 HTTP handler exported · calls LINK_STORE_ROUTES.test, getRequestURL, assertLinkStoreReady
    server/routes/_assets/[...key].get.ts ↗
    • L5 · Nuxt auto-imported H3 HTTP handler exported · calls requireR2Bucket, getRouterParam, createError, key.startsWith, key.split, slugValidator.safeParse, R2.get, setHeader
    server/plugins/openapi.ts ↗
    • L36 · isRecord calls (conditional paths may differ): Array.isArray
    • L40 · applyOpenAPISchemas calls (conditional paths may differ): isRecord, Object.entries, build
    server/services/link-store/d1.ts ↗
    • L55 · withoutQuery calls (conditional paths may differ): parseURL, stringifyParsedURL
    • L60 · getDatabase calls (conditional paths may differ): drizzle
    • L64 · activeCondition calls (conditional paths may differ): Math.floor, Date.now, or, isNull, gt
    • L68 · statusCondition calls (conditional paths may differ): Math.floor, Date.now, activeCondition, and, isNotNull, lte
    • L76 · exactTagCondition calls (conditional paths may differ): exists, where, from, db.select, and, eq
    • L85 · rowToLink calls (conditional paths may differ): Object.assign
    • L119 · addTagsToLinksFromDatabase calls (conditional paths may differ): result.map, orderBy, where, from, db.select, inArray, slugs.slice, asc, bySlug.get
    • L133 · rowsToLinks calls (conditional paths may differ): rows.map, addTagsToLinksFromDatabase, getDatabase, result.map
    • L138 · buildD1LinkValues calls (conditional paths may differ): withoutQuery, getExpiration
    • L163 · d1GetActiveLink calls (conditional paths may differ): limit, where, from, select, getDatabase, and, eq, activeCondition, rowsToLinks
    • L172 · d1GetAnyLink calls (conditional paths may differ): limit, where, from, select, getDatabase, eq, rowsToLinks
    • L177 · d1GetLinkWithMetadata calls (conditional paths may differ): limit, where, from, select, getDatabase, eq, rowsToLinks, withoutQuery
    • L189 · d1HasActiveLinkVersion calls (conditional paths may differ): limit, where, from, select, getDatabase, and, eq, activeCondition
    • L199 · d1GetActiveLinkVersions calls (conditional paths may differ): where, from, select, getDatabase, and, activeCondition, or, expectedLinks.map, eq, rows.map
    • L210 · d1CreateLink calls (conditional paths may differ): getDatabase, buildCreateLinkStatements, db.batch
    • L217 · buildCreateLinkStatements calls (conditional paths may differ): Math.floor, Date.now, buildD1LinkValues, and, eq, returning, onConflictDoUpdate, values, db.insert, isNotNull, lte, where, db.delete, exists, from, db.select, link.tags.map, onConflictDoNothing, select, as
    • L251 · d1CreateLinks calls (conditional paths may differ): getDatabase, importedLinks.map, buildCreateLinkStatements, batches.flatMap, insertIndexes.push, db.batch, batches.map
    • L271 · d1UpdateLink calls (conditional paths may differ): buildD1LinkValues, getDatabase, returning, where, set, db.update, and, eq, db.delete, exists, from, db.select, link.tags.map, onConflictDoNothing, values, db.insert, select, as, db.batch, results.at
    • L297 · d1DeleteLink calls (conditional paths may differ): getDatabase, Math.floor, Date.now, db.batch, where, db.delete, eq, onConflictDoUpdate, values, db.insert
    • L309 · encodeCursor calls (conditional paths may differ): btoa, JSON.stringify
    • L313 · decodeCursor calls (conditional paths may differ): cursor.startsWith, createError, JSON.parse, atob, cursor.slice
    • L331 · d1ListLinks calls (conditional paths may differ): getDatabase, decodeCursor, gt, asc, lt, desc, or, and, eq, exactTagCondition, limit, orderBy, where, from, db.select, statusCondition, rows.slice, page.at, rowsToLinks, encodeCursor
    • L372 · d1IterateAllLinks calls (conditional paths may differ): drizzle, limit, orderBy, where, from, db.select, gt, asc, rows.map, rowToLink, addTagsToLinksFromDatabase, pageLinks.map, rows.at
    • L402 · linkFilterCondition calls (conditional paths may differ): statusCondition, conditions.push, exactTagCondition, eq, withoutQuery, replace, options.q.toLowerCase, or, and
    • L422 · d1SearchLinks calls (conditional paths may differ): getDatabase, $dynamic, orderBy, where, from, db.select, linkFilterCondition, asc, query.limit, rows.map, addTagsToLinksFromDatabase, result.map
    • L432 · d1CountLinks calls (conditional paths may differ): getDatabase, where, from, db.select, count, linkFilterCondition
    • L438 · d1ListTags calls (conditional paths may differ): orderBy, groupBy, innerJoin, from, select, getDatabase, count, eq, asc

    Environment references: event.context.cloudflare.env.DB · env.DB

    server/services/link-proxy.ts ↗
    • L24 · isForwardedRequestHeader calls (conditional paths may differ): PROXY_SKIPPED_REQUEST_HEADERS.has, PROXY_SKIPPED_REQUEST_PREFIXES.some, name.startsWith
    • L51 · buildForwardHeaders calls (conditional paths may differ): Object.entries, getHeaders, isForwardedRequestHeader, name.toLowerCase, headers.set, getHeader, getRequestProtocol, getRequestHost
    • L65 · buildUpstreamResponse calls (conditional paths may differ): upstream.headers.entries, PROXY_SKIPPED_RESPONSE_HEADERS.has, key.toLowerCase, headers.set
    • L81 · proxyLinkRequest calls (conditional paths may differ): isPublicHttpUrl, createError, setTimeout, controller.abort, buildForwardHeaders, toWebRequest, fetch, clearTimeout, buildUpstreamResponse
    server/services/link-store/kv.ts ↗
    • L11 · isActiveExpiration calls (conditional paths may differ): Math.floor, Date.now
    • L15 · logCacheError calls (conditional paths may differ): console.error, String
    • L24 · readLegacyKvLink calls (conditional paths may differ): event.context.cloudflare.env.KV.getWithMetadata, parseLegacyKvLink, isActiveExpiration
    • L40 · putLinkCache calls (conditional paths may differ): getExpiration, event.context.cloudflare.env.KV.put, JSON.stringify, logCacheError
    • L52 · deleteLinkCache calls (conditional paths may differ): event.context.cloudflare.env.KV.delete, logCacheError
    • L61 · isActiveLinkExpiration calls (conditional paths may differ): isActiveExpiration

    Environment references: event.context.cloudflare.env.KV

    server/services/link-store/migration.ts ↗
    • L10 · readCompletedLinkMigrationMarker calls (conditional paths may differ): limit, orderBy, where, from, select, drizzle, eq, desc, toISOString
    • L41 · assertLinkStoreReady calls (conditional paths may differ): readCompletedLinkMigrationMarker, createError
    • L51 · insertMigratedKvLink calls (conditional paths may differ): buildD1LinkValues, bind, DB.prepare, Number, JSON.stringify, link.tags.flatMap, DB.batch

    Environment references: env.DB

    server/services/mcp/server.ts ↗
    • L23 · createMcpServer calls (conditional paths may differ): registerMcpTools
    • L37 · isAllowedOrigin calls (conditional paths may differ): getHeader, getRequestHost
    • L50 · jsonError calls (conditional paths may differ): Response.json
    • L68 · handleMcpRequest calls (conditional paths may differ): isAllowedOrigin, jsonError, createMcpHandler, createMcpServer, console.error, handler.fetch, toWebRequest, handler.close
    server/services/mcp/tools.ts ↗
    • L50 · defineTool calls (conditional paths may differ): tool.handler
    • L202 · toolErrorText calls (conditional paths may differ): isError, console.error
    • L219 · registerMcpTools calls (conditional paths may differ): server.registerTool, replace, tool.name.replace, character.toUpperCase, linkToolNames.has, assertLinkStoreReady, tool.handler, JSON.stringify, toolErrorText
    server/utils/access-log.ts ↗
    • L17 · toBlobNumber calls (conditional paths may differ): blob.replace
    • L78 · logs2blobs calls (conditional paths may differ): map, sort, Object.keys, toBlobNumber, String
    • L84 · blobs2logs calls (conditional paths may differ): Object.keys, blobs.reduce
    • L94 · logs2doubles calls (conditional paths may differ): map, sort, Object.keys, toBlobNumber, Number
    • L100 · doubles2logs calls (conditional paths may differ): Object.keys, doubles.reduce
    • L110 · getCountryName calls (conditional paths may differ): of
    • L119 · collectAccessLog calls (conditional paths may differ): getHeader, getRequestIP, parseURL, parseAcceptLanguage, getResult, flat, includes, useRuntimeConfig, console.log, getCountryName, getFlag, join, filter, Number
    • L189 · writeAccessLog calls (conditional paths may differ): analytics.writeDataPoint, logs2blobs, logs2doubles, console.log

    Environment references: process.env.NODE_ENV · cloudflare.env.ANALYTICS

    server/utils/ai.ts ↗
    • L8 · stripCodeFence calls (conditional paths may differ): content.trim, trimmed.startsWith, trimmed.endsWith, trimmed.split, lines.shift, lines.pop, trim, lines.join
    • L25 · parseAiResponse calls (conditional paths may differ): content.trim, destr, stripCodeFence, Array.isArray
    server/utils/analytics-queries.ts ↗
    • L49 · weightedDistinct calls (conditional paths may differ): sql.ref
    • L53 · weightedReferers calls (conditional paths may differ): sql.ref, sql.lit
    • L59 · filteredQuery calls (conditional paths may differ): buildAnalyticsFilter, useRuntimeConfig, createAnalyticsQuery, analyticsQuery.where
    • L68 · buildCountersQuery calls (conditional paths may differ): select, filteredQuery, as, weightedDistinct, groupBy, statement.select, sql.ref
    • L80 · buildViewsQuery calls (conditional paths may differ): getSafeTimezone, orderBy, groupBy, select, filteredQuery, as, sql.ref, sql.lit
    • L93 · buildMetricsQuery calls (conditional paths may differ): limit, orderBy, groupBy, select, filteredQuery, as, sql.ref, sql.lit
    • L106 · buildHeatmapQuery calls (conditional paths may differ): getSafeTimezone, sql.ref, sql.lit, orderBy, groupBy, select, filteredQuery, as
    • L122 · buildAccessExportQuery calls (conditional paths may differ): orderBy, groupBy, select, filteredQuery, as, sql.ref, weightedDistinct, weightedReferers
    • L135 · buildEventsQuery calls (conditional paths may differ): limit, orderBy, selectAll, filteredQuery, sql.lit
    • L142 · buildLocationsQuery calls (conditional paths may differ): limit, orderBy, groupBy, select, where, filteredQuery, sql.lit, as, sql.ref
    server/utils/analytics-sql.ts ↗
    • L61 · createAnalyticsQuery calls (conditional paths may differ): datasetPattern.test, coldDb.selectFrom
    • L68 · compileAnalyticsQuery calls (conditional paths may differ): query.compile
    server/utils/backup.ts ↗
    • L19 · runCleanup calls (conditional paths may differ): cleanup, console.warn
    • L28 · backupLinksToR2 calls (conditional paths may differ): readCompletedLinkMigrationMarker, console.info, now.toISOString, replace, createBackupJsonStream, iterateAllAuthoritativeLinks, crypto.randomUUID, env.R2.createMultipartUpload, uploadBackupParts, upload.complete, env.R2.get, env.R2.put, String, runCleanup, upload.abort, env.R2.delete

    Environment references: env.R2

    server/utils/cloudflare.ts ↗
    • L4 · useWAE calls (conditional paths may differ): useRuntimeConfig, compileAnalyticsQuery, console.info, $fetch
    server/utils/link-check.ts ↗
    • L11 · getSafeHeaders calls (conditional paths may differ): getHeader, headers.set
    • L23 · checkLink calls (conditional paths may differ): Date.now, toISOString, isPublicHttpUrl, ofetch.raw, catch, response.body.cancel, toErrorMessage
    • L76 · checkLinksPage calls (conditional paths may differ): getSafeHeaders, listLinks, Promise.all, page.links.map, checkLink
    server/utils/cloudflare-access.ts ↗
    • L34 · getAccessTokens calls (conditional paths may differ): filter, getHeader, getCookie
    • L41 · getJwks calls (conditional paths may differ): jwksByTeamDomain.get, createRemoteJWKSet, jwksByTeamDomain.set
    • L52 · verifyCloudflareAccessToken calls (conditional paths may differ): jwtVerify, getJwks, payload.sub.trim, payload.email.trim, payload.common_name.trim
    • L112 · verifyCloudflareAccess calls (conditional paths may differ): useRuntimeConfig, replace, cfAccessTeamDomain.trim, cfAccessAud.trim, getAccessTokens, verifyCloudflareAccessToken
    • L128 · isCloudflareAccessConfigured calls (conditional paths may differ): teamDomain.trim, audience.trim
    • L132 · isCloudflareAccessRequestAllowed calls (conditional paths may differ): isCloudflareAccessRequestSafe, getCookie, getHeader, getRequestURL
    • L150 · isCloudflareAccessRequestSafe calls (conditional paths may differ): includes
    server/utils/backup-json-stream.ts ↗
    • L16 · uploadBackupParts calls (conditional paths may differ): stream.getReader, reader.read, Math.min, buffer.set, next.value.subarray, parts.push, upload.uploadPart, buffer.slice, reader.cancel, reader.releaseLock
    • L61 · createBackupJsonStream calls (conditional paths may differ): count.catch, controller.enqueue, encoder.encode, JSON.stringify, iterator.next, resolveCount, controller.close, rejectCount, iterator.return, controller.error
    server/utils/link-password.ts ↗
    • L14 · bytesToBase64Url calls (conditional paths may differ): String.fromCharCode, replaceAll, btoa
    • L25 · base64UrlToBytes calls (conditional paths may differ): replaceAll, value.replaceAll, base64.padEnd, Math.ceil, Uint8Array.from, atob, char.charCodeAt
    • L31 · encodeText calls (conditional paths may differ): encode
    • L35 · toArrayBuffer calls (conditional paths may differ): bytes.buffer.slice
    • L39 · deriveLinkPasswordHash calls (conditional paths may differ): crypto.subtle.importKey, toArrayBuffer, encodeText, crypto.subtle.deriveBits
    • L62 · parseStoredLinkPassword calls (conditional paths may differ): isHashedLinkPassword, split, password.slice, Number, Number.isSafeInteger, base64UrlToBytes
    • L84 · timingSafeEqual calls (conditional paths may differ): Math.max
    • L95 · hashLinkPassword calls (conditional paths may differ): crypto.getRandomValues, deriveLinkPasswordHash, bytesToBase64Url, encodeText, join, slice
    • L103 · normalizeLinkPasswordForStorage calls (conditional paths may differ): isMaskedLinkPassword, parseStoredLinkPassword, hashLinkPassword
    • L113 · verifyLinkPassword calls (conditional paths may differ): parseStoredLinkPassword, deriveLinkPasswordHash, timingSafeEqual
    • L122 · sanitizeLinkPassword calls (conditional paths may differ): maskLinkPassword
    • L132 · sanitizeLinksPassword calls (conditional paths may differ): links.map, sanitizeLinkPassword
    • L136 · protectLinkPasswordForExport calls (conditional paths may differ): normalizeLinkPasswordForStorage
    server/utils/link-store.ts ↗
    • L25 · normalizeSlug calls (conditional paths may differ): useRuntimeConfig, slug.toLowerCase
    • L30 · buildShortLink calls (conditional paths may differ): getRequestProtocol, getRequestHost
    • L34 · writeThroughCache calls (conditional paths may differ): isActiveLinkExpiration, deleteLinkCache, putLinkCache, d1HasActiveLinkVersion
    • L45 · getLink calls (conditional paths may differ): readLegacyKvLink, readCompletedLinkMigrationMarker, d1GetActiveLink, writeThroughCache
    • L60 · getAuthoritativeLink calls (conditional paths may differ): d1GetActiveLink
    • L64 · getAnyAuthoritativeLink calls (conditional paths may differ): d1GetAnyLink
    • L68 · getLinkWithMetadata calls (conditional paths may differ): d1GetLinkWithMetadata
    • L72 · createLink calls (conditional paths may differ): d1CreateLink, writeThroughCache
    • L82 · writeThroughCaches calls (conditional paths may differ): filter, Promise.all, links.map, isActiveLinkExpiration, deleteLinkCache, putLinkCache, d1GetActiveLinkVersions, cached.map, currentSlugs.has
    • L97 · createLinks calls (conditional paths may differ): d1CreateLinks, fallbackResults.push, createLink, results.flatMap, writeThroughCaches, console.error, successful.map, String, Promise.all, deleteLinkCache, results.map
    • L131 · migrateKvLink calls (conditional paths may differ): insertMigratedKvLink
    • L135 · updateLink calls (conditional paths may differ): d1UpdateLink, writeThroughCache
    • L143 · deleteLink calls (conditional paths may differ): d1DeleteLink, deleteLinkCache
    • L148 · listLinks calls (conditional paths may differ): d1ListLinks
    • L152 · iterateAllAuthoritativeLinks calls (conditional paths may differ): d1IterateAllLinks
    • L156 · searchLinks calls (conditional paths may differ): d1SearchLinks
    • L160 · countLinks calls (conditional paths may differ): d1CountLinks
    • L164 · listTags calls (conditional paths may differ): d1ListTags
    server/utils/public-url.ts ↗
    • L1 · isPublicHttpUrl calls (conditional paths may differ): parsed.hostname.toLowerCase, rawHostname.startsWith, rawHostname.endsWith, rawHostname.slice, rawHostname.replace, hostname.endsWith, isBlockedIp
    • L21 · isBlockedIp calls (conditional paths may differ): hostname.includes, isBlockedIpv6, isBlockedIpv4
    • L28 · isBlockedIpv4 calls (conditional paths may differ): hostname.split, parts.map, test, Number, bytes.some
    • L57 · isBlockedIpv6 calls (conditional paths may differ): Number.parseInt, hostname.split, hostname.match, isBlockedIpv4
    server/utils/query-filter.ts ↗
    • L9 · queryValues calls (conditional paths may differ): some, character.charCodeAt, value.split, values.filter
    • L21 · inFilter calls (conditional paths may differ): sql.ref, sql.join, values.map, sql.lit
    • L28 · buildAnalyticsFilter calls (conditional paths may differ): inFilter, queryValues, filters.push, Object.keys, Math.floor, Number, sql.ref, sql.lit, sql.join
    server/utils/link-processing.ts ↗
    • L32 · assertLinkWritesAllowed calls (conditional paths may differ): useRuntimeConfig, createError
    • L42 · detectUnsafeLink calls (conditional paths may differ): isSafeUrl
    • L47 · prepareIncomingLink calls (conditional paths may differ): normalizeSlug, detectUnsafeLink
    • L52 · hashNewLinkPassword calls (conditional paths may differ): hashLinkPassword
    • L57 · buildLinkResponse calls (conditional paths may differ): sanitizeLinkPassword, buildShortLink
    • L64 · mergeEditableLink calls (conditional paths may differ): Math.max, Math.floor, Date.now
    • L83 · applyEditableLinkPassword calls (conditional paths may differ): hashLinkPassword, normalizeLinkPasswordForStorage
    • L92 · saveNewLink calls (conditional paths may differ): prepareIncomingLink, hashNewLinkPassword, createLink, createError, buildLinkResponse
    • L102 · upsertLink calls (conditional paths may differ): prepareIncomingLink, getAuthoritativeLink, buildLinkResponse, hashNewLinkPassword, createLink, createError
    • L121 · replaceLink calls (conditional paths may differ): assertLinkWritesAllowed, normalizeSlug, getAnyAuthoritativeLink, createError, detectUnsafeLink, mergeEditableLink, applyEditableLinkPassword, updateLink, buildLinkResponse
    • L141 · removeLink calls (conditional paths may differ): assertLinkWritesAllowed, deleteLink, normalizeSlug
    server/utils/markdown.ts ↗
    • L7 · readLimitedBody calls (conditional paths may differ): reader.read, decoder.decode, value.subarray, reader.cancel
    • L38 · fetchPageMarkdown calls (conditional paths may differ): setTimeout, controller.abort, getHeader, headers.set, fetch, response.headers.get, readLimitedBody, contentType.includes, body.slice, AI.toMarkdown, result.data.slice, console.warn, clearTimeout
    server/utils/r2.ts ↗
    • L1 · requireR2Bucket calls (conditional paths may differ): createError

    Environment references: env.R2

    server/utils/redirect-i18n.ts ↗
    • L153 · normalizeLocaleCode calls (conditional paths may differ): code.replace, Intl.getCanonicalLocales
    • L163 · resolveLocaleCode calls (conditional paths may differ): normalizeLocaleCode, SUPPORTED_LOCALES.includes, normalized.split
    • L182 · resolveRedirectLocale calls (conditional paths may differ): resolveLocaleCode, getCookie, getHeader, parseAcceptLanguage
    server/utils/template.ts ↗
    • L16 · buildMetaTags calls (conditional paths may differ): parseURL, startsWith, join, filter, escape
    • L41 · generateCloakingHtml calls (conditional paths may differ): buildMetaTags, escape
    • L64 · generatePasswordHtml calls (conditional paths may differ): escape
    • L106 · generateUnsafeWarningHtml calls (conditional paths may differ): escape
    • L153 · generateOgHtml calls (conditional paths may differ): buildMetaTags, escape
    server/utils/time.ts ↗
    • L3 · getExpiration calls (conditional paths may differ): useRuntimeConfig, useAppConfig, Math.floor, Date.now
    • L15 · isValidTimezone calls (conditional paths may differ): resolvedOptions
    • L25 · getSafeTimezone calls (conditional paths may differ): isValidTimezone
    server/utils/safe-browsing.ts ↗
    • L4 · isSafeUrl calls (conditional paths may differ): useRuntimeConfig, dohUrl.searchParams.set, ofetch, dohUrl.toString, Array.isArray, dnsResult.Answer.some, console.warn
    server/utils/webhook.ts ↗
    • L34 · isWebhookConfigured calls (conditional paths may differ): Boolean, url.trim
    • L38 · createLinkClickedWebhook calls (conditional paths may differ): toISOString, crypto.randomUUID
    • L65 · decodeWebhookSecret calls (conditional paths may differ): secret.startsWith, atob, secret.slice, decoded.charCodeAt
    • L83 · signWebhook calls (conditional paths may differ): crypto.subtle.importKey, decodeWebhookSecret, encode, crypto.subtle.sign, btoa, String.fromCharCode
    • L97 · deliverWebhook calls (conditional paths may differ): includes, Math.floor, Date.now, JSON.stringify, String, headers.set, signWebhook, setTimeout, controller.abort, clearTimeout
    • L132 · handleWebhookDelivery calls (conditional paths may differ): console.error
    • L145 · createWebhookDelivery calls (conditional paths may differ): isWebhookConfigured, deliverWebhook, createLinkClickedWebhook
    • L157 · scheduleWebhookDelivery calls (conditional paths may differ): context.waitUntil, handleWebhookDelivery
    • L162 · queueLinkClickedWebhook calls (conditional paths may differ): useRuntimeConfig, createWebhookDelivery, scheduleWebhookDelivery
    Build and deployment pipeline · 1 GitHub Actions workflow

    Repository CI declarations, separate from runtime request processing. Job dependencies and conditions are shown as written; long commands are shortened with an ellipsis; a workflow file does not prove a recent successful run.

    issue-assistant · .github/workflows/issue-assistant.yml ↗

    Triggers: issues

    issue-assistant · no job dependencies declared

    1. Checkout repositoryactions/checkout@v4
    2. Set up Bunoven-sh/setup-bun@v2
    3. Install opencodecurl -fsSL https://opencode.ai/install | bash
    4. Analyze issueopencode run -m ${{ secrets.OPENCODE_MODEL }} "A new issue #${{ github.event.issue.number }} has been created. Lookup this issue, then do the following: 1. Read README.md and all files under docs/ directory to see if any documentation answers the issue. 2. Search existing issues (excluding #${{ github.event.issue.number }}) for potential duplicates by similarity in title, description, error messages, or functionality. Based on your findings, post AT MOST ONE comment on #${{ github.event.issue.n…
    package.json ↗
    • build:docs: pnpm --filter @sink/docs build
    • prebuild: pnpm build:sphere
    • build: NODE_OPTIONS=--max-old-space-size=8192 nuxt build
    • postbuild: test "$CF_PAGES:$CF_PAGES_BRANCH" != "1:master" || pnpm db:migrate:remote
    • build:map: node scripts/build-map.js
    • build:sphere: node scripts/build-sphere.js
    • build:colo: node scripts/build-colo.js
    • build:testimonials: node scripts/build-testimonials.js
    • deploy:config: node scripts/cloudflare-deploy-config.mjs
    • deploy: pnpm deploy:pages
    • deploy:pages: pnpm db:migrate:remote && wrangler pages deploy dist
    • deploy:worker: pnpm db:migrate:remote && wrangler deploy .output/server/index.mjs --assets .output/public --config wrangler.deploy.jsonc
    docs/package.json ↗
    • build: vitepress build .
    • deploy: pnpm build && wrangler deploy --config ./wrangler.jsonc

    Full upstream document by @miantiao-me · README.md · snapshot bafa4e1

    ⚡ Sink

    A Simple, Speedy, Secure, and Serverless Link Shortener with Analytics, Running Entirely on Cloudflare.

    Website · Documentation · API Reference

    miantiao-me/Sink | Trendshift Featured on Hacker News Featured|HelloGitHub Uneed Badge

    DeepWiki Cloudflare Nuxt Tailwind CSS shadcn/ui License

    Hero


    ✨ Features

    • 🔗 URL Shortening: Compress your URLs to their minimal length.
    • 📈 Analytics: Monitor link analytics and gather insightful statistics.
    • ☁️ Serverless: Deploy without the need for traditional servers.
    • 🎨 Customizable Slug: Support personalized slugs, UTM parameters, and optional case-sensitive slug matching through configuration.
    • 🪄 AI Assistance: Optionally use Cloudflare Workers AI to generate slugs and OpenGraph metadata from page content.
    • ⏰ Link Control: Set expirations, passwords, and unsafe-link warning pages.
    • 📱 Smart Routing: Redirect visitors by device or country.
    • 🖼️ Social Preview: Customize social previews with titles, descriptions, and images.
    • 📊 Near-real-time Analytics: Display a live 3D globe and event logs using 10-second analytics polling and client-side replay, not SSE or WebSocket.
    • 🔲 QR Code: Generate QR codes for your short links.
    • 📦 Import/Export: Transfer links via JSON and export access analytics via CSV.
    • 🌍 Multi-language: Full i18n support for dashboard and redirect pages.

    [!TIP] Who is Sink for?

    Sink focuses on individuals and small teams who want a simple, self-hosted shortener on Cloudflare.

    For professional / business needs (managed service, multi-user, SLA, and more), use S.EE.

    🪧 Demo

    Experience the demo at Sink.Cool. Log in using the Site Token below:

    Site Token: SinkCool
    
    Screenshots Analytics Links Link Analytics

    🔀 Sibling versions

    Sink and Slite are sibling versions of the same link-management and analytics project. Sink runs on Cloudflare's serverless platform, while Slite runs as a local Node.js 24+/Docker process. They keep features, API contracts, and file organization compatible with each other wherever practical. Neither version is a legacy branch, and Slite is not a fork replacement for Sink.

    🧱 Technologies Used

    🚗 Roadmap [WIP]

    We welcome your contributions and PRs.

    • Browser Extension - Sink Tool
    • Chrome Extension - Sink Quick Shorten
    • Raycast Extension - Raycast-Sink
    • Apple Shortcuts - Sink Shortcuts
    • iOS App - Sink
    • Enhanced Link Management (with Cloudflare D1)
    • Analytics Enhancements (Multi-link filtering)
    • Dashboard Performance Optimization (Infinite loading)
    • API, migration, backup, and redirect tests

    🏗️ Deployment

    Video tutorial: Watch here

    We currently support deployment to Cloudflare Workers (recommended) and Cloudflare Pages (deprecated).

    ⚒️ Configuration

    Configuration Docs

    🔌 API

    API Docs · Live Scalar Reference for the public demo instance

    🤖 AI Skills

    Install Sink AI Skills for enhanced coding assistance:

    npx skills add miantiao-me/sink
    

    🧰 MCP

    Sink serves a built-in MCP endpoint at POST /api/mcp, using the official @modelcontextprotocol/server SDK v2, serving modern clients over the per-request transport and 2025-era clients over a stateless fallback with JSON responses.

    Replace the domain below with your own instance, and use the NUXT_SITE_TOKEN from your instance's environment variables as the bearer token.

    claude mcp add --transport http sink https://sink.cool/api/mcp --header "Authorization: Bearer SinkCool"
    

    Any client that supports an HTTP transport with custom headers can connect the same way:

    {
      "mcpServers": {
        "sink": {
          "type": "http",
          "url": "https://sink.cool/api/mcp",
          "headers": {
            "Authorization": "Bearer SinkCool"
          }
        }
      }
    }
    

    It exposes tools for managing links (list, search, read, count, tag, create, update, upsert, delete) and for reading analytics (counters, views over time, and top values per dimension). See the integrations documentation for the full list.

    🙋🏻 FAQs

    FAQs

    💖 Credits

    1. Cloudflare
    2. NuxtHub
    3. Astroship
    4. Tailark

    📄 License

    AGPL-3.0-only © miantiao-me

    ☕ Sponsor

    1. Follow Me on X (Twitter).
    2. Become a sponsor on GitHub.

    Frequently asked about Sink

    What is Sink?+

    Sink is a self-hosted Bitly/Rebrandly alternative built on the Cloudflare developer platform. Cloudflare short links with analytics, QR codes and routing controls.

    What does Sink replace?+

    Sink is listed as an alternative to Bitly, Rebrandly. Compare the features and tradeoffs before migrating.

    What Cloudflare primitives does Sink use?+

    Sink is built on Analytics Engine, D1, KV, R2, Workers, Workers AI.

    How much does Sink cost to run?+

    The reviewed Cloudflare deployment is eligible for Free-plan allowances for the stated small workload and feature scope. Usage limits, CPU, required account setup and separate services apply. Replace committed resource IDs using the documented DEPLOY configuration and configure a private NUXT_SITE_TOKEN. Keep dynamic requests/CPU, D1 row/storage and KV read/write quotas within Workers Free limits; links are not limited only by the request allowance. Analytics Engine Free currently includes 100,000 written points/day and 10,000 read queries/day; future billing/pricing must be rechecked. If optional AI is used, stay below 10,000 Neurons/day; if R2 snapshots are enabled, include retention in Standard R2 storage/operation quotas. Exclude the docs Worker from app topology; AI and backup storage are optional features and may add costs when enabled beyond quotas. Workers Free dynamic requests are shared across this account (100,000/day), with 10 ms CPU per invocation; workload fit is conditional and has not been measured. D1 Free allowance: 5 million rows read/day, 100,000 rows written/day and 5 GB total storage; unindexed scans and history retention consume quota. KV Free allowance: 100,000 keys read/day and 1,000 each writes/deletes/list requests/day; this may constrain updates before Worker request limits. R2 Standard allowance: 10 GB-month storage, 1 million Class A and 10 million Class B operations/month; account activation may require billing setup, and other storage classes are excluded. Check current Cloudflare pricing before deploying.

    Is Sink open source?+

    The upstream repository declares the AGPL-3.0-only license. Read its terms at https://raw.githubusercontent.com/miantiao-me/Sink/bafa4e1f7e3ec034929e11e5542c4c3e116d69da/LICENSE. Source code and contributor credit are available at https://github.com/miantiao-me/Sink.

    Community rating

    No ratings yet. Tried this project? Share your experience.

    One rating per verified account. You can change or remove yours. Accounts are email verified; use of the software is self-reported.

    Discuss your experience ↓
    Sign in to rate

    Discussion · 0

    sign in to comment →
    No comments yet — be the first.