Run your own shareables system — branded pages, link previews, and one-command publishing — on your domain, in about ten minutes.
The download is the engine — scripts, manifest, Vercel config, OG function, and agent docs. Unzip it, point it at your domain, push to git. The harness tabs below teach your assistant how to publish once the engine is live.
| File | What it does |
|---|---|
| SETUP.md | First-time walkthrough — mirror folder, domain swap, git + Vercel import, npm install. |
| SKILL.md | Agent skill — triggers on “share this / publish this”. Full workflow and gotchas. |
| commands/publish.md | Slash command — /publish scaffolds a new page or updates an existing one. |
| scripts/publish.mjs | One-shot pipeline — copy page → upsert manifest → build index → commit → push → verify URL. |
| build-index.cjs | Regenerates homepage + project listings and injects managed <!-- og:auto --> meta into each leaf. |
| api/og.js | Vercel Function — renders 1200×630 OG cards on demand via @vercel/og (no local Chrome). |
| lib/og-manifest.js | Generated by build-index.cjs; titles/projects for the OG function. |
| api/flags.js | Vercel Edge Function — optional live key-value store (votes/flags/counters/reactions). |
| lib/live-kv.js | Browser drop-in — adds real-time interactivity to any page with a few lines. |
| lib/live-pages.js | Generated by build-index.cjs; allowlist of pages flagged live: true. |
| login/, api/{login,register,me,logout}.js | Visitor accounts — admin env login + self-serve signup for live pages. |
| lib/session.js, lib/users.js | HMAC session cookie + KV-backed PBKDF2 visitor account store. |
| shareables.json | Manifest — slug, title, project, description. Source of truth for the homepage + cards. |
| vercel.json | Static deploy config, X-Robots-Tag: noindex, and /og/* rewrites to the function. |
| package.json | @vercel/og + react for the OG renderer. |
| logo.svg | Site logo for generated homepage cards. |
Pick your harness. Each tab installs what your assistant needs — /publish for day-to-day publishing, plus a background skill/rule for conventions.
Background workflow rule — teaches Cursor the publish command, OG conventions, and privacy model whenever you ask to share something.
Both use Cursor's deeplinks — one-click install. Adjust the mirror path in the rule if yours isn't ~/.scratchpad/.shareables.
Install the slash command so /publish scaffolds or updates shareables from your scratchpad.
mkdir -p ~/.scratchpad/commands cp ~/.scratchpad/.shareables/commands/publish.md ~/.scratchpad/commands/publish.md
Or fetch directly from this site before you've unzipped:
mkdir -p ~/.scratchpad/commands curl -fsSL https://shareables.yahyatarique.dev/shareables/self-host/commands/publish.md \ -o ~/.scratchpad/commands/publish.md
Background skill — triggers on “share this / publish this / put this on shareables” and loads the full workflow docs.
mkdir -p ~/.scratchpad/skills/shareables cp ~/.scratchpad/.shareables/SKILL.md ~/.scratchpad/skills/shareables/SKILL.md
Or fetch from this site:
mkdir -p ~/.scratchpad/skills/shareables curl -fsSL https://shareables.yahyatarique.dev/shareables/self-host/SKILL.md \ -o ~/.scratchpad/skills/shareables/SKILL.md
Prereqs: Node 18+, a Vercel account, a domain (or *.vercel.app), and git. No local Chrome — OG cards render on Vercel at request time.
shareables.example.com — the shareables. prefix is intentional. Point it at shareables.<your-domain> (e.g. shareables.acme.dev, shareables.unveil.skin) so your main site and shareables can coexist. Unzip into a “mirror” folder that becomes a git repo Vercel deploys.
mkdir -p ~/.scratchpad/.shareables && cp -R shareables-starter-kit/* ~/.scratchpad/.shareables/ && cd ~/.scratchpad/.shareables npm install
The placeholder is shareables.example.com — swap in shareables.<your-domain> (not your apex/root domain, unless shareables is the only thing on it):
# macOS (use `sed -i` without '' on Linux) find . -type f \( -name '*.js' -o -name '*.mjs' -o -name '*.json' -o -name '*.md' -o -name '*.cjs' \) \ -exec sed -i '' 's/shareables\.example\.com/shareables.unveil.skin/g' {} +
git init && git add -A && git commit -m "init shareables" git remote add origin git@github.com:<you>/shareables.git && git push -u origin main
In Vercel: New Project → import the repo. Accept defaults — vercel.json sets installCommand: npm install for the OG function deps. Add your domain under Settings → Domains. Every push to main auto-deploys.
Use the harness tabs above — install /publish and the skill/rule for Cursor or Claude Code.
Either run /publish in your agent, or invoke the script directly:
node scripts/publish.mjs \ --file ~/.scratchpad/hello.html --project "Demo" --title "Hello, shareables" \ --desc "My first self-hosted shareable."
Copy in → manifest → build → commit → push → prints your live URL. The OG card appears on first fetch.
Static pages, plus an opt-in shared key-value store when a page needs live state — votes, flags, reactions, counters, RSVPs, polls — across visitors.
Add an Upstash KV store (Vercel Marketplace, free tier) and set KV_REST_API_URL + KV_REST_API_TOKEN under Settings → Environment Variables. Without them, api/flags.js returns 501 live store not configured and the rest of the site is unaffected.
livePublish with --live (or set "live": true in shareables.json). build-index.cjs compiles every live page into lib/live-pages.js — the store's write allowlist. The pageId is <projectSlug>-<slug>.
SHAREABLES_SESSION_SECRET for accountsLive actions require a signed-in account, so set SHAREABLES_SESSION_SECRET (any long random string). Optionally set SHAREABLES_USERNAME + SHAREABLES_PASSWORD for an admin login. Visitors self-serve at /login → Create account (stored in the same Upstash KV).
lib/live-kv.jsimport { createLiveStore } from "/lib/live-kv.js"; const store = createLiveStore({ page: "demo-my-poll", onAuthRequired: () => location.href = store.loginUrl() }); const me = await store.whoami(); // { loggedIn, role, name, email } | null store.subscribe((flags) => render(flags)); // { itemId: { count, mine, voters } } await store.toggle("item-1");
Two account roles: admin (env credential, full access) and visitor (self-serve email + password, can act on live pages but not browse gated pages). Both ship in the kit: login/, api/login.js, api/register.js, api/me.js, api/logout.js, lib/session.js, lib/users.js.
build-index.cjs injects a managed <!-- og:auto --> block pointing at /og/<project>/<slug>.png. api/og.js renders the PNG on Vercel via @vercel/og and CDN-caches it. Don't hand-write og: meta.X-Robots-Tag: noindex header keeps your pages out of search results while staying fully fetchable — so the people (and agents) you send a link to can read it. Don't add a robots.txt Disallow.