Development

Apple Wallet Integration with Node.js and pkpass

Anshuman Chhapolia
19 August 2025

Introduction

Apple Wallet (PassKit) enables users to store event tickets, passes, and boarding passes directly on their iPhones for instant access. In this guide, we’ll cover how to integrate Apple Wallet into your Node.js application using .pkpass files and the passkit-generator package.

We’ll go step by step: from setting up certificates in Apple Developer Portal to generating passes and delivering them to users.

How Apple Wallet Passes Work

An Apple Wallet pass (.pkpass) is simply a zipped bundle containing:

  • pass.json — metadata (event info, barcodes, colors)
  • Images (icon, logo, strip, background)
  • manifest.json — list of files with hashes
  • signature — signed with your Apple certificate

Apple PassKit Package Format Reference

📷 Diagram Idea: PassKit bundle structure (folders + files).


Step 1: Create a Pass Type ID and Certificate

  1. Log in to Apple Developer Account.
  2. Create a Pass Type ID
    • Go to Certificates, Identifiers & Profiles → Identifiers → Pass Type IDs
    • Click ➕ Add
    • Enter a description (e.g., Event Tickets)
    • Enter an identifier (e.g., com.yourcompany.eventtickets)
    • Save
  3. Create a Certificate for the Pass Type ID
    • Go to Certificates in the Developer portal
    • Select Pass Type ID → choose the one you created
    • Click Create Certificate
    • Generate a Certificate Signing Request (CSR) from your Mac:
      openssl req -new -newkey rsa:2048 -nodes -keyout pass.key -out pass.csr
    • Upload the CSR to Apple Developer portal
    • Download the generated certificate (.cer)
  4.  Export Certificate to .p12 Format
    1. Double-click the downloaded .cer to install into Keychain Access
    2. Find it in Keychain Access → My Certificates
    3. Right-click → Export → Save as .p12
    4. Set a password (you’ll use this in Node.js)
  5. Download the Apple WWDR Certificate
    1. Download from Apple Worldwide Developer Relations Certificate
    2. Convert it to .pem format:
      openssl x509 -in AppleWWDRCAG3.cer -inform DER -out wwdr.pem -outform PEM

At this point, you have:

  • pass.p12 → Pass Type Certificate (with password)
  • wwdr.pem → Apple WWDR certificate
  • pass.key → private key

These will be used to sign your passes in Node.js.

📷 Screenshot Idea: Apple Developer portal showing Pass Type ID and certificate creation.

Step 2: Install Dependencies

We’ll use passkit-generator.

npm install passkit-generator

Step 3: Create a Pass in Node.js

 
				
					import {
    PKPass
} from "passkit-generator";
import fs from "fs";
// Load certificates
const cert = fs.readFileSync("./certs/pass.p12");
const wwdr = fs.readFileSync("./certs/wwdr.pem");
const password = "your-cert-password";
// Create pass
const pass = new PKPass({
    model: "./eventPass", // folder containing pass.json + images
    certificates: {
        wwdr,
        signerCert: cert,
        signerKeyPassphrase: password,
    },
}, {
    serialNumber: "TICKET12345",
    description: "Concert Ticket",
});


// Add details
pass.fields.primaryFields.add("event", "Concert Night", "Gate Opens 7 PM");
pass.fields.secondaryFields.add("venue", "Sunshine Arena");

// Add QR code 
pass.setBarcodes({
    message: "TICKET12345",
    format: "PKBarcodeFormatQR",
});
// Save pass 
fs.writeFileSync("event-ticket.pkpass", pass.getAsBuffer());
				
			

Apple Pass JSON Keys Reference

Step 4: Deliver the Pass to Users

  • Serve .pkpass via download link or email attachment.
  • On iOS → “Add to Wallet” prompt appears.
  • On Android → Gmail/Chrome detect .pkpass and allow opening.

Distributing Passes

📷 Diagram Idea: Flow of Backend → User Download → Add to Wallet.

Step 5: Validate and Test

  • Use Apple’s Pass Validator to check correctness.
  • Test on multiple iOS devices and versions.

Conclusion

By creating a Pass Type ID and certificates in the Apple Developer portal, then generating .pkpass files in Node.js, you can integrate Apple Wallet support into your ticketing system and deliver a seamless user experience.

Business Solution

Tally + Excel vs Custom ERP Layer: The Smarter Path for Growing Manufacturers

For Indian manufacturing founders and CFOs navigating their next operational upgrade. The Tally vs ERP question for manufacturers is ultimately not about software preference, it is about operational maturity. There is a specific kind of Friday evening that every manufacturing...

Business Solution

Inside a Finance Automation System That Reduced Effort by 67%

Your Heading How we replaced a broken Excel-based commission process with a SQL-powered automation engine — cutting a 24-hour monthly cycle down to 8 hours. Every month, a team of finance specialists sat down with a sprawling Excel workbook. Their...

Business Solution

Refund Logic Commission Errors and Why Your Reports Never Match

Every ecommerce finance team has lived this moment: the monthly close is approaching, your payment gateway shows one number, QuickBooks shows another, and the affiliate dashboard appears to be operating in a separate dimension entirely. You reconcile for hours, patch...

Business Solution

Why Growing Manufacturing Businesses Can’t See What’s Happening Inside Their Own Operations

You’re running a manufacturing business that’s doing well. Somewhere between ₹20 crore and ₹100 crore in annual revenue. You have a plant, a team, orders coming in, and real customers who depend on you. And yet, every week, something surprises...

Ecommerce

Why Marketplace Reconciliation Breaks for D2C Brands

You're selling on Amazon, Flipkart, Meesho — revenue looks healthy. But quietly, 3–5% of your GMV is disappearing into a black hole of fees, return mismatches, and settlement gaps. Here's why it happens, and what modern D2C finance teams are...