Repository navigation
Major Changes
-
b323088: Breaking. A smaller, documented public API:
- Every option of every exported type now carries its documentation, so editors show it on hover.
- The option types you build separately are exported:
AppleOptions,AppleEventTicketOptions,AppleBoardingPassOptions,AppleNfc,Beacon,RelevantDate,AppleContentOptions,GoogleOptions,GoogleBoardingPassOptions,GoogleContentOptions,TotpParameter,EventVenue,WalletErrorDefinition, andParsedTemplate, the type oftemplate.config. PassTemplatecan no longer be constructed withnew; get one from aWalletmethod (wallet.loyalty(), …) as before. Its declaration no longer exposes passlet's provider internals.LocaleCodeis removed;localeskeys were always plain BCP 47 strings.WALLET_ERROR_CODESentries are typed asWalletErrorDefinition(status: number,message,why,fix: string) instead of their literal values.WalletErrorCodeis unchanged.appLinkDatanow takes the targets Google documents:android: { packageName }opens your Android app (Google's preferred target),web: { uri, description }opens a web page with the description Google requires on it, anddisplayText(at most 30 characters) labels the button.appLinkData.iosis removed, since Google no longer supports links to iOS apps, and so are each link'stitle,descriptionandlogoUrl, which Google no longer shows. https://developers.google.com/wallet/reference/rest/v1/AppLinkData
-
b323088: Breaking. Validation no longer bundles
zod/mini: passlet checks templates and content with its own small validator.dist/index.jsis 43% smaller than in 3.2.0 (205 KB → 116 KB, 33 KB gzipped),import("passlet")takes 15 ms instead of 25 ms, and building a template takes a quarter of the time. Unknown keys are still dropped and every default still applies; what changed for you:- Messages are passlet's own, in English, and name the failing path once:
barcode.format: must be one of "QR", "PDF417", …,id: must not be empty(wasTemplateConfig missing: id),google.valueAdded: accepts at most 10 entries. A problem with the content as a whole readscontent: ….issuesstill lists every failing path. expiresAt,validFromand Google messagedisplayIntervaldates now take any W3C timestamp, as Apple and Google do: a UTC offset ("2026-12-09T13:00:00-07:00") and minute precision ("2026-12-09T13:00-07:00") were rejected before. A time zone is still required.startsAt,endsAt,departureandarrivalalso take minute precision with a zone.- Apple image URLs must be
http:orhttps:, since passlet downloads them. Googlelinks[].uriandvalueAdded[].urimust carry a scheme (https:,tel:,mailto:,geo:, an app deep link), as Google requires; an empty string was the only thing rejected before. - A beacon
proximityUUIDmay be any 8-4-4-4-12 hex UUID, not only RFC 9562 versions, and email options take anyname@domain.tld. - An Apple
relevantDatesentry with bothdateandstartDate/endDateis rejected at that entry, since Apple defines each entry as one or the other; it was read as{ date }before.
- Messages are passlet's own, in English, and name the failing path once:
-
b323088: Breaking. Every pass is built through one path, so the same checks apply everywhere:
- A template that reaches a
Walletfrom elsewhere, returned byload(forwallet.update()and the Apple web service) or passed tocreateBundle(), is checked against that Wallet's credentials the first time it is used. A boarding pass withouttransitTypereturned byloadnow throwsAPPLE_BOARDING_MISSING_TRANSIT_TYPEinstead of producing a pass Apple cannot render.createBundle()accepts a template built by anotherWalletonce it passes those checks, instead of rejecting it withPASS_BUNDLE_INVALID. - When
apple.webService.registrationsfails duringwallet.update(), the error is aWalletErrorwith the new codeAPPLE_REGISTRATIONS_FAILED, your storage's error ascause, and, with Google configured,results, so you can tell that Google already applied the update. It used to be your storage's own error, withoutresults. template.expire()throwsGOOGLE_NOT_CONFIGUREDwithout Google credentials, aspublish()andsendMessage()do, instead of silently doing nothing.
- A template that reaches a
-
b323088: Breaking. passlet is now published as an ES module only, and needs Node.js
^20.19.0 || >=22.12.0. Those versions load ES modules withrequire(), so CommonJS apps keep callingrequire("passlet")unchanged (Node 22.12 prints a one-timeExperimentalWarningfor it; later 22.x releases don't); only Node 20.15–20.18 and 22.0–22.11 must upgrade (Node 20 itself reached end of life in April 2026). Dropping the CommonJS copy halves the package (index.cjsandindex.d.ctsare gone) and removes the dual-package hazard where an app that loaded passlet both ways got twoWalletErrorclasses, soinstanceof WalletErrorand the check that a template belongs to itsWalletfailed across them.
Patch Changes
- b323088:
toNodeListenerno longer special-casesSet-Cookieresponse headers: it adaptswallet.handler, which never sets cookies. A handler of your own that sets several cookies through it now sends only the last one. - b323088: Apple passes take less work to issue and to serve. A template's images are now hashed once instead of on every pass, bundle item and web service render; passlet keeps its own copy of image bytes, so reusing the
Uint8Arrayyou passed in no longer changes later passes. The @1x, @2x and @3x versions of an image URL now download at the same time, and a URL named twice in a template (an icon that is also the logo) downloads once. Devices that fetch the same version of a pass at the same moment, like a holder's iPhone and Apple Watch right afterwallet.update(), now share one render instead of signing the pass once each. - b323088: An Apple pass updated twice within the same second now reaches devices. The web service answered the second version with
304 Not Modified, because HTTP dates have whole seconds and both versions carried the sameLast-Modified; the device kept the first version until the next update. Pass responses now carryLast-Modifiedonly once the second ofupdatedAtis over (RFC 9110 §8.8.2.2), so a device fetching in that second always gets the full pass. Pass responses also carryContent-Lengthnow. - b323088: Apple pass signatures list their signed attributes in DER order (content type, signing time, message digest), as CMS requires, so verifiers that re-encode the attributes accept them too. Signing with an in-memory
signerKeyno longer blocks the event loop: it runs on Node's thread pool, so the passes of acreateBundle()sign in parallel and other requests keep being served meanwhile. An unsupportedsigner.digestAlgorithmnow throwsAPPLE_INVALID_SIGNER_KEYfromnew Wallet()instead ofAPPLE_SIGNING_FAILEDfrom everycreate(), and that error'swhyandfixmention it. - b323088: Google writes make fewer and faster requests. A
Walletremembers which classes exist (Google cannot delete a class), so after the first pass from a templatecreate()is a single request instead of two, and concurrent first issues check and create the class once.wallet.update()patches the pass first and only looks at the class when Google has no pass yet: one request instead of two.createBundle()writes every pass in parallel, each right after its class, instead of one request after another, so a bundle waits on at most three round trips (class check, class insert, passes), and one once theWalletknows its classes; invalid content in any item still fails before anything is written, and when one write fails,createBundle()rejects only after the others have finished, so nothing is still landing on Google afterwards. Concurrent requests on a newWallet, or after its access token expires, now share one token exchange instead of each signing and sending its own. - b323088:
google.messageson a generic template now reach Google. They were dropped from the class, so the messages meant for every holder of a generic pass never appeared. - b323088:
wallet.update(serialNumber, { notify: true })no longer sends Google'snotifyPreferencefor generic passes. Google'sgenericObjecthas no such field and dropped it without notifying anyone; to notify generic pass holders, usePassTemplate.sendMessage()withmessageType: "TEXT_AND_NOTIFY". - b323088: Google passes no longer show the same value twice. A gift card's
balanceandcardNumber, and a boarding pass's passenger name, appeared both in their own slot and again as a text module; every field that Google shows in a dedicated slot is now left out of the text modules, as loyalty and event fields already were. A boarding pass'spassengerNamefield now also uses the field'svaluewhen the recipient sets none, instead of failing withGOOGLE_FLIGHT_MISSING_PASSENGER_NAME;values.passengerNamewithout a template field still works. - b323088: Google
publish()no longer wipes class fields passlet does not set. It used to read the class and write it back whole, so nested fields such as a flight'sorigin.gateandorigin.terminal, the airline name inflightHeader, or an event'sdateTime.doorsOpenwere lost, and a gate change made in the Google console or by another system was undone (and could notify holders).publish()now patches the class in one request: the fields passlet owns are written or cleared, everything else stays as it is. - b323088: The published build now imports Node built-ins by their
node:names (node:crypto,node:zlib,node:stream,node:http2) instead of barecrypto,zlibandstream. Bundlers and runtimes that resolve a barecryptoorstreamto a polyfill or an npm package now get Node's own modules, as passlet's "Node built-ins only" promise intends. Every Node version passlet supports resolves these names; nothing changes for code that already runs on Node.