Package Exports
- @flowhash/pass
- @flowhash/pass/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@flowhash/pass) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ποΈ Flowhash Pass
Unified Wallet-Pass SDK for Real-World Credentials
Flowhash Pass is a TypeScript SDK for generating, signing, and managing verifiable passes on Apple Wallet and Google Wallet. Built on @flowhash/core, it bridges cryptographic truth and real-world credentials β enabling secure, interoperable workflows for logistics, healthcare, and beyond.
βΈ»
β¨ Overview
Flowhash Pass provides a unified abstraction layer for issuing and updating wallet passes across multiple ecosystems. It standardizes claim flows (like PES β TO) and status pipelines (ISSUED β PRESENCE β OPS β EXITED) while maintaining verifiable hashes, signatures, and anchor integrity via Flowhash Core.
βΈ»
π Quickstart
npm install @flowhash/pass @flowhash/core
import { createParentSchedule, createChildTicket, getPkpassBuffer } from '@flowhash/pass'
// 1οΈβ£ Create a parent PES schedule
const pes = await createParentSchedule({
profile: 'logistics',
programName: 'Morning Yard Veracruz',
site: 'Patio Gate 3'
})
// 2οΈβ£ Claim a child Transport Order
const to = await createChildTicket({
parentId: pes.id,
plate: 'ABC123A',
carrier: 'Transportes Golfo'
})
// 3οΈβ£ Generate Apple Wallet pass
const buf = await getPkpassBuffer('child', to)
await fs.promises.writeFile('ticket.pkpass', buf)βΈ»
π§ Architecture
flowhash/pass
βββ adapters/ # Apple + Google Wallet adapters
βββ api/ # Unified issuance/update API
βββ profiles/ # Domain-specific field maps
βββ templates/ # JSON templates for passes
βββ types.ts # Shared types and validationKey Components
Module Description
adapters/apple.ts Builds and signs .pkpass files using passkit-generator.
adapters/google.ts Creates Google Wallet class/object JSON payloads.
api/unified.ts Unified functions: createParentSchedule, createChildTicket, updatePassStatus.
profiles/ Domain-specific mappings (logistics, healthcare, etc.).
templates/ JSON templates for field mapping and layout.βΈ»
π§© Profiles
Logistics (default)
Entity Description Example Parent (PES) Program Entry Schedule Gate window, site, available slots Child (TO) Transport Order Plate, carrier, client, status Statuses ISSUED β PRESENCE β SCALE β OPS β EXITED
Healthcare (reference)
Entity Description Example Parent Appointment Batch Doctor, location, date Child Patient Visit Ticket Patient, procedure, status Statuses SCHEDULED β CHECKIN β PROCEDURE β DISCHARGED
Switch profiles dynamically:
await createChildTicket({ profile: 'healthcare', ... })βΈ»
π Integration with Flowhash Core
Flowhash Pass automatically uses: β’ hashEvent() for deterministic hashes β’ signCredential() for ECDSA signatures β’ dailyMerkle() for anchoring batches
This ensures every pass is cryptographically verifiable and compatible with Flowhashβs event audit trail.
βΈ»
π§ͺ Testing
npm run test
Tests include: β’ Apple .pkpass field mapping β’ Google Wallet JSON validity β’ Cross-profile field validation β’ Core integration (hash + sign + verify)
βΈ»
βοΈ Environment Variables (Apple Wallet)
APPLE_TEAM_ID=ABCD1234
APPLE_PASS_TYPE_ID=pass.com.flowhash.logistics
APPLE_CERT_PATH=./certs/pass.p12
APPLE_CERT_PASSWORD=yourpassword
APPLE_WWDR_PATH=./certs/wwdr.pemFor Google Wallet, include:
GOOGLE_ISSUER_ID=issuer-id
GOOGLE_SA_JSON=./google/credentials.jsonβΈ»
π§Ύ License
Apache License 2.0 Β© 2025 Flowhash β open and extensible.
βΈ»
π€ Contributing
1. Fork the repo
2. Run npm install
3. Add or improve a profile under src/profiles/
4. Write tests in tests/
5. Submit a PR using conventional commitsβΈ»
π§ Part of the Flowhash Ecosystem
Repo Purpose
flowhash/core Verifiable event SDK β hashing, signing, Merkle trees
flowhash/pass Wallet-pass abstraction over Core (this repo)
flowhash/wallet Reference logistics PWA & API
flowhash/id Hosted identity & orchestration layer (SaaS)βΈ»
βFlowhash Pass connects cryptographic truth with human experience β turning every credential into a verifiable story.β
Reflection: evidence β logic consistent brevity optimized