Ticket generation: QR codes, SVG tickets, and Apple Wallet passes.
- QR codes — SVG-based QR code generation for check-in URLs
- SVG tickets — visual ticket images for email attachments
- Apple Wallet —
.pkpassfile generation with PKCS#7 signing
Build the check-in URL for a single ticket token
Build info lines from ticket data (non-PII listing and booking details)
Build a complete .pkpass file as a Uint8Array (ZIP archive)
Create manifest.json mapping filenames to SHA-1 hashes
Extract the inner content of an SVG element (strip the outer <svg> wrapper)
Extract the viewBox from an SVG element to compute its coordinate space
Build the pass.json content from pass data and signing credentials
Generate an SVG string for a QR code encoding the given text. Returns a complete <svg> element suitable for inline embedding.
Generate a standalone SVG ticket with QR code and listing/booking details. Returns a complete SVG document string.
Whether this listing can send QR code scanners directly to checkout. True when no extra contact fields or questions are required.
Pad a serial number to meet Apple's minimum authenticationToken length. Uses "-" (not in uppercase hex charset) so padding is cleanly reversible.
Apple requires SHA-1 for manifest entries; CMS signs the manifest with SHA-256.
Strip padding added by padAuthToken to recover the original serial number
Data needed to generate a pass — maps to existing ticket/listing data
Non-PII ticket data for SVG rendering (extends shared wallet fields with display-formatted values)
Shared wallet pass data common to both Apple and Google Wallet
Decoded icon files for inclusion in .pkpass bundles
Usage
import * as mod from "docs/tickets.ts";