Socket
Book a DemoInstallSign in
Socket

passbooker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passbooker

Generates Apple Passboks

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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 = require('path');
var fs = require('fs');
var Passbooker = require('passbooker');

var templateOptions = {
  
  // Mandatory
  passTypeIdentifier:'pass.acmecorp.genericFoo',
  teamIdentifier: 'XXXXXXXXXX',
  organizationName: 'ACME Corp',
  imagePath: path.join( __dirname, 'samples', 'images' ),
  keysPath: path.join( __dirname, 'samples', 'keys' ),

  // Nice to have
  logoText: 'ACME Corp',
  description: 'Foo bar'

};

var template = new Passbooker.Template( 'generic', templateOptions );

template
  .setPrimaryField( 'headline', 'ACME Generic card' )

var pass = new Passbooker.Pass( template, {
  serialNumber: 'foo:bar:1'
});

pass
  .setSecondaryField( 'acme_id', 'ID', 'xxxx' )
  .setSecondaryField( 'acme_pin', 'PIN', 'xxxx' )
  .setBackField( 'acme_id', 'ID', 'xxxx' );

pass.getPackage(function( err, passPackage ) {
  if ( !!err ) {
    return console.log( err );
  }
  fs.writeFileSync( './samples/fooBar.pkpass', passPackage );
});


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

Keywords

Apple

FAQs

Package last updated on 02 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.