In this tutorial you’ll build a complete identity registration UI using theDocumentation Index
Fetch the complete documentation index at: https://docs.hyperauth.dev/llms.txt
Use this file to discover all available pages before exploring further.
useRegistration hook. A user will type an alias, click a button, and watch their registration progress through every step — from alias availability check all the way to on-chain confirmation. By the end you’ll have a full registration form that provides real-time feedback and displays the final transaction hash and DID when registration succeeds.
What you’ll build
ARegistrationForm component that:
- Accepts an alias from the user.
- Calls
register(alias)fromuseRegistration. - Displays a live progress list that updates as each of the 12 phases completes.
- Shows the registration result — DID, smart account address, and transaction hash — on success.
Prerequisites
- You have completed the Quickstart tutorial. Your app already has
HyperAuthProviderwrapping its root.
Steps
Understand the registration phases
Before writing any UI code, look at what
Each step has a
useRegistration tracks under the hood. The hook moves through these 12 steps in order:| # | Label | Phase value |
|---|---|---|
| 0 | Checking availability | checking-alias |
| 1 | Creating passkey | creating-passkey |
| 2 | Generating identity | generating-identity |
| 3 | Predicting account | predicting-account |
| 4 | Checking account state | fetching-account-state |
| 5 | Preparing registration | creating-registration |
| 6 | Covering fees | sponsoring |
| 7 | Granting permissions | authorizing |
| 8 | Signing securely | signing |
| 9 | Submitting registration | submitting |
| 10 | Waiting for confirmation | confirming |
| 11 | Saving session | storing-session |
status of 'pending', 'active', 'done', or 'error'. You’ll use these to render a live checklist.Create the RegistrationForm component
Create a new file
src/RegistrationForm.tsx:src/RegistrationForm.tsx
useRegistration is called without arguments — it reads the client from HyperAuthProvider internally. The register(alias) function is the only call you need to make. Everything else — passkey creation, identity generation, on-chain submission — happens automatically.Add the ProgressList component
Add this to the same file, below Each The
RegistrationForm:src/RegistrationForm.tsx
RegistrationStep has three fields:detail field carries short contextual text that HyperAuth fills in as each step finishes — for example step 0 sets detail to 'Available' once the alias check passes, and step 3 sets it to the predicted smart account address.Add the result and error components
Still in
src/RegistrationForm.tsx:src/RegistrationForm.tsx
RegistrationOutcome is the shape of the result value returned by the hook once registration completes:Run the flow end to end
Start the dev server and open the app:Type an alias — for example Follow the browser’s WebAuthn prompt when step 1 appears. After step 10 confirms on-chain, the result panel appears with your DID, smart account address, and transaction hash.
alice — and click Register. You’ll see the progress list come alive one row at a time:If the alias is already taken, the flow stops at step 0 with an error message and the Try again button resets everything so the user can pick a different name.
What you have built
You’ve built a complete identity registration flow.useRegistration manages all twelve steps of the process — alias checking, passkey creation, identity generation, account prediction, fee sponsorship, signing, on-chain submission, and session storage — and exposes just enough state for your UI to reflect exactly what is happening at every moment.
The result.did and result.smartAccount values you received are now live on-chain. The next tutorial, Sign and Verify Data, shows how to use the identity you just created to sign arbitrary messages.