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

@reeq/react-native-passkit

v0.1.5

Published

React native wrapper over google PayClient (for android) and PassKit (for iOS). Contains google and apple buttons

Readme

react-native-passkit

React native wrapper over google PayClient (for android) and PassKit (for iOS). Contains google and apple buttons

Installation

$ npm install --save @reeq/react-native-passkit
# --- or ---
$ yarn add @reeq/react-native-passkit

and

$ pod install

Usage

import {
  AddPassButton,
  addPass,
  canAddPasses,
  containsPass,
} from '@reeq/react-native-passkit';

const handleAddPassButton = async () => {
  try {
    const pass = 'BASE_64_ENCODED_STRING';

    const isAddable = await canAddPasses();

    if (!isAddable) {
      return;
    }

    const hasPassAlready = await containsPass(pass);

    if (hasPassAlready) {
      return;
    }

    await addPass(pass);
  } catch (err) {
    console.log(err);
  }
};

<AddPassButton
  variant={{
    android: 'light',
    ios: 'dark-outline',
  }}
  onPress={handleAddPassButton}
/>;

Components

AddPassButton

Platform: iOS/Android

Type

type AndroidVariant = 'dark' | 'light' | 'light-outline';
type iOSVariant = 'dark' | 'dark-outline';

interface AddPassButtonProps extends ViewProps {
  variant?: {
    ios?: iOSVariant;
    android?: AndroidVariant;
  };
  onPress?: () => void;
}

type AddPassButton: React.FC<AddPassButtonProps>

Usage

import { AddPassButton } from '@reeq/react-native-passkit';
import { Platform } from 'react-native';

//...

<AddPassButton
  variant={{
    android: 'light', // Default is 'dark'
    ios: 'dark', // Default is 'dark-outline'
  }}
  onPress={() => {
    console.log("I'm pressed");
  }}
  style={{
    height: Platform.select({
      android: 44,
      ios: 60,
    }),
    width: Platform.select({
      android: 288,
      ios: 260,
    }), // This style is default. Can be overriden
  }}
/>;

API

addPass()

Platform: iOS/Android

Type

type addPass = (base64EncodedPass: string) => Promise<void>;

Usage

import { addPass } from '@reeq/react-native-passkit';

//...

await addPass('BASE_64_ENCODED_PASS');

addPassJWT()

Platform: Android

Type

type addPassJWT = (passJWT: string) => Promise<void>;

Usage

import { addPassJWT } from '@reeq/react-native-passkit';

//...

await addPassJWT('JWT_SIGNED_PASS');

canAddPasses()

Platform: iOS/Android

Type:

type canAddPasses = () => Promise<boolean>;

Usage

import { canAddPasses } from '@reeq/react-native-passkit';

//...

const canAdd = await canAddPasses();

console.log(canAdd); // true / false

containsPass()

Platform: iOS

Type

type containsPass = (base64encodedPass: string) => Promise<boolean>;

Usage

import { containsPass } from '@reeq/react-native-passkit';

//...

const hasPassInWallet = await containsPass('BASE_64_ENCODED_PASS');

console.log(hasPassInWallet); // true / false

addPassResultListener()

Platform: iOS/Android

Type

type AddPassResultStatus = 'success' | 'cancelled' | 'error';

type AddPassResultErrorType = 'api' | 'unexpected';

interface AddPassResultEvent {
  status: AddPassResultStatus;
  errorType?: AddPassResultErrorType;
  message?: string;
}

type addPassResultListener = (
  callback: (event: AddPassResultEvent) => void
) => EmitterSubscription.remove;

Usage

import { addPassResultListener } from '@reeq/react-native-passkit';
import { useEffect } from 'React';

//...

useEffect(() => {
  const unsubscribe = addPassResultListener((event) => {
    console.log(event); // { status: 'success' }
  });
  return () => {
    unsubscribe();
  };
}, []);

useAddPassResult()

Platform: iOS/Android

Type

type AddPassResultStatus = 'success' | 'cancelled' | 'error';

type AddPassResultErrorType = 'api' | 'unexpected';

interface AddPassResultEvent {
  status: AddPassResultStatus;
  errorType?: AddPassResultErrorType;
  message?: string;
}

type useAddPassResult: () => AddPassResultEvent | undefined

Usage

import { useAddPassResult } from '@reeq/react-native-passkit';

//...

const passAddResult = useAddPassResult();

console.log(passAddResult); // { status: "success" }

How to create pass

iOS

  • pass-js creating pass lib for node js

Android

Localization

iOS

By default iOS add pass button does not support localization. To enable languages you want to support add them in XCode under Localizations list in the Info tab of the project. Button's localization will change automatically based on user phone setting's locale.

Android

By default Android will apply localization for button with all available languages. To restrict app to support only specific languages you need to do the following in android/app/build.gradle:

android {

	//...

    defaultConfig {
    	//...

        resConfigs("en", "da", "uk") // restrict locale to English, Danish and Ukrainian
    }
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library