Skip to main content
Use this tutorial to add a working OpenKey connect-and-sign flow to a small browser app.

Prerequisites

  • Node.js 18 or later
  • A browser with WebAuthn support
  • A passkey-capable device or hardware security key

Create the app

Replace src/main.ts with:
Start the development server:
Open the local URL, select Connect OpenKey, and complete the OpenKey flow. The page should show an Ethereum address. Select Sign message and it should replace that result with the address and a hex-encoded signature.

What happened

connect() returns the selected key’s address, keyId, and keyType. signMessage() uses that keyId and returns the signature plus the signing address. The default iframe mode falls back to a popup if the app’s content security policy blocks the frame.

Next step

To use the connected key as TinyCloud’s wallet provider, continue to TinyCloud Integration.