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

How Financial Automation Eliminates Revenue Leakage in High-Volume Ecommerce

What Is Financial Leakage in Ecommerce?​ Financial leakage refers to unintended loss of revenue or profit, money that should be in your bank account but isn’t. In high-volume e-commerce, leakage comes in dozens of forms: Manual entry errors in order...

Uncategorized

The Hidden Cost of Running Your Business on Paper

At first glance, paper-based processes seem harmless. A few files here, some registers there, spreadsheets printed and signed, it feels familiar, affordable, and “good enough.”But beneath this comfort lies a growing, invisible cost that quietly slows your business down. If...

Case Study

How we saved time making estimates easy for property buying company

Client Overview Our client is a property investment and resale company that acquires residential properties, enhances their value, and sells them in the open market. Their business relies on accurate purchase price estimation to ensure strong margins and faster decision-making....

Case Study

When Off-the-Shelf Software Fails: A Case Study from Tixverse

Most businesses don’t fail because they lack software. They fail because the software they use stops fitting their reality. This is a short case study about Tixverse, an event ticketing platform, and how a seemingly small feature gap became a...

UX Design

The Calendar That Makes You Walk More: A Smarter Way to Track Your Daily Steps

Most step counters tell you how much you walked.Very few tell you how consistently you walked. That’s where this new step-tracking calendar changes the entire experience. It doesn’t just measure your movement.It visualizes your discipline. With a simple grid of...