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

@payfurl/client

v4.11.4

Published

Collect payment details in the browser and turn them into a payFURL payment token that your server charges through the [payFURL API](https://docs.payfurl.com/guides). Cards, PayPal, Google Pay, Apple Pay, PayTo, Click to Pay and more, through one integrat

Downloads

2,341

Readme

payFURL Client SDK

Collect payment details in the browser and turn them into a payFURL payment token that your server charges through the payFURL API. Cards, PayPal, Google Pay, Apple Pay, PayTo, Click to Pay and more, through one integration.

Card details are typed into fields that payFURL hosts in an iframe, so card numbers never reach your page's code.

Documentation · API reference · Changelog · Support

Install

npm install @payfurl/client

To load the SDK from a <script> tag instead, see Get started.

Quick start

Add a container inside your payment form:

<form method="POST" action="/pay">
  <div id="payment"></div>
  <button type="submit">Pay</button>
</form>

Then add the Drop In UI, which shows every payment method your account has for the amount and currency:

import payfurl from "@payfurl/client";

payfurl
  .init("sandbox", "<your public key>")
  .addDropIn("payment", 20, "AUD");

When the shopper submits the form, the SDK collects the payment details, adds the result to the form as a hidden input, and submits it to your server: token for a card, transactionId for PayPal and other payment types that complete the payment themselves. To keep the shopper on the page, handle the result yourself:

payfurl
  .onSuccess((message) => {
    // message.token for a card, message.transactionId for PayPal and other payment types
    // that complete the payment themselves
  })
  .onFailure((message) => console.error(message.error));

Your public key is on Account Info in the payFURL dashboard. Use "production" and a production key to go live.

Payment methods

| Method | Adds | |---|---| | addDropIn | Every payment method on your account, in one component | | addCard | A card form | | addPaypal | PayPal buttons | | addGooglePay | A Google Pay button | | addApplePay | An Apple Pay button | | addPayTo | A PayTo agreement form | | addCheckout | A third-party checkout, such as Afterpay or Affirm | | addSavedPaymentMethods | A customer's saved cards |

Each has its own page in the documentation, with its options.

TypeScript

The package includes its type definitions. Every option type can be imported by name:

import payfurl, { type DropInOptionsType, type SuccessResponseType } from "@payfurl/client";

const options: DropInOptionsType = { allowedPaymentTypes: ["card", "googlepay"] };
payfurl.init("sandbox", "<your public key>")
  .addDropIn("payment", 20, "AUD", options)
  .onSuccess((message: SuccessResponseType) => console.log(message.token));

React and Vue

@payfurl/react-plugin and @payfurl/vue-plugin wrap the Drop In UI in a component: see React and Vue.

Changelog

What changed in each version of the payFURL Client SDK. The @payfurl/client npm package and the script on assets.payfurl.com share version numbers, so this covers both. The changelog starts with version 4.9.3.

4.11.4 (2026-11-18)

Added

  • Apple Pay buttonOptions in addApplePay and in addDropIn's applePayOptions: set the Apple Pay button's style (black, white or white-outline), its type (such as donate, check-out, subscribe or plain), its locale, and its width, height and corner radius. Without it, the button stays a black "Buy with Apple Pay" button in US English. The options don't apply to PayWay, which draws its own Apple Pay button.

4.11.3 (2026-11-17)

Changed

  • The error reports the SDK sends to payFURL now include the page's address without its query string or fragment, a random ID for the page visit, and the error's stack trace. Card details are still never included. Each error is sent once per page, and an error thrown by your own onSuccess, onFailure, onLoaded, onValidate or onValidationStatusChange handler is no longer reported as an SDK error. Your handler's error still reaches the browser as before.
  • The SDK now also reports payment failures you could see but payFURL could not: API requests that fail with no response or a server error, the card form not loading, 3-D Secure failures, and Apple Pay, Google Pay or PayPal failing to load.

4.11.2 (2026-11-12)

Changed

  • When the bank's 3-D Secure answer for a card is a failure, the card is still submitted to payFURL, so the failure and its 3-D Secure result now show on the dashboard's Tokenise Failures page. The shopper sees the same message, and onFailure gets the same error and errorDetails.reason as before.
  • isApplePayAvailable() is now documented to work before init(), with no public key, as it already did: you can decide whether to offer Apple Pay before you set up the SDK. No upgrade is needed for this.

4.11.1 (2026-11-11)

Added

  • paypalButtonStyle, in addPaypal() and addDropIn(), also takes PayPal's button style as an object, such as { color: 'black', shape: 'pill', label: 'pay' }, to set the buttons' shape, label, layout and height as well as their colour.
  • addDropIn() takes paypalHideShipping, which redacts the shipping address from the PayPal site, as hideShipping does in addPaypal().

Changed

  • In TypeScript, paypalButtonStyle is now typed as one of the colours (gold, blue, silver, white, black) or a button style object, in place of any string. If you pass a variable typed string, type it as PaypalButtonColor, exported by @payfurl/client.

Fixed

  • addDropIn() now uses paypalButtonStyle and paypalEnablePayIn4. Before, the drop-in always showed a gold PayPal button without Pay Later, whatever you passed.
  • When PayPal rejects the button style, onPaymentMethodStatus() now reports PayPal as unavailable.

4.11.0 (2026-11-06)

Added

  • isApplePayAvailable() returns a promise of whether the shopper's browser can pay with Apple Pay: the same check addApplePay() and addDropIn() use to decide whether to show the Apple Pay button.
  • onPaymentMethodStatus() tells you when a Google Pay, Apple Pay, PayPal, PayTo, checkout (such as PayID or Zip) or UPI button or form has rendered, or that it won't and why: no provider for it on your account, not supported in the shopper's browser, or an error, such as a checkout that couldn't be created or invalid PayTo options. Before, these showed on the page only, or nowhere.
  • onThreeDsProgress() tells you when 3-D Secure starts, when the shopper is shown a challenge, and when it completes, successfully or not.
  • @payfurl/react-plugin and @payfurl/vue-plugin 1.5.0: PayfurlDropin takes onPaymentMethodStatus and onThreeDsProgress (in Vue, the @onPaymentMethodStatus and @onThreeDsProgress events), and customer, billingAddress and order props, which it could not receive before. Its Vue events are typed. They need this version of @payfurl/client or later.
  • You can call setCustomerInfo() after addCard() or addDropIn(), for example when the shopper changes their email: the new email is used for 3-D Secure, and the card form hides its own Email field once it has a valid one. The same email now also reaches the fraud check and the card token. setCustomerInfo() is now the preferred way to pass the shopper's email; threeDSEmail still works and is used when setCustomerInfo() has no email.

Changed

  • If your code reads onFailure's error text to detect a 3-D Secure failure, read errorDetails.reason instead. When 3-D Secure fails, the card form and onFailure's error now say "Your bank couldn't verify this card. Please try again or use a different card." in place of a technical message such as "3D Secure failed", which is now in errorDetails.reason.
  • For PayPal, onLoaded is now called once the PayPal buttons have rendered, rather than when they were requested, and not at all if they fail to render.

Fixed

  • A shopper known to Click to Pay gets one passcode per checkout, not one each time your page calls setCustomerInfo(). Click to Pay looks the shopper up again only when their email or phone changes to one not yet looked up, a second after the last change; a call without an email keeps the email it had. The passcode is sent only once the card form is on screen. Details set before addCard() or addCardLeastCost() start Click to Pay no longer start it early (preloadClickToPay() still loads it ahead).
  • The card form no longer grows to a large blank area while 3-D Secure runs: it keeps its height, with the loading spinner, until a challenge actually appears, and does not grow at all when the card passes without one.
  • The card form's Email field, a PayTo PayID email and Click to Pay sign-in now accept email addresses whose domain ends in more than three letters, such as [email protected].
  • PayTo now calls your failure handler when the agreement can't be created from what the shopper entered ("Invalid payment details", with errorDetails when available), and checkout providers and UPI when the payment fails after the shopper opened the provider's page ("Checkout has been cancelled"). Before, these errors only showed on the page.
  • In TypeScript, providerId and options of addApplePay() are now optional, as documented.
  • In the Drop In UI, allowedPaymentTypes: ['payglocal'] now shows PayGLocal. It used to need 'zip', which also showed Zip.
  • Adding Google Pay or PayPal again after its script failed to load now loads it again.
  • A checkout payment (such as PayID or Zip) no longer calls your success handler twice, or your failure handler after your success handler, when payFURL's status check answers slowly.

4.10.0 (2026-11-04)

Added

  • TypeScript types. The package now includes type definitions for every method, option and handler, so your editor suggests them and the TypeScript compiler checks your calls. Import the types by name, for example import payfurl, { type DropInOptionsType, type SuccessResponseType } from "@payfurl/client".
  • setCurrency() changes the currency of the card, Google Pay, Apple Pay and saved payment method components already on the page, as setAmount() does for the amount. Add PayPal, PayTo and Checkout components again for a new currency.
  • @payfurl/react-plugin and @payfurl/vue-plugin 1.4.0 use these types for their props and events, and their own type definitions now load.

Fixed

  • Google Pay errors now reach your failure handler. Closing the Google Pay sheet is still not a failure.
  • The close button of the Ecentric 3-D Secure challenge now closes it.
  • @payfurl/react-plugin 1.4.0: PayfurlDropin no longer fails when it mounts, and no longer rebuilds the drop-in, losing what the shopper typed, each time its parent re-renders. A new amount or successMessage updates the drop-in in place.

4.9.10 (2026-10-29)

Added

  • Forter fraud screening for Google Pay and Apple Pay payments, on accounts that use Forter.

Fixed

  • When you add several components at once, each now uses its own options and provider. A component added while another was still loading used to take the first one's.
  • The loading spinner no longer reappears after a failed Forter 3-D Secure challenge.

4.9.9 (2026-10-25)

Fixed

  • PayID through Azupay now appears in the Drop In UI. A Drop In with PayID as its only payment method never finished loading.

4.9.8 (2026-10-22)

Added

  • Forter fraud screening for tokeniseWith3Ds, tokeniseCard, addThreeDsWithToken and addSavedPaymentMethods, on accounts that use Forter. A payment that Forter declines stops when your account is set to stop declined payments.

Fixed

  • PayPal payments on accounts that use Forter no longer fail at the fraud check.
  • A card that skips 3-D Secure through network token authentication still gets the fraud check.
  • A payment no longer waits forever when the fraud check or a Forter 3-D Secure result never answers: your failure handler is called instead.

4.9.7 (2026-10-21)

Fixed

  • A Forter 3-D Secure challenge no longer fails when Forter's script loads after the challenge starts.

4.9.6 (2026-10-19)

Added

  • Google Pay for CyberSource and NAB Gateway.
  • The billingDetailsRequired Google Pay option, for addGooglePay and the Drop In's googlePayOptions: true asks the shopper for their email address and full billing address. CyberSource and NAB Gateway need it unless you pass the customer's name, email and billing address yourself.

4.9.5 (2026-10-13)

Changed

  • Internal improvements. Nothing changes in how you use the SDK.

4.9.4 (2026-10-12)

Security

  • 3-D Secure on a saved card token (addThreeDsWithToken) no longer brings the card's details into the browser: it runs on the card your gateway stores.

Fixed

  • Nuvei 3-D Secure stops after it reports a failure, instead of opening the challenge as well.

4.9.3 (2026-10-08)

Added

  • The Apple Pay button now appears in Chrome, Firefox and Edge, where Apple lets shoppers pay with their iPhone. It used to appear in Safari only.
  • Forter as a 3-D Secure provider on its own, without Forter fraud screening.

Fixed

  • A Forter 3-D Secure challenge whose result is anything but a success now fails the payment.
  • Forter's scripts use your account's Forter site ID.