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 🙏

© 2025 – Pkg Stats / Ryan Hefner

orchestrator-pp-core

v4.1.0

Published

`orchestrator-pp-core` is a TypeScript utility library that provides essential foundational tools for building a modern payment page.

Readme

orchestrator-pp-core

orchestrator-pp-core is a TypeScript utility library that provides essential foundational tools for building a modern payment page.

It offers ready-to-use, composable utilities for interacting with the payment API, managing events, handling HTTP requests, decoding JWT tokens, and processing project settings.


📦 Installation

npm install orchestrator-pp-core

Requires Node.js v24+


🧰 Features

1. useApi

Provides an API client object with all available payment page methods, fully typed.

Example:

import { useApi } from 'orchestrator-pp-core';

const apiHost = 'https://example.com';
const api = useApi(apiHost);

api.getProjectSettings()
   .then((settings) => {
     // handle settings
   })
   .catch((error) => {
     // handle error
   });

2. useEventManager

Provides an object for subscribing to, emitting, and unsubscribing from events.

Example:

import { useEventManager } from 'orchestrator-pp-core';

type EventNameHandler = (param1: string, param2: number) => void;

type EventMap = {
  eventName: EventNameHandler;
};

const handle: EventNameHandler = (param1, param2) => {
  console.log(param1, param2);
};

const eventManager = useEventManager<EventMap>();

eventManager.on('eventName', handle);
eventManager.emit('eventName', 'test', 4324);
eventManager.off('eventName', handle);

3. useHttp

A simple HTTP utility that allows making typed requests and handling errors gracefully.

Example:

import { useHttp } from 'orchestrator-pp-core';

type ResponseExample = {
  id: number;
};

const url = 'https://example.com/test';
const { request } = useHttp();

request<ResponseExample>(url)
   .then((response) => {
     // use response
   })
   .catch((error) => {
     // handle error
   });

4. useJwtToken

Extracts initialization data for the payment page from a Base64-encoded JWT token payload.

Example:

import { useJwtToken } from 'orchestrator-pp-core';

const token = '...';
const initData = useJwtToken(token);

5. useProjectSettings

Processes raw API project settings and transforms them into a ready-to-use configuration for the payment page.

Example:

import { useProjectSettings } from 'orchestrator-pp-core';

...

const projectSettings = await useProjectSettings(api, initData, paymentMethodFactory);

6. useTranslations

Loads translation dictionaries from an API endpoint and provides a translate function for substituting template variables. It also exposes helpers for switching the current language and listening for language changes.

Example:

import { useApi, useTranslations, Language } from 'orchestrator-pp-core';

const api = useApi('https://example.com');
const { translate, setLanguage, onLanguageChange } = useTranslations(api, Language.EN);

onLanguageChange((lang) => {
  console.log('Language switched to', lang);
});

await setLanguage(Language.RU);
const hello = translate('hello', { user: { email: '[email protected]' } });