QRCodeService
Use client.qrCodes to resolve pass-download URLs and render them as QR codes.
| Method | Result |
|---|---|
getApplePassQRCode(passId, options?) | Apple QR-code data and pass URL |
getGooglePassQRCode(passId, options?) | Google QR-code data and pass URL |
getApplePassURL(passId) | Apple pass URL |
getGooglePassURL(passId) | Google pass URL |
typescript
const appleQrUrl = await client.qrCodes.getApplePassQRCode("pass-uuid", {
width: 320,
margin: 2,
});
const google = await client.qrCodes.getGooglePassQRCode("pass-uuid", {
format: "json",
});
if (typeof appleQrUrl === "string") {
document.querySelector<HTMLImageElement>("#apple-qr")!.src = appleQrUrl;
}
if (typeof google !== "string") {
console.log(google.url, google.qrCode);
}The QR-code methods look up the pass first and throw if the corresponding wallet URL is unavailable.