Integration Module 2.0 for Medusa is outRead the announcement
L

Link in bio

Link-in-bio pages for Medusa v2: profile, drag-and-drop links, live products with price and stock, collections, promo codes, blog posts, WhatsApp, scheduling, per-locale text, click counts without cookies, UTM, QR codes, typed Store API — by Haus Kayu

npm install medusa-link-in-bio
Category
Built by
Version
0.2.1
Last updated
2 days ago
Monthly downloads
Loading downloads

Haus Kayu

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.

npm CI Medusa license: MIT

Compatibility

PluginMedusaNodeTested in CI on
0.1.x2.19.0 or newer 2.x ()20.19+ or 22.12+Medusa 2.19.0 and 2.22.2

No other service needed. 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

npx medusa db:migrate

Open Link in bio in the Admin sidebar, create the page , add items, publish. The storefront reads and renders it; every item links to , which counts the click and redirects. Kiln ships the page at out of the box; for any other storefront see Storefront.


English

Features

  • Pages: handle (, , …), internal name, avatar, 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, , optional share image. As many pages as you like.
  • 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 URL.
    • Product: picked from the catalogue; the Store API returns title, thumbnail, the lowest variant price in the visitor's region () and 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: link with a prefilled message. Contact: phone () or e-mail ().
    • Heading and Divider to group links.
  • Clicks are counted on the server by the redirect (302). Stored: item, UTC day, count. Not stored: IP, user agent, referrer, cookies, fingerprints. Known bots and link previewers (via isbot) and visitors sending or are 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: are added to product, collection, category, article, promo and plain links, unless the link already carries its own parameters. Names are options; switch off per page or per item. Never added to WhatsApp, or .
  • QR codes in the Admin for every page (per language) and every link, as SVG or PNG (up to 4096 px).
  • Security: only absolute URLs without credentials are accepted (no , , 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 () for the Store and Admin endpoints; Admin in English and Indonesian.

Plugin options

tells the storefront about public changes: every change to a page or its items within (default 2000) becomes one to , with the secret in the header ( renames it). is set when a page was deleted. Kiln's takes this payload and re-renders and in every market; another storefront can do the same.

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 (). To keep links on your own domain, proxy to it and forward , , and the visitor's address (Kiln does this with ); otherwise set to the backend's public .

A page can be rendered without any client-side JavaScript except a "copy" button for promo codes; says whether to add . lists the published pages (handle, locales), which is also how a storefront detects the plugin.

Store API

RouteAnswer
published pages
in one locale (, , else the page's default); visible items only
302 to the item's destination; 404 unknown key; 410 unavailable

Both store routes need the publishable API key; does not.

Admin API

, (GET, POST), (GET with items + counts, POST, DELETE), (GET, POST), (GET, POST, DELETE), (POST ), , , . Rule violations answer with codes , , , , , , , , . in wraps all of them.

Limits

  • Clicks are buffered in memory for (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 from the storefront to the backend (Kiln does), or set to any address that forwards to the backend's .

What happens to a link when the product is deleted or the article unpublished? It disappears from the page and answers 410 until you point the item elsewhere. The Admin marks such items "Target missing".


Bahasa Indonesia

Fitur

  • Halaman: handle (, , …), nama internal, avatar, nama tampil dan bio per bahasa, judul dan deskripsi SEO, ikon sosial, warna dan bentuk (latar, teks, tombol; siku sampai pil), status tayang, , gambar bagikan opsional. Jumlah halaman bebas.
  • 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 ( dengan pesan), kontak (telepon/e-mail), judul, pemisah.
  • Klik dihitung di server lewat redirect (302). Disimpan: item, hari UTC, jumlah. Tidak disimpan: IP, user agent, referrer, cookie. Bot dan pratinjau tautan serta pengunjung dengan / tetap diarahkan tapi tidak dihitung. Admin menampilkan 7 hari, 30 hari, total, dan grafik batang 30 hari.
  • UTM otomatis (, , = handle halaman, = key item) untuk tautan web; tautan yang sudah punya dibiarkan; bisa dimatikan per halaman atau per item.
  • Kode QR per halaman (per bahasa) dan per tautan, SVG atau PNG.
  • Keamanan: hanya URL 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

npx medusa db:migrate

Buka Link in bio di Admin, buat halaman , tambah item, tayangkan. Storefront membaca ; setiap item mengarah ke yang menghitung klik lalu mengarahkan ke tujuan. Kiln sudah menyajikan halamannya di (dan ).

Alur

  1. Admin membuat halaman dan item; tautan internal (produk, koleksi, artikel) dibentuk dari + pola path + prefix bahasa.
  2. Pengunjung membuka ; storefront mengambil halaman per bahasa dan region, menampilkan harga dan stok.
  3. Pengunjung mengetuk item → di storefront → diteruskan ke backend → hitungan hari itu +1 → 302 ke tujuan dengan UTM.
  4. Admin melihat klik per item dan per hari, mengunduh QR untuk kemasan atau kartu.

Development

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

Support

License

MIT © Haus Kayu