Skip to content
Development

Apple Wallet Integration with Node.js and pkpass

Anshuman Chhapolia·19 August 2025·2 minutes

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

Step 1: Create a Pass Type ID and Certificate

  1. Log in to Apple Developer Account.
  2. Create a Pass Type ID (Certificates, Identifiers & Profiles → Identifiers → Pass Type IDs), enter a description and identifier, and save.
  3. Create a Certificate for the Pass Type ID. Generate a Certificate Signing Request (CSR) from your Mac:
bash
openssl req -new -newkey rsa:2048 -nodes -keyout pass.key -out pass.csr

Upload the CSR to the Apple Developer portal, then download the generated certificate (.cer).

  1. Export the certificate to .p12 format: double-click the .cer to install into Keychain Access, find it under My Certificates, right-click → Export, save as .p12, and set a password (you'll use this in Node.js).
  2. Download the Apple WWDR Certificate and convert it to .pem format:
bash
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.

Step 2: Install Dependencies

We'll use passkit-generator.

bash
npm install passkit-generator

Step 3: Create a Pass in Node.js

typescript
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());

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.

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.

© 2026 SMOKETREES DIGITAL LLP. ALL RIGHTS RESERVED.