Igrantio frontend client
Generic, dependency-free browser client for the iGrant.io Organisation Wallet Suite (OWS): a typed fetch client for EUDI Wallet (EUDIW) credential issuance (OpenID4VCI) and verification (OpenID4VP) via your tenant backend proxy, a Server-Sent-Events consumer (EventSource + consume-and-delete + reconnect), and optional React hooks (useSSE, useOwsClient, credential/ verification history) plus QR/deep-link helpers. No @igrant/* SDK. Use as the shared frontend foundation for igrantio-issuer-frontend and igrantio-verifier-frontend.From its SKILL.md
npx -y skills add L3-iGrant/skills --skill igrantio-frontend-clientAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.1 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
iGrant.io frontend client (generic, no SDK)
When to use
The shared frontend building block for any OWS integration. igrantio-issuer-frontend
and igrantio-verifier-frontend both build on it. It replaces the internal
@igrant/usecase-sdk / igrant-api-lib with self-contained, framework-agnostic
code you own. Read igrantio-ows-overview for the endpoint/response contract.
Before you build: run the integrator intake in igrantio-ows-overview - environment, API key, tenancy, backend host, webhooks, frontend - one question at a time, a recommended default with each.
What it provides
Framework-agnostic core (only fetch + EventSource):
createOwsClient({ baseUrl, apiKey? })- typed methods:issuance.issueInTime,issuance.startDeferred,issuance.completeDeferred,issuance.readHistory,issuance.deleteHistoryverification.sendRequest,verification.readHistory,verification.deleteHistorybaseUrl= your backend proxy (https://host/ows/<tenant>); leaveapiKeyempty (the backend injects it).
openSseSession({ webhookBaseUrl, exchangeId, onMessage })- EventSource session with consume-and-delete and reconnect; returns{ close }.types.ts- request/response + SSE event types.
React layer (peer deps: react, and qrcode for QrCode):
useSSE()→{ open, close }useOwsClient(baseUrl, apiKey?)- memoised clientuseCredentialHistory/useVerificationHistory- optional polling readsQrCodecomponent +openInWallet(uri)deep-link helper - minimal URI-to-image only; for the full panel (centre logo, green tick, refresh, wallet button, tx code) useigrantio-qr-code
Reference layout (vendor into your app)
Copy ./references/lib/ows into your app at src/lib/ows/.
Role features (igrantio-issuer-frontend, igrantio-verifier-frontend) import
from ../../lib/ows.
lib/ows/
owsClient.ts types.ts sseClient.ts index.ts
react/ useSSE.ts useOwsClient.ts useCredentialHistory.ts
useVerificationHistory.ts usePolledResource.ts QrCode.tsx index.ts
Core usage
import { createOwsClient, openSseSession } from "./lib/ows";
const client = createOwsClient({ baseUrl: "https://host/ows/acme" }); // no apiKey
// Verification: send → get QR + exchange id
const { verificationHistory } = await client.verification.sendRequest({
requestByReference: true,
presentationDefinitionId: "<pd-id>",
});
const exchangeId = verificationHistory!.presentationExchangeId;
const qr = verificationHistory!.vpTokenQrCode;
// Live update: SSE keyed by exchange id
const session = openSseSession({
webhookBaseUrl: "https://host/webhook",
exchangeId,
onMessage: (event) => {
// event.data.presentation.verified / .vpTokenResponse / .presentation[0]
session.close();
},
});
React usage
import { useOwsClient, useSSE, QrCode } from "./lib/ows";
const client = useOwsClient("https://host/ows/acme");
const { open, close } = useSSE();
// after sendRequest/issue: open(exchangeId, "https://host/webhook", onMessage)
// render: <QrCode value={qrUri} />
Clean-code notes
- Core is decoupled from React and from the QR library (both peer deps) so it drops into any framework.
- One responsibility per file; the client is the only place OWS paths live.
apiKeyempty by default → the browser never holds a secret.
Validation / done criteria
cd references && npm install && npm run typecheckpasses.- No import of
@igrant/*anywhere. - SSE delivers the event and auto-deletes it; a refresh does not replay it.
Documentation & workflows
When anything is unclear, consult the iGrant.io documentation before guessing:
- iGrant.io developer APIs (index): https://docs.igrant.io/docs/developer-apis
- Getting started: https://docs.igrant.io/docs/get-started/
- OpenID4VC API (issuer / verifier / webhook): https://docs.igrant.io/docs/category/openid4vc-api/issuer
- Workflow: issue a credential (OID4VCI): https://docs.igrant.io/docs/openID4vci-issue-credential-intime/
- Workflow: send and verify credentials (OID4VP): https://docs.igrant.io/docs/openID4vc-send-verify-credentials/
What ships with it: 13 files
22.7 KB alongside SKILL.md, 10 of them executable
references/
- lib/ows/index.tsruns344 B
- lib/ows/owsClient.tsruns4.1 KB
- lib/ows/react/index.tsruns375 B
- lib/ows/react/QrCode.tsx1.3 KB
- lib/ows/react/useCredentialHistory.tsruns755 B
- lib/ows/react/useOwsClient.tsruns382 B
- lib/ows/react/usePolledResource.tsruns1.6 KB
- lib/ows/react/useSSE.tsruns1.2 KB
- lib/ows/react/useVerificationHistory.tsruns816 B
- lib/ows/sseClient.tsruns2.6 KB
- lib/ows/types.tsruns8.4 KB
- package.json633 B
- tsconfig.json300 B