Rhea Key SDK

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:

HTML
<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.

Register this 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:

Redirect address
http://localhost:3000/api/auth/callback/rheakey

http://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

HTML
<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>

The 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.