@gramota/credential-format
v0.1.3
Published
Pluggable credential-format handler registry — Strategy + Registry pattern for SD-JWT-VC, mDoc, and future formats.
Maintainers
Readme
@gramota/credential-format
Pluggable credential-format handler registry — Strategy + Registry pattern. Default registry ships with
dc+sd-jwt; add custom handlers for mDoc, W3C-VC-JWT, or proprietary formats without forking the wallet.
Part of Gramota — the TypeScript SDK for the EU Digital Identity Wallet (EUDIW).
Install
pnpm add @gramota/credential-format
# or: npm install @gramota/credential-format
# or: yarn add @gramota/credential-formatQuick example
import {
createDefaultCredentialFormatRegistry,
SdJwtVcFormatHandler,
} from "@gramota/credential-format";
const registry = createDefaultCredentialFormatRegistry();
const handler = registry.get("dc+sd-jwt");What's inside
CredentialFormatRegistry— register, look up, and dispatch by format stringSdJwtVcFormatHandler— default handler fordc+sd-jwt/vc+sd-jwtcreateDefaultCredentialFormatRegistry— pre-populated registryCredentialFormatHandlerinterface — implement for new formats (mDoc, etc.)hasIssuanceCapability,IssuanceCapableHandler— capability flag for handlers that also issue (not just present / verify)
For the high-level Holder / Verifier API that consumes the registry, see the main repo.
