Welcome to the Beehiiv authentication system. Currently, Beehiiv.com does not support OAuth or SAML. So, I built this solution so I can use their service as my identity provider.
This was 100% vibe coded in a single day using Warp.dev CLI AI tools. I have wanted a way to give only subscribes access to apps I write about. So this was the solution.
Why not use Auth0 or some other service? I try to use the smallest amount of code and services to keep any codebase as simple as possible. Simple is cheaper. Simple is easier to maintain. Simple is more secure.
Feel free to clone and use. There is an example .env file. It also contains a UI tools to allow for testing the authentication workflow in-situ. Hint, there is a setting the .env to enable full (unsafe) debug mode.
In a nut shell, this solution is designed to let me "vibe" code some apps, but require a user to be subscribed to my newsletter to access. Fair?
Learn how I built this solution and why I chose to use Beehiiv as my identity provider. The post includes implementation details and use cases.
Read the PostFree to clone and use. The repository includes all the code, documentation, and environment settings needed to run your own instance.
View on GitHub