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

expo-passkite

v1.0.2

Published

Generate Apple Wallet passes (.pkpass) and add them to iOS Wallet or Google Wallet

Readme

expo-passkite

Generate Apple Wallet passes (.pkpass) and add them to iOS Wallet or Google Wallet.

Documentation | API Reference | Setup Guide

Installation

npx expo install expo-passkite

Configuration

Add the config plugin to your app.json or app.config.js:

{
  "expo": {
    "plugins": [
      ["expo-passkite", {
        "passTypeIdentifiers": ["$(TeamIdentifierPrefix)pass.com.example.myapp"]
      }]
    ]
  }
}

Then run prebuild:

npx expo prebuild

Usage

Creating a Pass

import {
  createPassBuilder,
  createPass,
  PassType,
  BarcodeFormat,
  PassImageType,
} from 'expo-passkite';

// Build pass data
const builder = createPassBuilder()
  .setIdentifiers({
    passTypeIdentifier: 'pass.com.example.myapp',
    serialNumber: 'E5982H-I2',
    teamIdentifier: 'A93A5CM278',
  })
  .setOrganization({
    organizationName: 'Example Inc.',
    description: 'Example Store Card',
    logoText: 'Example',
  })
  .setPassType(PassType.StoreCard)
  .setColors({
    backgroundColor: 'rgb(206, 140, 53)',
    foregroundColor: 'rgb(255, 255, 255)',
  })
  .addPrimaryField({
    key: 'balance',
    label: 'Balance',
    value: '$50.00',
  })
  .addBarcode({
    format: BarcodeFormat.QR,
    message: 'https://example.com/card/E5982H-I2',
    altText: 'E5982H-I2',
  });

const { passData, images } = builder.build();

// Create the pass
const pass = createPass(passData, images);

// Set signing credentials (required for valid passes)
pass.setSigningCredentials({
  wwdrCertificate: wwdrCertPem,
  signerCertificate: signerCertPem,
  signerKey: signerKeyPem,
  signerKeyPassphrase: 'password', // if key is encrypted
});

// Generate .pkpass file
const pkpassBuffer = await pass.generate();

// Or generate as base64 for sending to native module
const pkpassBase64 = await pass.generateBase64();

Adding to Wallet

import {
  addPassToWallet,
  canAddPasses,
  isPassLibraryAvailable,
  containsPass,
} from 'expo-passkite';

// Check if wallet is available
const available = await isPassLibraryAvailable();
const canAdd = await canAddPasses();

if (canAdd) {
  // Generate pass as base64
  const passBase64 = await pass.generateBase64();

  // Add to wallet
  const result = await addPassToWallet(passBase64);

  if (result.success) {
    console.log('Pass added successfully!');
  } else {
    console.error('Failed to add pass:', result.error);
  }
}

// Check if a specific pass exists
const exists = await containsPass('pass.com.example.myapp', 'E5982H-I2');

Listening to Events

import { onPassAdded, onPassRemoved } from 'expo-passkite';

// Subscribe to pass added events
const addedSubscription = onPassAdded((event) => {
  console.log('Pass added:', event.passTypeIdentifier, event.serialNumber);
});

// Subscribe to pass removed events
const removedSubscription = onPassRemoved((event) => {
  console.log('Pass removed:', event.passTypeIdentifier, event.serialNumber);
});

// Clean up
addedSubscription.remove();
removedSubscription.remove();

Pass Types

  • PassType.BoardingPass - Airline, train, bus, boat boarding passes
  • PassType.Coupon - Coupons and offers
  • PassType.EventTicket - Concert, movie, sports event tickets
  • PassType.StoreCard - Loyalty and membership cards
  • PassType.Generic - General purpose passes

Signing Passes

To create valid passes that can be added to Apple Wallet, you need:

  1. Apple Developer Account with Pass Type ID capability
  2. Pass Type ID registered in Apple Developer Portal
  3. Pass Type ID Certificate (.p12 or .pem)
  4. Apple WWDR Certificate (Worldwide Developer Relations)

Obtaining Certificates

  1. Log in to Apple Developer Portal
  2. Go to Certificates, Identifiers & Profiles
  3. Create a Pass Type ID under Identifiers
  4. Create a Pass Type ID Certificate under Certificates
  5. Download the WWDR certificate from Apple

Converting Certificates

# Convert .p12 to PEM files
openssl pkcs12 -in pass.p12 -out signerCert.pem -clcerts -nokeys
openssl pkcs12 -in pass.p12 -out signerKey.pem -nocerts -nodes

Android / Google Wallet

For Android, the addPassToWallet function expects a Google Wallet JWT token instead of a .pkpass file. You'll need to:

  1. Set up a Google Wallet API account
  2. Create pass classes and objects via the Google Wallet API
  3. Generate a signed JWT token server-side
  4. Pass the JWT to addPassToWallet

See Google Wallet API documentation for details.

Documentation

For complete documentation, visit seventwo-studio.github.io/passkite

License

MIT