惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
H
Help Net Security
Recorded Future
Recorded Future
The Register - Security
The Register - Security
F
Full Disclosure
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
Security Archives - TechRepublic
Security Archives - TechRepublic
Simon Willison's Weblog
Simon Willison's Weblog
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
T
Tenable Blog
T
Tor Project blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
博客园 - 叶小钗
B
Blog
V
V2EX
Jina AI
Jina AI
L
LangChain Blog
月光博客
月光博客
W
WeLiveSecurity
U
Unit 42
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 聂微东
V
Visual Studio Blog
A
Arctic Wolf
T
Tailwind CSS Blog
The Cloudflare Blog
SecWiki News
SecWiki News
S
SegmentFault 最新的问题
Hacker News - Newest:
Hacker News - Newest: "LLM"
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Securelist
www.infosecurity-magazine.com
www.infosecurity-magazine.com
腾讯CDC
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I built a SaaS that automatically purges ghost subscribers from Beehiiv using AES-256-GCM encrypted API keys and Inngest background jobs
Rodrigue Shema · 2026-06-03 · via DEV Community

I run a newsletter on Beehiiv. About six months ago I noticed my open rates were sliding while my subscriber count was growing. The two numbers were moving in opposite directions and I could not figure out why until I pulled the raw data.

Nearly 22% of my list had never opened a single email. Not one. They had been on the list for months, counted in my total, and pushing me toward a higher Beehiiv billing tier. I was paying $99/month when the real, engaged portion of my list put me firmly in the $49/month tier.

That is $600/year for subscribers who will never read, click, or buy anything.

I looked for a tool to fix it. Nothing existed that handled Beehiiv specifically, handled Apple Mail Privacy Protection false positives intelligently, or stored API keys with any serious encryption. So I built it. It is called ListTrim and it is live.


The Problem: Ghost Subscribers Are a Silent Margin Bleed

Beehiiv charges on total subscriber count, not engagement. The pricing cliff looks like this:

Plan Subscribers Monthly
Launch Up to 10,000 $49
Grow Up to 25,000 $99
Scale Up to 50,000 $199
Max 50,000+ $399

A newsletter with 10,500 subscribers, 2,000 of which are ghosts, pays $99/month. Remove the ghosts and you are at 8,500 subscribers. That is the $49/month tier. Fifty dollars saved every single month.

Beyond the billing tier, each ghost subscriber carries a silent infrastructure risk value of $0.006/subscriber/month. They occupy database rows, inflate every API response your integrations pull, and skew every analytics dashboard you look at. Across a newsletter agency running 15 publications, that drag compounds into a real number fast.

The deliverability cost is worse. Gmail and Outlook score your sender reputation on engagement rate. A list with 22% ghosts has its open rate artificially suppressed because the denominator is inflated with accounts that will never fire an open event. That pulls you from Primary inbox toward Promotions, and eventually toward Spam, without you ever knowing why.


The Apple Mail Privacy Protection Problem

Before I explain the architecture, this is worth addressing because most naive list-cleaning tools get it wrong.

Since iOS 15, Apple Mail pre-fetches emails and fires open tracking pixels automatically, regardless of whether the recipient actually read anything. A filter that simply removes everyone with a 0% open rate will incorrectly flag real Apple Mail readers as ghosts.

ListTrim uses multi-signal qualification instead. An account is only flagged as a ghost when all three of the following are true:

  • Subscriber age is over 60 days
  • The account has received more than 2 emails
  • Lifetime open rate is exactly 0%

A genuine Apple Mail user will fire at least one pixel at some point across 60 days and multiple sends. A true ghost, whether a bot signup, a dead inbox, or a throwaway address, never will. This keeps false positive rates near zero.


The Stack and Why I Made Each Choice

Frontend: Next.js + React + Tailwind CSS on Vercel

Next.js gives me server-side rendering for the marketing pages and a clean API route layer for the backend. Tailwind keeps the UI fast to build and maintain solo. Vercel handles deployment with zero configuration.

Database: Supabase (PostgreSQL) with Row-Level Security

I chose Supabase over a raw Postgres instance specifically for its Row-Level Security policies. RLS means each user's data is scoped at the database layer, not just the application layer. If a query bug ever bypasses application-level auth checks, the database itself will not return another user's records. For a product that stores encrypted API keys, that second layer of isolation is not optional.

Background Orchestration: Inngest

This is the part most indie SaaS products skip and then regret.

The auto-clean feature requires monthly background jobs that run per-user, paginate through potentially 50,000 subscribers, and stay inside Beehiiv's API rate limits. A naive cron job that loops over all users simultaneously will hit rate limits within minutes on a multi-tenant system.

Inngest solves this with step-function orchestration. Each auto-clean job breaks down into discrete steps:

  • Step 1: Decrypt the user's Beehiiv API key from Supabase
  • Step 2: Fetch page 1 of subscribers from the Beehiiv API
  • Step 3: Pause 500ms to respect rate limit headers
  • Step 4: Loop until the full list is compiled

If any step fails due to a dropped API call or network spike, Inngest catches the exact failure point and retries with automatic exponential backoff. A 50,000 subscriber list never crashes midway through a clean. Results write back to Supabase when the job completes and the user gets an email summary.

Payments: Paddle as Merchant of Record

I chose Paddle over Stripe for one specific reason: tax compliance.

Stripe processes payments. It does not handle tax obligations. That means registering in every jurisdiction where you have customers, calculating the correct VAT or GST rate, collecting it, filing returns, and remitting it. For a solo product with users in the EU, UK, Australia, and Canada, that overhead is not manageable.

Paddle is the Merchant of Record for every transaction. Paddle owns the tax obligation in every jurisdiction, calculates the correct rate at checkout, files the returns, and remits the tax. The product receives revenue with no compliance overhead.


The Part Everyone Asks About: How API Keys Are Stored

The most common objection when I show people ListTrim is some version of "I am not pasting my Beehiiv API key into a random tool." That is a reasonable objection and it deserves a real answer.

When a user submits their API key, it is encrypted using AES-256-GCM via Node's native crypto module before it ever touches the database. The encrypted blob is what gets written to Supabase. The plaintext key exists only in server memory for the milliseconds it takes to encrypt.

The full implementation:

import { randomBytes, createCipheriv, createDecipheriv } from 'crypto';

const ALGORITHM = 'aes-256-gcm';
const KEY = Buffer.from(process.env.ENCRYPTION_KEY!, 'hex'); // 32-byte key from env

export function encryptApiKey(plaintext: string): string {
  const iv = randomBytes(16); // unique IV generated per encryption
  const cipher = createCipheriv(ALGORITHM, KEY, iv);

  const encrypted = Buffer.concat([
    cipher.update(plaintext, 'utf8'),
    cipher.final()
  ]);

  const authTag = cipher.getAuthTag(); // GCM authentication tag

  // Concatenate iv + authTag + ciphertext into a single hex string for storage
  return Buffer.concat([iv, authTag, encrypted]).toString('hex');
}

export function decryptApiKey(stored: string): string {
  const data = Buffer.from(stored, 'hex');
  const iv = data.subarray(0, 16);
  const authTag = data.subarray(16, 32);
  const encrypted = data.subarray(32);

  const decipher = createDecipheriv(ALGORITHM, KEY, iv);
  decipher.setAuthTag(authTag);

  return Buffer.concat([
    decipher.update(encrypted),
    decipher.final()
  ]).toString('utf8');
}

Enter fullscreen mode Exit fullscreen mode

Three things that matter here:

The IV is unique per encryption. randomBytes(16) runs every time. Reusing an IV with AES-GCM is a well-documented catastrophic failure mode that can expose the encryption key. This is not a best practice, it is a hard requirement.

The GCM auth tag provides tamper detection. If anyone modifies the ciphertext in the database, decipher.final() throws before any plaintext is returned. Even if an attacker gains write access to Supabase, they cannot substitute a malicious ciphertext and extract a decrypted key.

The encryption key never touches the codebase or database. It lives in an environment variable on the server runtime only. The database stores a hex string that is useless without the key, and the key is useless without the database row.

What ListTrim never stores: subscriber email addresses, any subscriber personal data, or anything beyond the encrypted API key, publication ID, and anonymized job stats.


Business Model

The pricing is deliberately asymmetric: scanning is free, cleaning costs money.

A publisher can connect their Beehiiv account, run a full scan, and see their exact ghost count and monthly overpayment without a credit card. Most users are surprised by the number. Once you see that you are paying $50/month for subscribers who have never opened anything, the $19/month Starter plan is an obvious trade.

Paid tiers unlock one-click removal, monthly auto-clean scheduling, CSV export before deletion, and re-engagement campaigns. The re-engagement flow lets users create a Beehiiv segment of ghost subscribers and send three emails from their own account before any deletion runs. Anyone who opens gets saved. Anyone who does not gets flagged for removal when the user confirms at day 14.


Try It

The free scan is at listtrim.vercel.app. It takes two minutes, requires only a Beehiiv API key and publication ID, and shows your ghost count and savings estimate before you spend anything.

For a deeper look at the deliverability mechanics and Inngest step-function design, the full technical write-up is on the ListTrim blog.

If you have questions about the Inngest setup, the Paddle integration, or the RLS policies in Supabase, drop them in the comments. I read everything.