gitmyhub

hanko

Go ★ 9.0k updated 2d ago

Modern authentication, on your terms. Open source alternative to Auth0, Clerk, WorkOS, Stytch.

An open-source login and account management system you can host yourself or use as a managed cloud service. Supports passkeys, passwords, email codes, Google and Apple logins, and enterprise SSO, a self-hostable alternative to Auth0 or Clerk.

GoTypeScriptJavaScriptDockersetup: moderatecomplexity 3/5

Hanko is an open-source tool for handling user login and account management in web applications. It is an alternative to paid services like Auth0 or Clerk, meaning developers can either run it themselves on their own servers or use the managed cloud version the Hanko team hosts. Either way, the goal is to make adding authentication to an app less painful than building it from scratch.

The project supports a wide range of ways for users to prove who they are: traditional passwords, one-time email codes, passkeys (the newer phone-or-fingerprint login method), social logins via Google or Apple or GitHub, and enterprise single sign-on through a standard called SAML. Multi-factor authentication is also supported. The feature table in the README marks most of these as already complete, with a few items like mobile SDKs and an organization and permissions system still in progress.

For developers integrating Hanko, the main tools are a backend API written in Go and a set of pre-built web components called Hanko Elements. The web components handle the visual login and profile screens and can be styled with CSS so they fit a product's look. A JavaScript SDK is also available for teams that want to build their own login UI while still talking to the Hanko backend rather than a custom-built one.

The repository is organized into a backend folder, a frontend folder containing the web components and SDK, and an examples folder with reference implementations for common frontend frameworks. There is also a quickstart application that can be run locally via Docker to see the full login experience working end to end.

The backend and server code are licensed under AGPL-3.0, which means products that modify and distribute it must share their changes. The frontend web components and SDK use the more permissive MIT license. Commercial licensing without the AGPL requirement is available by contacting the team.

Where it fits