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

react-native-cloudcard

v0.1.0

Published

React Native package for CloudCard card digitalization and contactless payments

Downloads

14

Readme

react-native-cloudcard (CloudCard React Native)

A React Native package for Sudo’s CloudCard digital wallet API, enabling seamless digital card operations and contactless payments.

Overview

CloudCard React Native provides an interface for managing digital cards, including provisioning, management, and transactions. It wraps Sudo Africa’s CloudCard API to offer a comprehensive solution for card lifecycle management, tokenization, and payment operations in your React Native applications.

Installation

npm install react-native-cloudcard

OR

yarn add react-native-cloudcard

Configure Android Access

Ensure your Android project has access to the SDK:

// For older Gradle (pre-7):
// android/build.gradle
allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://sdk.sudo.africa/repository/maven-releases/")
            credentials {
                username = project.findProperty("maven.repo.username") ?: ""
                password = project.findProperty("maven.repo.password") ?: ""
            }
        }
    }
}

// For Gradle 7+ (React Native 0.71+):
// android/settings.gradle
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://sdk.sudo.africa/repository/maven-releases/")
            credentials {
                username = project.findProperty("maven.repo.username") ?: ""
                password = project.findProperty("maven.repo.password") ?: ""
            }
        }
    }
}

Replace YOUR_USERNAME and YOUR_PASSWORD with the credentials provided by Sudo Africa.

Register service and receiver in your android manifest

 <service
            android:name="com.sudo.cloud_card.HCEService"
            android:enableOnBackInvokedCallback="true"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.BIND_NFC_SERVICE">
            <intent-filter>
                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

            <meta-data
                android:name="android.nfc.cardemulation.host_apdu_service"
                android:resource="@xml/apduservice" />
        </service>


        <receiver
            android:name="africa.sudo.cloudcard_flutter.HceEventReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="${packageName}.CLOUDCARD_EVENT" />
            </intent-filter>
        </receiver>
        ```


## Configure iOS Access
Create a .env file and add SUDO credentials

```sh
SUDO_USER=....
SUDO_PASS=....

Authenticate with ephemeral .netrc

export $(grep -v '^#' .env | xargs)

TMPHOME=$(mktemp -d)
trap 'rm -rf "$TMPHOME"' EXIT
export HOME="$TMPHOME"

cat > "$HOME/.netrc" <<EOF
machine sdk.sudo.africa
login $SUDO_USER
password $SUDO_PASS
EOF
chmod 600 "$HOME/.netrc"

Install pods

cd ios && pod install

Usage

Initialize

import CloudCard from 'react-native-cloudcard';

async function initializeCloudCard() {
  // Use true for sandbox, false for production
  await CloudCard.init({
    isSandbox: true,
    onCardScanned: (event: CloudCardEvent) => {
      // Handle navigation to card page
    },
    onScanComplete: (event: CloudCardEvent) => {
      // Scan complete - Show UI update
    },
  });
}

Sandbox vs Production

Sandbox Mode: Use for development and testing (isSandbox: true) Production Mode: Use for live applications (isSandbox: false)

Register Card

const registrationData = {
  walletId: 'wallet-id-from-sudo',
  paymentAppInstanceId: 'device-id-eg-firebase-id',
  accountId: 'account-id-or-card-id',
  secret: 'secret-key',
  jwtToken: 'jwt-token-from-sudo',
};

const result = await CloudCard.registerCard(registrationData);
if (result.status === 'SUCCESS') {
  // Card successfully registered
}

Get Cards

const cards = await CloudCard.getCards();
cards.forEach(card => {
  console.log(`Card ID: ${card.id}, Last 4: ${card.last4}, Network: ${card.network}`);
});

Generate EMV QR Code

const result = await CloudCard.getEmvQr({
  cardId: 'card-id-here',
  amount: '000000000100', // Optional
  foregroundColorHex: '#000000',
  backgroundColorHex: '#FFFFFF',
});

if (result.success && result.data) {
  const qrCodeData = result.data.qrCode;
  // Display QR code to user
}

Get Saved Transactions

Retrieve up to 5 recently completed transactions:

const transactions = await CloudCard.getSavedTransactions();
transactions.forEach(txn => {
  console.log(`ATC: ${txn.atc}, Amount: ${txn.amount}, Time: ${new Date(txn.timestamp).toLocaleString()}`);
});

Additional Features

NFC Operations: Check NFC availability and set up payment defaults Card Management: Freeze/unfreeze cards, delete cards Security: Manage authentication requirements and key replenishment Token Management: Get token usage summaries and thresholds

Transaction Processing

For transaction processing functionality, please use the companion library react-native-tappa.

Requirements

React Native 0.68+ iOS 13.0+ / Android API level 21+ NFC-enabled device for NFC contactless payments (Not required for QR payments)

Support

For support, please contact [email protected] or visit sudo.africa.

Contributing

License

MIT


Made with create-react-native-library