If you build your own site or app, Key has five small packages on npm. You do not need any of them to use Key: the one-command installer is the quickest way for most sites. Reach for these when you want Key's sign-in inside code you already write.
The five packages
@superintelligentfamily/key-installis for anyone adding Key to a site. It asks before each change and keeps your secret key out of sight. Runnpx @superintelligentfamily/key-install.@superintelligentfamily/key-handleris for an app with a server. It gives you the sign-in, callback, token and sign-out routes. Install it withnpm i @superintelligentfamily/key-handler.@superintelligentfamily/key-reactis for a React app: a sign-in button, and components that show one thing to signed-in visitors and another to everyone else. Install it withnpm i @superintelligentfamily/key-react.@superintelligentfamily/key-verifyis for your server's API: check that a request really comes from a signed-in person, and see which plans they have. Install it withnpm i @superintelligentfamily/key-verify.@superintelligentfamily/key-jsis for a browser page that only needs to know who is signed in, to show a name and a picture. Install it withnpm i @superintelligentfamily/key-js.
How they fit together
A common site uses three of them. The handler runs on your server and does the sign-in. React draws the buttons. Verify checks each request to your API. Each package's page on npm has a short quickstart you can paste.
Good to know
- Your secret key stays on your server. None of these packages ask you to put it in a page that visitors can read.
- What a page shows is for looks only. Anything that must be protected is checked on your server.
- Every package is MIT licensed.