Developer guide
Add Sign in with Rhea Key
Three steps. A person approves on their device. Your site verifies the result and creates its own session. Rhea never receives a recovery phrase or private key.
The official button shows the Rhea mark and the word Key in red (white on the red theme). These previews are static. A live try-sign-in demo will follow once this hostname is in production.
1Install
Until @rheakey/sdk is on the public npm registry, add the hosted script that already works today:
<script src="https://rheakey.com/sdk/rhea.js" async></script>
<rhea-button app-name="My App"></rhea-button>After publish, the default install will be npm i @rheakey/sdk. The script tag remains supported.
2Register your app
Unlock Rhea Key and register the exact redirect address your app will use. Registration is signed by your key, on the Key app.
The form cannot live on this site: it has to run in the unlocked Key app. After you finish, come back here and add the button.
Test mode
For local work, register a loopback address such as:
http://localhost:3000/api/auth/callback/rheakeyhttp://localhost and 127.0.0.1 do not need a domain proof. A public https site does: you will publish a short token at /.well-known/rheakey or as DNS TXT on _rheakey for that host. Redirect addresses are matched exactly. No wildcards.
3Add the button
<script src="https://rheakey.com/sdk/rhea.js" async></script>
<rhea-button app-name="My App"></rhea-button>
<script>
document.addEventListener("rhea-success", () => location.reload());
</script>// After you register the app. The official button includes the Rhea mark
// and the word Key in red.
import { RheaSignInButton } from "@rheakey/sdk/react";
export function SignIn() {
return <RheaSignInButton clientId={import.meta.env.VITE_RHEA_CLIENT_ID} />;
}// app/sign-in/rhea-sign-in.tsx
"use client";
import { RheaSignInButton } from "@rheakey/sdk/react";
export default function RheaSignIn() {
return <RheaSignInButton clientId={process.env.NEXT_PUBLIC_RHEA_CLIENT_ID!} />;
}// Issuer is https://rheakey.com — not auth.rheakey.com
import NextAuth from "next-auth";
import RheaKey from "@rheakey/sdk/authjs";
export const { handlers, auth } = NextAuth({
providers: [RheaKey({
clientId: process.env.RHEA_CLIENT_ID,
clientSecret: process.env.RHEA_CLIENT_SECRET,
issuer: "https://rheakey.com",
})],
});Issuer: https://rheakey.com
Discovery: https://rheakey.com/.well-known/openid-configuration
Flow: authorization code + PKCE (S256)
Scopes: openid profile
Token auth: client_secret_post, or none for a public client
ID token: ES256
Claims: sub, rhea_addressThe browser event is not enough. Always verify on your server before you create a session. The official React button is RheaSignInButton from @rheakey/sdk/react.
That is the whole happy path. For OpenID Connect details, errors, or the RK-1 challenge/verify path, use the pages in the header.

