Skip to content

rianvdm/feedbin-matter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

feedbin-matter

A tiny Cloudflare Worker that adds a "Save to Matter" sharing service to Feedbin on the web/desktop.

Click "Save to Matter" on any article in Feedbin and it lands in your Matter reading queue.

Why it needs to exist

Feedbin's custom Sharing Services can only open a GET URL with ${url} and ${title} substituted in. Matter saves through an authenticated POST (POST /public/v1/items with a Bearer token). There's no getmatter.com/save?url= endpoint to point Feedbin at — and you wouldn't want your Matter token sitting in a Feedbin config URL anyway.

This Worker is the bridge: it accepts the GET that Feedbin opens, checks a cheap shared key, and forwards an authenticated POST to Matter. Your Matter token stays server-side as a Worker secret and never touches the URL.

On iOS/iPadOS you don't need this. Matter's native share extension already shows up in the system share sheet. This is for Feedbin on the web/desktop, where there's no share sheet to hook into.

How it works

GET /save?key=<SHARED_KEY>&url=<article-url>
Outcome Response
Missing/wrong key 403 Forbidden
Missing url 400
Save accepted 200 — an HTML page that auto-closes its own tab (falls back to a "you can close this tab" note if the browser blocks self-close)

Saved items go to the Matter queue (status: "queue").

Deploy your own

Prerequisites: a Cloudflare account (free tier is fine), a Matter account with API access, and Node 18+.

  1. Clone and install

    git clone https://github.com/rianvdm/feedbin-matter.git
    cd feedbin-matter
    npm install
  2. Get a Matter API token. Generate one from Matter's API settings — see the Matter API quickstart. It looks like mat_.... (If you use the Matter CLI, the token is also in ~/.config/matter/config.json.)

  3. Create .dev.vars in the repo root (it's gitignored):

    MATTER_TOKEN="mat_your_token_here"
    SHARED_KEY="paste-a-random-string-here"
    

    Generate a strong SHARED_KEY with:

    node -e "console.log(require('crypto').randomBytes(24).toString('base64url'))"
  4. Deploy. This uploads the secrets from .dev.vars, then ships the Worker:

    npm run deploy

    Wrangler prints your Worker URL, e.g. https://feedbin-matter.<your-subdomain>.workers.dev. (You'll be prompted to wrangler login on first run if you haven't already.)

  5. Wire it into Feedbin. Feedbin → Settings → Sharing → add a custom sharing service:

    • Name: Save to Matter
    • URL:
      https://feedbin-matter.<your-subdomain>.workers.dev/save?key=<SHARED_KEY>&url=${url}
      

    Leave ${url} literal — Feedbin substitutes and URL-encodes it; the Worker decodes it, so query-heavy URLs survive. You don't need ${title}; Matter extracts its own metadata.

That's it. "Save to Matter" now appears in the article share menu.

Local development

npm run dev      # wrangler dev on http://localhost:8787
npm run tail     # live logs from the deployed Worker

Smoke test against local dev:

curl "http://localhost:8787/save?key=$SHARED_KEY&url=https://example.com/article"

Security notes

  • The Matter token is the only real credential, and it's a Worker secret — never in the repo, never in the URL.

  • The SHARED_KEY is a low-value gate, not a credential. It lives in the Feedbin URL by necessity (Feedbin can only open a GET URL — no custom headers, no interactive auth). Anyone with the full URL including the key can add articles to your queue; that's the worst they can do (no reads, no deletes, no token exposure), and it's fully reversible. Keep the URL private.

  • Rotate the key any time without a code change:

    npx wrangler secret put SHARED_KEY   # paste a new value, then update the Feedbin URL

Notes

  • Matter processing is async: ~40% of saves complete instantly (cached content); the rest finish extracting in 20–60s. A 200 means "accepted," not necessarily "fully parsed."

License

MIT

About

A tiny Cloudflare Worker that adds a 'Save to Matter' sharing service to Feedbin on web/desktop

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors