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

@belongnet/capacitor-pass-to-wallet

v8.0.4

Published

Allow to add .pkpass files to Apple Wallet

Downloads

522

Readme

@belongnet/capacitor-pass-to-wallet

Capacitor plugin to add .pkpass files to Apple Wallet.

npm downloads

Overview

Adds .pkpass files to Apple Wallet from a Capacitor app, using either base64 content or a local file URI.

  • addToWallet for a single pass
  • addMultipleToWallet for multiple passes
  • passExists to check whether a pass is already in Wallet

Quick start

bun add @belongnet/capacitor-pass-to-wallet
bunx cap sync

Basic usage

For step-by-step tutorials, see Adding Apple Wallet Passes and Creating Apple Wallet Passes.

Add pass from base64

import { CapacitorPassToWallet } from '@belongnet/capacitor-pass-to-wallet';

await CapacitorPassToWallet.addToWallet({
  base64: passBase64,
});

Add pass from local file

import { Filesystem, Directory } from '@capacitor/filesystem';
import { CapacitorPassToWallet } from '@belongnet/capacitor-pass-to-wallet';

const { uri } = await Filesystem.getUri({
  directory: Directory.Cache,
  path: 'passes/example.pkpass',
});

await CapacitorPassToWallet.addToWallet({
  filePath: uri,
});

Add multiple passes

// base64 mode
await CapacitorPassToWallet.addMultipleToWallet({
  base64: [base64Pass1, base64Pass2],
});

// file mode
await CapacitorPassToWallet.addMultipleToWallet({
  filePaths: [uri1, uri2],
});

Check if pass already exists

const result = await CapacitorPassToWallet.passExists({
  filePath: uri,
});

console.log(result.passExists);

[!NOTE] iOS is implemented. Android implementation in this repository is currently a placeholder.

Compatibility

| Capacitor Version | Plugin Version | | ----------------- | -------------- | | 7.x | package (v7) | | 8.x | 8.x |

Requirements (Capacitor 8)

  • @capacitor/core >=8.0.0
  • iOS deployment target: 15.0+
  • Android minSdkVersion: 24+
  • Android build defaults in this plugin: compileSdkVersion 36, targetSdkVersion 36, Java 21

References

API

addToWallet(...)

addToWallet(options: AddToWalletOptions) => Promise<AddToWalletResult>

Opens Apple Wallet sheet for a single .pkpass.

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | AddToWalletOptions |

Returns: Promise<AddToWalletResult>


addMultipleToWallet(...)

addMultipleToWallet(options: AddMultipleToWalletOptions) => Promise<AddToWalletResult>

Opens Apple Wallet sheet for multiple .pkpass files.

| Param | Type | | ------------- | --------------------------------------------------------------------------------- | | options | AddMultipleToWalletOptions |

Returns: Promise<AddToWalletResult>


passExists(...)

passExists(options: AddToWalletOptions) => Promise<PassExistsResult>

Checks whether a pass already exists in Apple Wallet.

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | AddToWalletOptions |

Returns: Promise<PassExistsResult>


_experimental_passExistsById(...)

_experimental_passExistsById(options: PassIdentifierOptions) => Promise<PassExistsResult>

Checks whether a pass exists by identifier and optional serial number.

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | PassIdentifierOptions |

Returns: Promise<PassExistsResult>


_experimental_canAddPasses()

_experimental_canAddPasses() => Promise<CanAddPassesResult>

Returns whether device can add passes.

Returns: Promise<CanAddPassesResult>


_experimental_openPassInWallet(...)

_experimental_openPassInWallet(options: PassIdentifierOptions) => Promise<OpenPassInWalletResult>

Opens an existing pass in Apple Wallet by identifier.

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | PassIdentifierOptions |

Returns: Promise<OpenPassInWalletResult>


_experimental_removePass(...)

_experimental_removePass(options: PassIdentifierOptions) => Promise<RemovePassResult>

Removes an existing pass from Apple Wallet by identifier.

| Param | Type | | ------------- | ----------------------------------------------------------------------- | | options | PassIdentifierOptions |

Returns: Promise<RemovePassResult>


_experimental_listPasses()

_experimental_listPasses() => Promise<ListPassesResult>

Lists wallet passes visible to the app.

Returns: Promise<ListPassesResult>


Interfaces

AddToWalletResult

| Prop | Type | Description | | ----------- | ------------------- | --------------------------------------------------------------------- | | value | string | Operation status. Returns "added" when the pass sheet is presented. |

AddToWalletOptions

| Prop | Type | Description | | -------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------- | | base64 | string | Base64-encoded .pkpass file content. Optional when filePath is provided. | | filePath | string | Native file path/URI to a .pkpass file (for example from Filesystem.getUri). Optional when base64 is provided. |

AddMultipleToWalletOptions

| Prop | Type | Description | | --------------- | --------------------- | -------------------------------------------------------------------------------------- | | base64 | string[] | List of base64-encoded .pkpass file contents. Optional when filePaths is provided. | | filePaths | string[] | List of native file paths/URIs to .pkpass files. Optional when base64 is provided. |

PassExistsResult

| Prop | Type | Description | | ---------------- | -------------------- | -------------------------------------------------------- | | passExists | boolean | true if the pass is already available in Apple Wallet. |

PassIdentifierOptions

| Prop | Type | Description | | ------------------------ | ------------------- | ------------------------------------------------------------------------ | | passTypeIdentifier | string | Wallet pass type identifier (for example pass.com.example.membership). | | serialNumber | string | Optional serial number to target a specific pass instance. |

CanAddPassesResult

| Prop | Type | Description | | ------------------ | -------------------- | ------------------------------------------------------ | | canAddPasses | boolean | true when the device can present add-to-wallet flow. |

OpenPassInWalletResult

| Prop | Type | Description | | ------------ | -------------------- | ------------------------------------------------------------------ | | opened | boolean | true when a matching pass was found and open action was started. |

RemovePassResult

| Prop | Type | Description | | ------------- | -------------------- | ---------------------------------------------------- | | removed | boolean | true when a matching pass was removed from wallet. |

ListPassesResult

| Prop | Type | Description | | ------------ | -------------------------------- | ----------------------------------------------- | | passes | WalletPassSummary[] | Passes currently visible in the wallet library. |

WalletPassSummary

| Prop | Type | Description | | ------------------------ | ------------------- | ------------------------------------------------------------------------ | | passTypeIdentifier | string | Wallet pass type identifier (for example pass.com.example.membership). | | serialNumber | string | Pass serial number. | | organizationName | string | Organization name from pass payload when available. |


License: MIT