JSPM

@flowhash/pass

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q46340F
  • License Apache-2.0

Unified Wallet-Pass SDK for Real-World Credentials

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 validation

Key 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.pem

For 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