$ npm install passbookster
To create a pass, you first create a pass template which holds information that remains static for each subsequent pass created from the template. Then you can create a Pass by providing the rest of the fields and images.
A Pass can act as a stream, or as a plain-callback async operation. Performance-wise you should use the stream interface, when its possible to pipe the pass to another stream. (eg store to filesystem or Amazon S3)
openssl must be installed, and inside the
$PATH. It is used internally to calculate the pass signature, since node crypto API does not support PKCS 7. (TODO).
var passbook =var template = passbookvar pass = templatepass
var template = passbook
The style of the pass.
Must be one of: 'boardingPass', 'coupon', 'eventTicker', 'storeCard', 'generic'
Any field that should be included in all passes created from this template. Usually you want these to be passTypeIdentifier, teamIdentifier and organizationName, but it's completely ok to pass any pass field. These will be merely copied to each pass you create.
Object containing extra information about this pass. Only certificates for now.
Object with keys
pass and values the paths to the apple WWDR certificate and the pass certificate.
An object containing paths to apple wwdr and the pass certificate.
Pass to apple wwdr certificate
Pass to pass certificate
Rest of the fields you want this pass to have. Fields provided to the template will be included.
Optional callback function. If a callback is provided, then the pass will not act as a stream, and will call this function as
cb(err, res) when its done. Result is a buffer of the .pkpass created.
Images should be passed either in the template or pass fields. Type must be stream, buffer or path string. Valid image keys are: 'icon', 'logo', 'strip', 'thumbnail', 'background', 'footer' and a '2x' version of each of those, in case you also have high resolution images for retina displays.
export WWDR_CERT=/path/to/wwdr.certexport PASS_CERT=/path/to/pass.certnpm test