node-passbooker
Generates Apple Passboks.
Warning: Not yet production ready! The API is still subject to change without notice and it's using blocking I/O internally.
Dependencies
- openssl
General
Pass types:
- Boarding passes
boardingPass
- Coupon
coupon
- Event ticket
eventTicket
- Store card
storeCard
- Generic
generic
Usage
$ npm install passbooker
Preparation
- Get your Passbook certificate from the Apple Developer portal, import it into your key chain and export it as a passwordless PKCS #12 archive (e.g. Certificates.p12).
- Get the Worldwide Developer Relations Certificate,import it into your key chain and export it as a PEM (e.g. WWDR.pem).
- Use the node-passbooker CLI to extract the certificate and private key needed to sign your Passbooks.
- Put pass.pem, pass-key.pem and WWDR.pem in a dir your node app can access and set the keysPath to your template.
$ ./node_modules/passbooker/bin/node-passbooker -c './path/to/Certificates.p12' -o './keys/'
-->
keys
+--- pass.pem
+--- pass-key.pem
+--- WWDR.pem
Example
var path = ;var fs = ;var Passbooker = ; var templateOptions = // Mandatory passTypeIdentifier:'pass.acmecorp.genericFoo' teamIdentifier: 'XXXXXXXXXX' organizationName: 'ACME Corp' imagePath: path keysPath: path // Nice to have logoText: 'ACME Corp' description: 'Foo bar' ; var template = 'generic' templateOptions ; template var pass = template serialNumber: 'foo:bar:1'; pass ; pass;
Apples Passbook Programming Guide
Links:
Directory structure of a sample pass
[Pass package]
+--- icon.png
+--- icon@2x.png
+--- thumbnail.png
+--- thumbnail@2x.png
+--- pass.json
\--- de.lproj
+--- logo.png
+--- logo@2x.png
+--- pass.strings
\--- en.lproj
+--- logo.png
+--- logo@2x.png
+--- pass.strings