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

@paypal/merchant-onboarding-sdk

v1.0.15

Published

Merchant onboarding sdk script used for partner seller onboarding

Readme

Merchant Onboarding SDK

This SDK simplifies the integration of merchant onboarding workflows into any application that uses the SDK package. It provides a set of tools and utilities to manage the onboarding process, including:

Table of Contents

Getting Started

Installation

Install the SDK

npm install @paypal/merchant-onboarding-sdk

Usage

1. Add sdk package to your UI element

import { onboard } from "@paypal/merchant-onboarding-sdk/onboarding";

OR

import { servicing } from "@paypal/merchant-onboarding-sdk/servicing";

Disclaimer: There may be side-effects of rendering both onboarding and servicing concurrently due to conflicts in the auth sessions of each

Usage NOTE

If you use SSR, import the script only in the UI as it relies on client-side global objects like window

Example:

import {
    Onboard,
    OnboardOptions,
} from "@paypal/merchant-onboarding-sdk/onboarding";

const [onboard, setOnboard] = useState<Onboard>(null as unknown as Onboard);

useEffect(() => {
    const initSdk = async () => {
      const onbPackage = await import(
        "@paypal/merchant-onboarding-sdk/onboarding"
      );
      setOnboard(onbPackage.default as unknown as Onboard);
    };
    initSdk();
}, []);

useEffect(() => {
    if (onboard) {
      onboard.initialize({ // props }).render("elementId")
    }
}, [onboard])

2. initialize sdk in your app and render

onboard
    .initialize({
        env: 'production', // required for node_module integrations only
        accessToken: 'A21_A.AAdU_t4bpoqBrSPWCvZWX7px-4feNn6Ap1Ixon9zgB46GNnibPWM_GrYcwTUBou-8LUM1WSOP5-XUecATSod2E1x-eoYPA',
        actionUrl: 'https://www.paypal.com/bizsignup/partner/entry?referralToken=ZjRmMTdiNjItMDhlNi00ZjJiLTk3ODAtNTQ0NzE3YjI5MTRkQ3pncW5vYlZpaEZOUnpmc082bTRVekphRENVcy9iWjJmWUt1b3l3TWNidz12Mg==',
        cancelUrl: 'http://www.partner.com/cancelUrl' // add partner's app url
        style: {
            color: {
                background: {
                    highContrast: '#48484a', // font color
                },
                primary: {
                    main: '#1b75bc', //header & button
                    mainHover: '#1871b6',
                    mainActive: '#204d74', // button color after you click
                },
            },
        },
        onError: async function (error,errorInfo) {
            alert("There is an error\nError: " + error +"\nError Description: \n"+ errorInfo)
            window.location.reload()
        },
        onSDKError: async function (error,errorInfo) {
            alert("There is an error\nError: " + error +"\nError Description: \n"+ errorInfo.componentStack)
            window.location.reload()
        },
        onProgress: async function (progress) {},
        onComplete: async function () { alert("Onboard completed!!")},
        onAccessTokenExpiry: async function () {},
        onReferralTokenExpiry: async function () {},
        onCancel: async function () {alert("User cancelled the onboarding")},
        onContactUs: async function () {}
        onLoginRequested: async function (spokePayerId) { return await getToken()} // STANDALONE_HYBRID partners only
    })
    .render('root')

Onboarding SDK Reference

Install Onboarding SDK

import { onboard } from "@paypal/merchant-onboarding-sdk/onboarding";

Initialize Onboarding SDK

Paypal.onboard.initialize(props)

Onboarding Props Reference

| Parameter | Type | Description | Required | | ----------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------- | | accessToken | string | The access token for authentication. | Yes | | env | string | The env that should be used. Possible values are 'production' or 'sandbox' | No (defaults to 'production' for npm integrations) | | actionUrl | string | The URL containing the referralToken. | Yes | | cancelUrl | string | The URL to return from onboarding on cancel. | No | | style | object | Styling options (see below). | No | | onProgress | function | Async Callback function that receives a progress object (structure TBD). | No | | onComplete | function | Async Callback function invoked when onboarding completes successfully. | No | | onAccessTokenExpiry | function | Async Callback function invoked when the access token expires. The partner should refresh the token and provide a new actionUrl. | No | | onReferralTokenExpiry | function | Async Callback function invoked when the referral token expires. The partner should refresh the token and provide a new actionUrl. | No | | onCancel | function | Async Callback function invoked when the user cancels onboarding. | No | | onError | function | Async Callback function invoked when an error occurs during onboarding. Receives error and errorInfo objects. | No | | onSDKError | function | Async Callback function invoked for SDK-specific errors. Receives error and errorInfo objects. | No | | onContactUs | function | Async Callback function to display contact information when appropriate. | No | | onLoginRequested | function | Async Callback function to fetch access token for STANDALONE_HYBRID merchant. | Yes (only for spoke-only partners) | | onAccountCreated | function | Async Callback function for client to fetch payer id for linked hybrid accounts. | No (only for linked-hybrid accounts | | onAccountAvailable | function | Async callback (payerId, trackingId) when the linked-hybrid account is available after embedded onboarding (e.g. popup closes). | No (linked-hybrid only) | | ) |

Render Onboarding SDK

Paypal.onboard.render(<containerId>)

containerId is the id of the html container to render the onboarding flow

Example

To render Onboarding in the following div:

<div id="container"></div>

Render the SDK like:

Paypal.onboard.render('container')

Cleanup Onboarding SDK

Paypal.onboard.cleanup()

Unmounts the rendered onboarding component from the DOM and logs out the current merchant session. Call this method whenever you want to remove the onboarding UI from the DOM.

Servicing SDK Reference

Install Servicing SDK

import { servicing } from "@paypal/merchant-onboarding-sdk/servicing";

Initialize And Render Servicing SDK

PayPal.servicing.<MODULE_NAME>.initialize(props)

servicing.ACTION_WIDGETS.initialize({
        targetElementId: 'container',
        getAccessToken: async () => { // implementation here to get spoke access token} ,
        style: {
          color: {
            primary: {
              main: 'red',
            },
            secondary: {
              main: 'green',
            },
          },
        },
        partnerName: 'partner',
        partnerHostedModuleUrls: {
          MONEY: 'www.partner.com/balance', // Partner web url where money SDK is used
          ACTION_WIDGETS: 'www.partner.com/notification' // Partner web url where action widget SDK is used
        }
      });

Supported modules

| Supported Module Names | | ------------------------------------ | | MONEY | | BANKS | | ACTION_WIDGETS | | PAID_FEATURES | | PHONE | | LIFT_LIMITS | | LANGUAGE_EDIT | | TIMEZONE_EDIT | | INSIGHTS | | REPORT | | PAYMENT_PREFERENCES | | VIEW_BUSINESS_PROFILE | | CSM | | ACCOUNT_SETTINGS_PAYMENT_PREFERENCES | | MERCHANT_LISTING | | ACTIVITY_REFUND | | WORKING_CAPITAL |

Servicing Props Reference

| Parameter | Type | Description | Required | | ------------------------- | ---------- | -------------------------------------------------------------------------- | -------------------------------------------------- | | targetElementId | string | The id of the HTML container to render the Servicing SDK | Yes | | getAccessToken | function | Async Callback function that returns spoke account access token | Yes | | env | string | The env that should be used. Possible values are 'sandbox' or 'production' | No (defaults to 'production' for npm integrations) | | partnerName | string | The Partner's name | No | | partnerHostedModuleUrls | object | The URL to return from onboarding on cancel. | No | | style | object | Styling options (see below, same as onboarding). | No |

Styling Options

Paypal makes use of tokens that consist of values needed to construct and maintain a design system, such as spacing, color, size, space, motion, etc. Styles can be passed using these tokens and Paypal will override its Theme with the tokens passed using vanilla-extract.

To override with specific styles just add the style object to the props in onboard.initialize({}) as shown in Initialize and Render

The Style object takes the format of a vanilla-extract Theme: https://vanilla-extract.style/documentation/theming/