npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

apple-wallet-pass-generator

v1.1.4

Published

A TypeScript library for generating Apple Wallet business card passes with vCard support

Downloads

78

Readme

npm version npm downloads License: MIT TypeScript GitHub stars GitHub issues

A sleek, type-safe library for generating professional Apple Wallet business card passes with vCard support.


📖 Table of Contents


💡 Motivation

I built this library because I couldn't find a "plug and play" solution for generating Apple Wallet passes that just worked out of the box.

While building my digital business card product, Cardova, I had to spend a significant amount of time deep-diving into Apple's PassKit documentation, PKCS#7 signing, and manifest creation. Once I figured it out, I decided to package the logic into a clean, easy-to-use library so others wouldn't have to go through the same struggle. This is my first contribution to the open-source community!


✨ Features

  • Type-Safe - Built with TypeScript for full IntelliSense and type safety.
  • 📇 vCard Support - Automatically generate QR codes that allow users to save your contact info with one tap.
  • 🎨 Dynamic Branding - Custom colors, profile photos, and company logos with automatic contrast detection.
  • 🔗 Versatile QR Modes - Support for vCard, LinkedIn, and custom URLs.
  • 🔒 Secure Signing - Handles complex PKCS#7 signing and manifest creation out of the box.
  • 📱 Native Experience - Generates standard .pkpass files compatible with iOS Wallet.

🚀 Installation

# Using pnpm
pnpm add apple-wallet-pass-generator

# Using npm
npm install apple-wallet-pass-generator

# Using yarn
yarn add apple-wallet-pass-generator

🔑 Prerequisites

To use this library, you must have an Apple Developer Program account. You will need:

  1. Pass Type ID: Created in your Apple Developer Account.
  2. Certificates:
    • Pass Type ID Certificate: Downloaded from Apple and converted to PEM.
    • WWDR Certificate: The Apple Worldwide Developer Relations certificate.

[!TIP] See SETUP.md for a detailed step-by-step guide on how to export and convert your certificates.


⚡ Quick Start

1. Basic Generation

import { generateBusinessCardPass } from 'apple-wallet-pass-generator'
import { writeFileSync } from 'fs'

async function createPass() {
  const config = {
    passTypeIdentifier: 'pass.com.yourcompany.businesscard',
    teamIdentifier: 'YOUR_TEAM_ID',
    certificateBase64: process.env.APPLE_PASS_CERTIFICATE_BASE64!,
    certificatePassword: process.env.APPLE_PASS_CERTIFICATE_PASSWORD!,
    wwdrCertificateBase64: process.env.APPLE_WWDR_CERTIFICATE_BASE64!,
    organizationName: 'Your Company'
  }

  const cardData = {
    firstName: 'John',
    lastName: 'Doe',
    email: '[email protected]',
    title: 'Software Engineer',
    brandColor: '#156741',
    qrCodeMode: 'vcard'
  }

  const { buffer, filename } = await generateBusinessCardPass(cardData, config)
  writeFileSync(filename, buffer)
}

2. Next.js Integration

// app/api/wallet/route.ts
import { NextRequest, NextResponse } from 'next/server'
import { generateBusinessCardPass } from 'apple-wallet-pass-generator'

export async function POST(req: NextRequest) {
  const cardData = await req.json()
  const result = await generateBusinessCardPass(cardData, {
    /* your config */
  })

  return new NextResponse(result.buffer, {
    headers: {
      'Content-Type': 'application/vnd.apple.pkpass',
      'Content-Disposition': `attachment; filename="${result.filename}"`
    }
  })
}

🛠 API Reference

generateBusinessCardPass(cardData, config)

| Parameter | Type | Description | | :--- | :--- | :--- | | cardData | BusinessCardData | Information about the person/company on the pass. | | config | AppleWalletConfig | Your Apple Wallet credentials and certificates. |

BusinessCardData Options

| Property | Type | Required | Description | | :--- | :--- | :--- | :--- | | firstName | string | ✅ | User's first name | | lastName | string | ✅ | User's last name | | email | string | ✅ | Contact email address | | title | string | ✅ | Job title | | brandColor | string | ✅ | Hex color (e.g., #156741) | | company | string | ❌ | Company name | | profilePhoto | string | ❌ | Base64 Data URL (recommended 150x150px) | | qrCodeMode | string | ❌ | vcard, linkedin, or custom |


🛠 Project Status

This project is currently stable and feature-complete. While I use it for my own needs and will try to fix critical bugs, I am not actively looking for new features or accepting Pull Requests at this time. Feel free to fork the repository if you need to make custom modifications!


🛡 License

Distributed under the MIT License. See LICENSE for more information.