igrantio-frontend-clientlisted
Install: claude install-skill L3-iGrant/skills
# 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.deleteHistory`
- `verification.sendRequest`, `verification.readHistory`, `verification.deleteHistory`
- `baseUrl` = your backend proxy (`https://host/ows/<tenant>`); leave `apiKey` empty (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 client
- **`useCredentialHistory` / `useVerificationHistory`** - optional polling