Link Shortener for AT Protocol#
Server-side link shortener powered by your Linkat board. No database — links are fetched from AT Protocol.
Independent project; see the trademark notice.
Also available on Tangled
How it works#
- You maintain links in Linkat (stored in
blue.linkat.boardcollection) - Service fetches them on-demand from your PDS via Slingshot
- URLs get a deterministic 6-char base62 hash (e.g.,
/a3k9zx) - Visiting that short link returns a 301 redirect
Quick start#
git clone git@github.com:ewanc26/atproto-shortlink
cd atproto-shortlink
npm install
Copy .env.example to .env and add your AT Protocol DID:
ATPROTO_DID=did:plc:your-did-here
Find your DID at pdsls.dev.
If you don't have a Linkat board yet, create one at linkat.blue.
Test config#
npm run test:config
Checks that .env exists, DID is valid, PDS is reachable, and your Linkat board is accessible.
Run#
npm run dev
Endpoints#
| Endpoint | Method | What it does |
|---|---|---|
/ |
GET | Service info and link listing |
/:shortcode |
GET | 301 redirect to full URL |
/api/links |
GET | All short links as JSON |
Deploy#
npm run build
npm run preview
Uses @sveltejs/adapter-auto — works with Vercel, Netlify, Cloudflare Pages, or Node.
Set ATPROTO_DID in your deployment platform's env vars.
Config ref#
| Variable | Required | What it is |
|---|---|---|
ATPROTO_DID |
Yes | Your AT Protocol DID |
Development#
npm run dev # dev server
npm run check # type check
npm run format # format
npm run lint # lint
Licence#
AGPLv3 — see LICENCE