Link in Bio
Shoppable link-in-bio pages
medusa-link-in-bio
The link in your Instagram, TikTok or WhatsApp profile, served by your Medusa store. Pages with a profile and drag-and-drop items: plain links, products with live price and stock for the visitor's region, collections, categories, promo codes to copy, blog articles (medusa-blog-seo), WhatsApp and contact, headings. Several pages (per campaign, per market), text per language, show/hide on a schedule, click counts without cookies, automatic UTM, QR codes, a typed Store API and a storefront integration for Kiln.
Tautan di profil Instagram, TikTok, atau WhatsApp yang disajikan toko Medusa Anda: halaman profil dengan item drag-and-drop (tautan, produk dengan harga dan stok live, koleksi, kategori, kode promo, artikel, WhatsApp, kontak), banyak halaman, teks per bahasa, jadwal tampil, klik terhitung tanpa cookie, UTM otomatis, kode QR.
Compatibility
Plugin Medusa Node Tested in CI on 0.1.x – 0.2.x 2.19.0 or newer 2.x (Copy to clipboard^2.19.0) 20.19+ or 22.12+ Medusa 2.19.0 and 2.22.2
No other service needed (images go through Medusa's File Module, whichever provider the project uses). With Redis as Medusa's Cache Module the rate limit is shared by every server process. medusa-blog-seo is optional (the "Article" item type).
Quick start
1npm install medusa-link-in-bio
123456789101112// medusa-config.tsplugins: [{resolve: "medusa-link-in-bio",options: {storefront: {url: "https://your-store.com", // where the pages are servedlocales: { en: { prefix: "/us" } }, // per-locale prefix or origin (optional)},},},],
1npx medusa db:migrate
Open Link in bio in the Admin sidebar, create the page Copy to clipboardlinks, add items, publish. The storefront reads Copy to clipboardGET /store/link-in-bio/pages/links?locale=id®ion_id=… and renders it; every item links to Copy to clipboard/l/{key}, which counts the click and redirects. Kiln ships the page at Copy to clipboard/links out of the box; for any other storefront see Storefront.
English
Features
- Pages: handle (Copy to clipboard
links, Copy to clipboardramadan-2026, …), internal name, display name and bio per locale, SEO title/description, social icons (Instagram, TikTok, Facebook, X, YouTube, Pinterest, LinkedIn, Threads, WhatsApp, Telegram, Shopee, Tokopedia, Etsy, e-mail, website), colours and shape (background, text, buttons; square to pill; solid/outline/soft), published flag, Copy to clipboardnoindex, optional share image. As many pages as you like. - Profile images uploaded in the Admin (drag and drop or file picker) and stored through Medusa's File Module — local Copy to clipboard
static, S3, R2, whatever the project uses: an avatar (round) and a hero header image. JPEG, PNG, WebP or AVIF recognised by their first bytes (the file name and declared type are not trusted), at most 5 MB, SVG never. Preview with a focal point set by clicking (kept in view when the storefront crops: avatar 1:1, hero 16:9 or 3:2), alt text per locale. Replacing or removing deletes the previous file, so nothing piles up; pasting an external URL instead still works. Two profile styles per page: circle (the avatar, or the initials) and hero (the header image full width, fading into the page colour, the name and bio right under it; a switch per page puts the avatar small over its edge instead). - Items, drag-and-drop ordered, each with label and second line per locale, optional image or icon, "featured" size, visible switch and a show-from / hide-after schedule:
- Link: any Copy to clipboard
http(s)URL. - Product: picked from the catalogue; the Store API returns title, thumbnail, the lowest variant price in the visitor's region (Copy to clipboard
region_id) and stock (Copy to clipboardin_stock, units) scoped to the publishable key's sales channel. - Collection / Category: title + storefront URL.
- Promo code: the code to copy, optionally with a link that opens the shop with it.
- Article: a medusa-blog-seo post, or "always the latest"; title, excerpt, cover, slug per locale.
- WhatsApp: Copy to clipboard
wa.melink with a prefilled message. Contact: phone (Copy to clipboardtel:) or e-mail (Copy to clipboardmailto:). - Heading and Divider to group links.
- Link: any Copy to clipboard
- Clicks are counted on the server by the redirect Copy to clipboard
GET /l/{key}(302). Stored: item, UTC day, count. Not stored: IP, user agent, referrer, cookies, fingerprints. Known bots and link previewers (via isbot) and visitors sending Copy to clipboardDNT: 1or Copy to clipboardSec-GPC: 1are redirected but not counted. The Admin shows 7-day, 30-day and total counts per item and page, and a 30-day bar chart. - UTM: Copy to clipboard
utm_source=link-in-bio&utm_medium=social&utm_campaign={page handle}&utm_content={item key}are added to product, collection, category, article, promo and plain links, unless the link already carries its own Copy to clipboardutm_*parameters. Names are options; switch off per page or per item. Never added to WhatsApp, Copy to clipboardtel:or Copy to clipboardmailto:. - QR codes in the Admin for every page (per language) and every link, drawn by the plugin from the module matrix with error correction H: round dots, rounded "eyes", a logo in the centre on a clean white badge (the brand logo from the Copy to clipboard
qr.logooption, or one uploaded per page; about 5 % of the area), a proper quiet zone. Light (black on white) or dark theme (white on a black rounded card, corners transparent — the Admin notes that some older scanners cannot read inverted codes). SVG for print and PNG at 1024, 2048 or 4096 px. Every variant is decoded in the test suite (jsQR) at 256–1024 px, with and without logo. - Security: only absolute Copy to clipboard
http(s)URLs without credentials are accepted (no Copy to clipboardjavascript:, Copy to clipboarddata:, relative paths); the redirect only ever sends a visitor to a URL an admin saved, nothing in the request chooses the target; per-IP rate limit on the public routes (300 requests / 10 minutes by default, hash of the address in the cache only); unpublished pages, hidden, scheduled, expired items and deleted targets answer 410; QR codes are generated from stored data, not from a URL in the query. Every write is an Admin route. - Typed SDK (Copy to clipboard
medusa-link-in-bio/sdk) for the Store and Admin endpoints; Admin in English and Indonesian.
Plugin options
1234567891011121314151617181920{resolve: "medusa-link-in-bio",options: {storefront: {url: "https://your-store.com",locales: { en: { prefix: "/us" }, de: { origin: "https://your-store.de" } },main_handle: "links", // served at paths.main instead of paths.pagepaths: {main: "/links",page: "/links/{handle}",product: "/products/{handle}",collection: "/collections/{handle}",category: "/categories/{handle}",post: "/blog/{slug}",},},redirect_url: "https://your-store.com/l/{key}", // default: storefront.url + /l/{key}, else backend_url + /l/{key}backend_url: "https://api.your-store.com", // for the fallback redirect addressutm: { source: "link-in-bio", medium: "social" },clicks: { enabled: true, flush_ms: 5000, count_bots: false, respect_dnt: true },
Copy to clipboardqr.logo is a square PNG/JPEG/WebP (an https URL fetched and cached for ten minutes, or an absolute path on the server) drawn in the centre of every QR code on a white badge; a page can upload its own in the Admin instead. The images themselves (avatar, hero, QR logo) are stored through the File Module, so configure a provider with public URLs the storefront can reach (the default local provider serves Copy to clipboard./static).
Copy to clipboardrevalidate tells the storefront about public changes: every change to a page or its items within Copy to clipboarddelay_ms (default 2000) becomes one Copy to clipboardPOST { link_in_bio: { handles: ["links", …], all } } to Copy to clipboardurl, with the secret in the Copy to clipboardx-revalidate-secret header (Copy to clipboardheader renames it). Copy to clipboardall is set when a page was deleted. Kiln's Copy to clipboard/api/revalidate takes this payload and re-renders Copy to clipboard/links and Copy to clipboard/links/{handle} in every market; another storefront can do the same.
Copy to clipboardstorefront.url is what makes internal links (products, collections, articles, the pages themselves) and the default redirect address; without it those items have no destination and are left out of the public page.
Storefront
The redirect lives on the backend (Copy to clipboard/l/{key}). To keep links on your own domain, proxy Copy to clipboard/l/* to it and forward Copy to clipboardUser-Agent, Copy to clipboardDNT, Copy to clipboardSec-GPC and the visitor's address (Kiln does this with Copy to clipboardmarkets.passthrough); otherwise set Copy to clipboardredirect_url to the backend's public Copy to clipboard/l/{key}.
12345678910import Medusa from "@medusajs/js-sdk"import { linkInBioStore } from "medusa-link-in-bio/sdk"const sdk = new Medusa({ baseUrl: BACKEND_URL, publishableKey: KEY })const { page } = await linkInBioStore(sdk).page("links", { locale: "id", region_id })// page.title, page.bio, page.avatar, page.theme, page.socials, page.urls (per locale, for hreflang)for (const item of page.items) {// item.type, item.label, item.note, item.image, item.href (the counted link) , item.url (where it ends up)// item.product?.price.amount / currency_code, item.product?.in_stock, item.promo?.code, item.post?.excerpt …}
A page can be rendered without any client-side JavaScript except a "copy" button for promo codes; Copy to clipboardpage.noindex says whether to add Copy to clipboard<meta name="robots" content="noindex">. Copy to clipboardGET /store/link-in-bio/pages lists the published pages (handle, locales), which is also how a storefront detects the plugin.
Store API
Route Answer Copy to clipboardGET /store/link-in-bio/pages Copy to clipboard{ pages: [{ id, handle, locales, noindex, updated_at }] } published pages Copy to clipboardGET /store/link-in-bio/pages/{handle}?locale=®ion_id= Copy to clipboard{ page } in one locale (Copy to clipboard?locale, Copy to clipboardx-medusa-locale, else the page's default); visible items only Copy to clipboardGET /l/{key}[?l=locale] 302 to the item's destination; 404 unknown key; 410 unavailable
Both store routes need the publishable API key; Copy to clipboard/l/{key} does not.
Admin API
Copy to clipboard/admin/link-in-bio/config, Copy to clipboard/pages (GET, POST), Copy to clipboard/pages/{id} (GET with items + counts, POST, DELETE), Copy to clipboard/pages/{id}/items (GET, POST), Copy to clipboard/pages/{id}/items/{itemId} (GET, POST, DELETE), Copy to clipboard/pages/{id}/items/reorder (POST Copy to clipboard{ ids }), Copy to clipboard/pages/{id}/upload?slot=avatar|hero|qr_logo (POST multipart field Copy to clipboardfile; DELETE removes the image), Copy to clipboard/pages/{id}/stats?days=30, Copy to clipboard/qr?page_id=&locale=|item_id=&format=svg|png&size=&download=1&theme=light|dark&logo=brand|page|none, Copy to clipboard/search?type=product|collection|category|post&q=. Page fields for the images: Copy to clipboardavatar, Copy to clipboardhero, Copy to clipboardqr_logo (URLs), Copy to clipboardprofile_style (Copy to clipboardcircle | Copy to clipboardhero), Copy to clipboardhero_ratio (Copy to clipboard16:9 | Copy to clipboard3:2), Copy to clipboardhero_avatar (boolean, default false: with the hero style, draw the avatar small over the hero's edge), Copy to clipboardfocus: { avatar, hero } (Copy to clipboard{ x, y } in percent, null = centre), Copy to clipboarduploads (which of them the plugin owns), translations Copy to clipboardavatar_alt / Copy to clipboardhero_alt. Rule violations answer Copy to clipboard{ code, message, detail } with codes Copy to clipboardinvalid_url, Copy to clipboardinvalid_handle, Copy to clipboardhandle_taken, Copy to clipboardreserved_handle, Copy to clipboardinvalid_locale, Copy to clipboardinvalid_target, Copy to clipboardinvalid_date, Copy to clipboardinvalid_image, Copy to clipboardfile_too_large (413), Copy to clipboardinvalid, Copy to clipboardnot_found. Copy to clipboardlinkInBioAdmin(sdk) in Copy to clipboardmedusa-link-in-bio/sdk wraps all of them (Copy to clipboardupload(id, slot, file), Copy to clipboardremoveUpload, Copy to clipboardqrUrl({ theme, logo })).
Limits
- Clicks are buffered in memory for Copy to clipboard
clicks.flush_ms(5 s) before they are written; a crash in that window loses those few counts. Counts are per UTC day. - A page lists up to 500 items; the Admin shows up to 200 pages.
- Product stock follows the publishable key's sales channel when the key has exactly one; otherwise it is summed over all stock locations.
FAQ
Why a redirect instead of counting in the browser? It works without JavaScript, counts taps from in-app browsers that block scripts, and needs no cookie banner: nothing about the visitor is stored.
Can I use my own domain for the short links? Yes: proxy Copy to clipboard/l/* from the storefront to the backend (Kiln does), or set Copy to clipboardredirect_url to any address that forwards to the backend's Copy to clipboard/l/{key}.
What happens to a link when the product is deleted or the article unpublished? It disappears from the page and Copy to clipboard/l/{key} answers 410 until you point the item elsewhere. The Admin marks such items "Target missing".
Bahasa Indonesia
Fitur
- Halaman: handle (Copy to clipboard
links, Copy to clipboardramadan-2026, …), nama internal, nama tampil dan bio per bahasa, judul dan deskripsi SEO, ikon sosial, warna dan bentuk (latar, teks, tombol; siku sampai pil), status tayang, Copy to clipboardnoindex, gambar bagikan opsional. Jumlah halaman bebas. - Gambar profil diunggah dari Admin (drag & drop / pilih file) lewat File Module Medusa (lokal, S3, R2 — apa pun yang dipakai proyek): avatar (bulat) dan hero (gambar header). JPEG/PNG/WebP/AVIF dikenali dari magic bytes, maks 5 MB, SVG ditolak. Pratinjau dengan titik fokus (klik gambar; dipakai saat dipotong: avatar 1:1, hero 16:9 atau 3:2), teks alt per bahasa. Ganti/hapus menghapus file lama (tidak ada file yatim). Dua gaya profil per halaman: lingkaran (avatar atau inisial) dan hero (header lebar penuh yang memudar ke warna latar, nama dan bio langsung di bawahnya; saklar per halaman menampilkan avatar kecil di tepi bawahnya).
- Item diurutkan drag-and-drop, masing-masing dengan label dan baris kedua per bahasa, gambar atau ikon, ukuran unggulan, saklar tampil, dan jadwal tampil-mulai / sembunyikan-setelah: tautan, produk (harga terendah di region pengunjung + stok, live), koleksi, kategori, kode promo (disalin sekali ketuk, opsional dengan tautan), artikel medusa-blog-seo (pilih satu atau selalu yang terbaru), WhatsApp (Copy to clipboard
wa.medengan pesan), kontak (telepon/e-mail), judul, pemisah. - Klik dihitung di server lewat redirect Copy to clipboard
GET /l/{key}(302). Disimpan: item, hari UTC, jumlah. Tidak disimpan: IP, user agent, referrer, cookie. Bot dan pratinjau tautan serta pengunjung dengan Copy to clipboardDNT: 1/ Copy to clipboardSec-GPC: 1tetap diarahkan tapi tidak dihitung. Admin menampilkan 7 hari, 30 hari, total, dan grafik batang 30 hari. - UTM otomatis (Copy to clipboard
utm_source, Copy to clipboardutm_medium, Copy to clipboardutm_campaign= handle halaman, Copy to clipboardutm_content= key item) untuk tautan web; tautan yang sudah punya Copy to clipboardutm_*dibiarkan; bisa dimatikan per halaman atau per item. - Kode QR per halaman (per bahasa) dan per tautan, digambar plugin sendiri (koreksi kesalahan H): modul titik bulat, "mata" kotak membulat, logo di tengah pada lencana putih bersih (logo brand dari opsi Copy to clipboard
qr.logoatau unggahan per halaman), quiet zone cukup. Tema terang (hitam di putih) atau gelap (putih di kartu hitam membulat; Admin mengingatkan sebagian pemindai lama tidak membaca kode terbalik). SVG untuk cetak, PNG 1024/2048/4096 px. Semua varian diuji decode (jsQR) di rangkaian tes. - Keamanan: hanya URL Copy to clipboard
http(s)absolut tanpa kredensial; redirect hanya ke URL yang disimpan admin (bukan open redirect); rate limit per IP di route publik; halaman tidak tayang / item tersembunyi / kedaluwarsa menjawab 410.
Pasang
1npm install medusa-link-in-bio
1plugins: [{ resolve: "medusa-link-in-bio", options: { storefront: { url: "https://toko-anda.com", locales: { en: { prefix: "/us" } } } } }]
1npx medusa db:migrate
Buka Link in bio di Admin, buat halaman Copy to clipboardlinks, tambah item, tayangkan. Storefront membaca Copy to clipboard/store/link-in-bio/pages/links?locale=id®ion_id=…; setiap item mengarah ke Copy to clipboard/l/{key} yang menghitung klik lalu mengarahkan ke tujuan. Kiln sudah menyajikan halamannya di Copy to clipboard/links (dan Copy to clipboard/us/links).
Alur
- Admin membuat halaman dan item; tautan internal (produk, koleksi, artikel) dibentuk dari Copy to clipboard
storefront.url+ pola path + prefix bahasa. - Pengunjung membuka Copy to clipboard
/links; storefront mengambil halaman per bahasa dan region, menampilkan harga dan stok. - Pengunjung mengetuk item → Copy to clipboard
/l/{key}di storefront → diteruskan ke backend → hitungan hari itu +1 → 302 ke tujuan dengan UTM. - Admin melihat klik per item dan per hari, mengunduh QR untuk kemasan atau kartu.
Development
1234npm cinpm run buildnpm run lint && npm run typecheck && npm run test:unitnpm run test:e2e # Postgres on the spike port, see CONTRIBUTING.md
The end-to-end suite starts Medusa with the plugin, creates a region, products with stock, a collection and a category, then drives the Admin API (pages, items of every type, reorder, QR, search, stats), the Store API (locales, prices, stock, UTM, scheduling) and the redirect (bots, DNT, dead links, rate limit), on Medusa 2.19.0 and 2.22.2 in CI.
Built for hauskayu.com
Built and used in production by Haus Kayu, handmade teak homeware from Jepara: hauskayu.com/links runs on this plugin and the Kiln storefront.
Other plugins by Haus Kayu
- medusa-blog-seo: multilingual blog with SEO built in.
- medusa-reviews-wishlist: verified product reviews with photos, review-request e-mails and wishlists.
- medusa-storage-r2: Cloudflare R2 file storage configured from the Admin.
- medusa-payment-doit: doit.id payments (QRIS, Virtual Account) for Indonesia.
- medusa-payment-manual-transfer: manual bank transfer with payment-proof upload and admin verification.
- medusa-fulfillment-zone-rate: calculated shipping by zone and chargeable weight, with shipment tracking.
Support
- Issues and feature requests: GitHub issues
- E-mail: dev@hauskayu.com
License
MIT © Haus Kayu
