[READ-ONLY] Mirror of https://github.com/ewanc26/atproto-shortlink. a shortlink service using Linkat. docs.ewancroft.uk/projects/atproto-shortlink
atproto shortlink sveltekit
0

Configure Feed

Select the types of activity you want to include in your feed.

TypeScript 34.1%
Svelte 18.5%
JavaScript 6.3%
CSS 3.3%
Nix 0.9%
HTML 0.3%
Other 36.6%
20 1 5

Clone this repository

https://git.vm.fail/ewancroft.uk/atproto-shortlink https://git.vm.fail/did:plc:xoiiraytyacypevejootggj5
ssh://git@knot1.tangled.sh:2222/ewancroft.uk/atproto-shortlink ssh://git@knot1.tangled.sh:2222/did:plc:xoiiraytyacypevejootggj5

For self-hosted knots, clone URLs may differ based on your setup.


README.md

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#

  1. You maintain links in Linkat (stored in blue.linkat.board collection)
  2. Service fetches them on-demand from your PDS via Slingshot
  3. URLs get a deterministic 6-char base62 hash (e.g., /a3k9zx)
  4. 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