I recently started working on the authentication capability for Plughub.
The plan was to add Auth after Email and Storage. Nothing particularly unusual about that, right?
Well, I underestimated it.
I started looking at what the package would actually need to support, and things quickly became more complicated than I initially expected.
Registration and login were just the beginning.
There were questions about:
- User identity and external OAuth accounts.
- Session creation, expiration and revocation.
- Email verification and password recovery.
- Account linking and the security implications.
- Database schemas and persistence adapters.
- Framework integration without introducing framework dependencies into the core.
Then I started evaluating Better Auth.
My thinking was that instead of building an authentication engine from scratch, Plughub could use Better Auth internally while maintaining its own public API and integration experience.
That sounded like a reasonable direction.
But I didn't want to end up with a thin wrapper that simply exposes Better Auth under a different package name.
I wanted to understand what Plughub would actually contribute.
Could we integrate authentication with our existing Email capability? Could developers use their existing database setup? Could someone using Fastify or Express integrate it without changing their application structure? Would the abstraction actually make anything easier?
Those questions led to more architectural discussions than I expected.
Eventually, I realised I was spending a lot of time trying to settle decisions that I hadn't yet validated through an actual implementation.
So I've decided to put Auth on hold for now.
I don't consider it abandoned. I just don't want to rush the decision, especially when authentication involves security and persistence decisions that can be difficult to change later.
What's next?
I'm considering Rate Limiting as the next capability.
It's a more manageable problem to approach incrementally, and it still presents some interesting engineering work.
My initial idea is to start with:
- A framework-independent core.
- A fixed-window rate-limiting strategy.
- In-memory storage.
- Redis support for distributed environments.
- A configurable key-generation mechanism.
It also gives me another opportunity to test the package-first approach I'm trying to establish with Plughub.
I think one of the things I'm learning from this project is that not every complicated problem needs to be solved immediately.
Sometimes it's better to step back, work on something else and return when you have a clearer understanding of the problem.
I'm still interested in building Auth. I just don't think it needs to be the next thing I ship.
For developers who've built authentication into their own infrastructure or products, how did you approach the initial architecture? Did you build your own engine, use an established solution, or combine both approaches?
I'd be interested in hearing about your experiences.