Sign in with Key, now on npm
Five small packages that put passwordless sign-in into your own site, and one command to start.
Say you run a small site with one members-only page. Someone has to be able to log in, and that someone is not going to remember another password. You can build the password part yourself, with a database to keep safe and a reset email that has to work every time. Or you can skip it.
Skipping it is what Key is for. A person types their email, gets a code or a link, and they are in. There is no password to forget or leak. Key is new: I started it this month, and it runs on my own sites in early use. This week the pieces went up on npm so you can add it to yours.
The quickest way in is one command, run from your site's folder. It works out what kind of site you have: a site-kit site, a static site on Cloudflare Pages, or a Cloudflare Worker. For anything else, it shows you the steps by hand and changes nothing.
npx @superintelligentfamily/key-install
It shows you each change before it makes it and asks first. It puts your secret key straight into your host's secret store, so the key is never printed or written into a file. If it stops partway, nothing is left half done.
If you write your own code and want sign-in inside it, there are four more packages, each doing one job. key-handler runs on your server and handles the sign-in. key-react gives a React app a sign-in button and a way to show one thing to signed-in visitors and another to everyone else. key-verify checks, on your server, that a request really comes from a signed-in person and which plans they have. key-js lets a page on a site that already runs Key's members plugin show who is signed in. All five live under @superintelligentfamily/ on npm. Each has a short quickstart on its npm page you can paste.
Key is still young. It is in early use on my own sites, and there is no price yet. If you want to try it, start at superintelligentkey.com/docs.