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 🙏

© 2024 – Pkg Stats / Ryan Hefner

connect-sdk-client-js

v6.0.0

Published

The JavaScript based client SDK that can be used for client to server communication between you and the Worldline Global Collect platform

Downloads

8,160

Readme

Worldline Connect JavaScript SDK

Introduction

The JavaScript SDK helps you to communicate with the Worldline Connect Client API. Its primary features are:

  • handling of all the details concerning the encryption of the payment details,
  • convenient JavaScript wrapper around the API calls and responses,
  • localization of various labels and messages,
  • user-friendly formatting (masking) of payment data such as card numbers and expiry dates,
  • validation of input
  • check to determine to which payment provider a card number is associated.

See the Worldline Global Collect Developer Hub for more information on how to use the SDK.

Requirements

Minimal browser versions:

  • Chrome 69+
  • Chrome mobile 87+
  • Safari 13.1+
  • Safari mobile 14+
  • MS Edge 90+
  • MS Edge mobile 103+
  • Firefox 78+
  • Opera 85+
  • Samsung mobile 7.4+

Examples

⚠ Please note that all examples have been moved to their own repository.

Installation

Install this SDK using your preferred node package manager npm, yarn, pnpm or Bun.

npm install connect-sdk-client-js

Distributed packages

The SDK can be used AS UMD, CJS or ESM module.

Example Universal Module Definition (UMD)

The SDK is available under global namespace connectsdk and can be used in the following way:

app.js

const sessionDetails = {
  /* ... */
};

// We can access the SDK via the global namespace `window.connectsdk`
const session = new window.connectsdk.Session(sessionDetails);

index.html

<!doctype html>
<html lang="en">
  <head>
    <title>Example UMD</title>
    <script
      defer
      src="./node_modules/connect-sdk-client-js/dist/connect-sdk-client-js.umd.js"
    ></script>
    <script defer src="./app.js"></script>
  </head>
</html>

Example ECMAScript Module (ESM)

import { Session, type SessionDetails } from 'connect-sdk-client-js';

const sessionDetails: SessionDetails = {
  /* ... */
};

const session = new Session(sessionDetails);

Example CommonJS (CJS)

const { Session } = require('connect-sdk-client-js');

/**
 * @type {import('connect-sdk-client-js').SessionDetails}
 */
const sessionDetails = {
  /* ... */
};

const session = new Session(sessionDetails);

Build from source

This repository uses microbundle to build the SDK. You can build the sdk by running the following commands:

npm run build

The result of the build will have been written to the dist folder. This folder will contain the following files:

  • /dist/types - Directory containing all type declaration file. The index.d.ts is set as main file for the exported package, see package.json:types property.
  • /dist/connect-sdk-client-js.js - The compiled TypeScript as ESM module. This file will be when using ESM, see package.json:module property.
  • /dist/connect-sdk-client-js.umd.js - The compiled TypeScript as UMD module. This file can be used when you want to use the library as UMD, see package.json:unpkg property.
  • /dist/connect-sdk-client-js.cjs - The compiled TypeScript as CommonJS module. This file can be used when you want to use the library as CommonJS, see package.json:main property.

Test

This library contains unit- and integration tests written with Vitest. By default Vitest starts in watch mode when starting locally and run mode when running in CI (when environment var CI is set), see documentation.

| Command | Description | |:---------------------------|:----------------------| | npm run test | Run unit tests | | npm run test:integration | Run integration tests |