Dart authentication server with SuperTokens

21 min readJan 13, 2024

An open-source alternative

I’ve been researching how to implement authentication in my Flutter apps for as cheaply as possible. I have plans to build a number of apps that require user registration. At least one of those, though, will not be monetized. Although many auth providers have a free tier, the free tier only covers five to seven thousand monthly active users. I can’t afford to pay hundreds or even thousands of dollars a month if my free app suddenly becomes popular in the future.

I considered writing the password hashing and authentication flow from scratch. I’m sure that would have been a good learning experience, but I’d also like to maintain security and not being a security expert myself, it seems like it would be easy to make a mistake.

Although I rejected the idea of building from complete scratch, I thought about self-hosting a third-party auth server. I looked into a number of different options but finally settled with SuperTokens. I liked that their SDKs are open source and they have good documentation. They’re a new startup, so I hope enough people use their paid services to keep them in business, but since I’m also new in this area, I’m willing to take a chance on them. Reading Top Auth0 alternatives was helpful in comparing the options. (Just keep in mind that the article is biased since they wrote…