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

@macellan/masterpass-sdk

v1.2.0

Published

The Masterpass SDK provides a comprehensive set of features to interact with Masterpass services. This module includes utilities for handling various Masterpass-related tasks such as user registration, card management, transaction validation, and making p

Readme

Macellan - MasterPass SDK

The Masterpass SDK provides a comprehensive set of features to interact with Masterpass services. This module includes utilities for handling various Masterpass-related tasks such as user registration, card management, transaction validation, and making purchases.

Features

  • 🛠️ Ease of Use : Simplifies interactions with the MasterPass Web SDK by removing the need to work with iframes and handling complex setups, presenting a straightforward API to accelerate development processes.

  • 🌍 Framework Agnostic: The SDK is compatible with any JavaScript framework such as React, React Native, Vue, Angular, or Vanilla JavaScript, providing a versatile solution regardless of the technological stack.

  • 💅 Type Safety: Fully supports TypeScript, offering a type-safe environment that helps in preventing many common bugs that can occur during development, ensuring more stable code.

Installation

npm install @macellan/masterpass-sdk
yarn add @macellan/masterpass-sdk

Usage

MasterPassSDK.setAddress('MASTERPASS_SERVICE_URL')
MasterPassSDK.setClientId('MASTERPASS_CLIENT_ID')

const registerResponse = await MasterPassSDK.register({
    msisdn: '1234567890', // Mobile number
    token: 'SOME_AUTH_TOKEN', // Authentication token received from your backend server
    rtaPan: '4512345678901234', // Real-time PAN (Primary Account Number) of the card
    expiryDate: '1224', // MMYY format
    accountAliasName: 'My Card', // A user-friendly name for the card
    sendSms: 'N', // Whether to send confirmation via SMS
    sendSmsLanguage: 'ENG', // Language of the SMS (often as language codes such as "ENG" for English)
    referenceNo: 'REF123456789', // Unique reference for the transaction
})

const listCardsResponse = await MasterPassSDK.listCards(
    '1234567890', // Mobile number
    'SOME_AUTH_TOKEN' // Authentication token received from your backend server
)

API Reference

  • setAddress(serviceUrl: string): void

    • Sets the address of the MasterPass service endpoint.
  • setClientId(clientId: string): void

    • Sets the client ID for interaction with MasterPass services.
  • checkMasterPass(data: CheckMasterPassData): Promise<CheckMasterPassResponse>

    • Checks the status with MasterPass using provided data.
    • Parameters:
      • data: CheckMasterPassData - Object containing user ID, token, etc.
  • listCards(msisdn: string, token: string): Promise<ListCardsResponse>

    • Lists all linked cards associated with the given mobile number.
    • Parameters:
      • msisdn: string - Mobile number.
      • token: string - Authentication token.
  • register(data: RegisterData): Promise<RegisterResponse>

    • Registers a new card with MasterPass.
    • Parameters:
      • data: RegisterData - Registration data like msisdn, token, etc.
  • validateTransaction(data: ValidateTransactionData): Promise<ValidateTransactionResponse>

    • Validates a transaction with the provided data.
    • Parameters:
      • data: ValidateTransactionData - Data for transaction validation.
  • deleteCard(data: DeleteCardData): Promise<DeleteCardResponse>

    • Deletes a card from the MasterPass database.
    • Parameters:
      • data: DeleteCardData - Information of the card to be deleted.
  • getLastToken(): string

    • Retrieves the last stored token.
  • resendOtp(sendSmsLanguage: string): Promise<ResendOtpResponse>

    • Resends the OTP for user verification.
    • Parameters:
      • sendSmsLanguage: string - Language code for the SMS.
  • linkCardToClient(data: LinkCardToClientData): Promise<LinkCardToClientResponse>

    • Links a card to a MasterPass client.
    • Parameters:
      • data: LinkCardToClientData - Data required for linking a card.
  • purchase(data: PurchaseData): Promise<PurchaseResponse>

    • Processes a purchase transaction.
    • Parameters:
      • data: PurchaseData - Data required for the purchase.
  • purchaseAndRegister(data: PurchaseAndRegisterData): Promise<PurchaseAndRegisterResponse>

    • Combines the actions of purchase and registration in a single step.
    • Parameters:
      • data: PurchaseAndRegisterData - Data for purchase and registration.
  • directPurchase(data: DirectPurchaseData): Promise<DirectPurchaseResponse>

    • Initiates a direct purchase without a pre-linked card.
    • Parameters:
      • data: DirectPurchaseData - Data required for direct purchase.
  • setAdditionalParameters(data: object): void

    • Sets additional parameters for configuration.
    • Parameters:
      • data: object - Parameters to be set.

Contributing

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

License

This project is licensed under the MIT License.