Reference Host Layer application using @1shotapi/ows-provider for EIP-1193.
# Terminal 1 — Branding Layer + Signing Layer + ngrok (repo root)
npm run dev:general-wallet
# Terminal 2 — Host Layer
npm run dev -w @1shotapi/ows-example-host| Service | URL |
|---|---|
| Host Layer | http://localhost:5173 (or https — see below) |
| Branding Layer | WALLET_IFRAME_URL, or https://<NGROK_DOMAIN>/wallet/, or http://localhost:5174/wallet/ |
The host embeds the Branding Layer iframe URL from repo root .env (shared by issuer/verifier):
WALLET_IFRAME_URL— full URL override (any branding implementation)- else
NGROK_DOMAIN→https://<domain>/wallet/ - else →
http://localhost:5174/wallet/
Copy .env.example to .env at the repo root. Set NGROK_AUTHTOKEN + NGROK_DOMAIN for the general-wallet tunnel, or point WALLET_IFRAME_URL at another wallet.
WebAuthn only works in a secure context. An HTTPS branding/signer iframe embedded in an HTTP host is not secure — browsers walk the ancestor chain, so window.isSecureContext is false and navigator.credentials is missing even when location.origin is the ngrok HTTPS URL.
Therefore the Host Layer must also be HTTPS (or localhost / *.localhost over HTTP) when testing passkeys with an HTTPS wallet iframe.
# Once per machine
mkcert -install
# From repo root — SANs for hosts-file testing + localhost
mkcert -cert-file examples/host/certs/dev-cert.pem \
-key-file examples/host/certs/dev-key.pem \
ows-host.com ows-issuer.com ows-verifier.com localhost 127.0.0.1Optional hosts entry (C:\Windows\System32\drivers\etc\hosts):
127.0.0.1 ows-host.com ows-issuer.com ows-verifier.com
If examples/host/certs/dev-cert.pem and dev-key.pem exist, npm run dev enables HTTPS automatically for host, credential-issuer, and credential-verifier (shared helper in examples/host-dev.mjs). Or set in repo root .env:
HOST_HTTPS=1
# optional overrides:
# HOST_SSL_CERT=examples/host/certs/dev-cert.pem
# HOST_SSL_KEY=examples/host/certs/dev-key.pemThen open https://ows-host.com:5173 (accept the local CA once via mkcert -install). Credential demos use https://ows-issuer.com:5175 / https://ows-verifier.com:5176.
Confirm in the signer iframe console:
window.isSecureContext // true
navigator.credentials // CredentialsContainer
location.origin // https://<ngrok>/…- Start general-wallet dev (
npm run dev:general-wallet) and host dev (above). - Open the host URL (HTTPS when using ngrok wallet).
- Enter a message and click Sign
- First sign triggers passkey creation in the branding/signing stack; subsequent signs reuse the stored credential.
npm run build -w @1shotapi/ows-example-host
npm run clean -w @1shotapi/ows-example-host