The URL shortener
you actually own.

A premium, single-file URL shortener built exclusively for Cloudflare Workers. Zero databases to manage, zero monthly fees, and absolutely zero bloat.

Generate
Directory
Update
https://gitlab.com/nimd/tynim
repo
Never
Deploy Link

Engineering over constraints.

Built to operate strictly within the free tier of Cloudflare Workers without sacrificing functionality.

O(1) Master Index

Say goodbye to N+1 database queries. Tynim consolidates your links into a single master index, meaning loading your entire directory costs exactly 1 read operation.

Hardware-Level TTL

Create ephemeral links that self-destruct after 1, 24, or 168 hours. It utilizes native Cloudflare KV TTL parameters, requiring zero cron jobs to manage.

Zero Dependencies

No massive Node.js frameworks, no package managers, no build steps. It is a single JavaScript file that cannot be broken by upstream repository updates.

Deployment Guide

Deploy securely to your Cloudflare account in under 3 minutes.

1

Provision Database

  • Open your Cloudflare Dashboard and navigate to Storage & Databases > Workers KV in the left sidebar.
  • Click Create a namespace.
  • Name your namespace exactly as shown below, then click Add:
tynim_db
2

Create Application

  • In the left sidebar, go to Compute > Workers & Pages.
  • Click Create Application, then Create Worker.
  • Keep the default "Hello World" template selected, name it (e.g., tynim), and click Deploy.
3

Configure Bindings & Secrets

Click on your newly created worker and navigate to the Settings tab.

1. Link Database

Under Bindings, click + Add Binding > KV Namespace.

Variable Name LINKS

* Select your tynim_db from the dropdown, then save/deploy.

2. Set Admin Password

Under Variables and Secrets, click Add.

Type Secret
Variable Name PASSWORD

* Enter your desired master password in the Value field and deploy.

4

Deploy Engine

You can inject the Tynim routing matrix using one of two methods:

  • Click Edit Code in the top right of your worker page.
  • Delete all the template code in the left pane.
  • Paste the contents of the master script and click Deploy.
index.js (Raw Code)
5

Connect Custom Domain

While your worker defaults to a *.workers.dev address, connecting a custom domain (e.g., link.yourdomain.com) makes it truly yours.

  • Go to your worker's Domains tab.
  • Click + Add Domain and type your desired short URL.
  • Once connected, click the globe icon next to your new URL to load your shortener!

Global Configuration

Tynim is designed to be fully customized without touching the complex routing logic. Simply edit the `CONFIG` object at the very top of your worker file.

worker.js (Lines 1-20)
const CONFIG = {
  // --- SYSTEM SETTINGS ---
  cors: "on",             // "on" or "off"
  unique_link: false,     // If true, identical target URLs return same alias
  custom_link: true,      // Allow users to input custom aliases
  
  // --- BRANDING ---
  app_title: "Tynim",
  app_subtitle: "URL Shortener",
  author_name: "NiMD",
  repo_url: "https://gitlab.com/nimd/tynim",
  
  // --- THEME COLORS ---
  theme_bg: "#09090b",
  theme_surface: "#18181b",
  theme_border: "#27272a",
  theme_text: "#f4f4f5",
  theme_muted: "#a1a1aa",
  theme_brand: "#ffffff",
  // ...
};
Copied to clipboard