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

@synkolat/paymints

v0.0.2

Published

Minimal, ESM-only, tree-shakeable utilities for frontends.

Readme

@synkolat/paymints

Minimal, ESM-only, tree-shakeable utilities for integrating Paymints into browser frontends.

Installation

npm install @synkolat/paymints
# or
pnpm add @synkolat/paymints
# or
yarn add @synkolat/paymints

Usage

1. Initialize

Initialize the library with your public API key before using any other functionality. This is typically done at the root of your application (e.g., in App.tsx or main.ts).

import { config } from '@synkolat/paymints';

config.init({
  key: 'pmts.your_public_key'
});

2. Launch Checkout

Redirect the user to a hosted checkout page to subscribe to a plan. This function creates a checkout session and automatically handles the browser redirect.

import { subscription } from '@synkolat/paymints';

async function handleSubscribe() {
  try {
    await subscription.launchCheckout({
      // The unique ID of the user in your system
      customerReference: 'user_123456' 
    });
  } catch (error) {
    console.error('Failed to launch checkout:', error);
  }
}

3. Check Subscription Status

Check if a specific customer has an active subscription.

import { subscription } from '@synkolat/paymints';

async function checkUserSubscription() {
  try {
    const result = await subscription.checkStatus({
      customerReference: 'user_123456'
    });

    if (result.hasActiveSubscription) {
      console.log('User is subscribed to:', result.subscription?.productName);
      console.log('Status:', result.subscription?.status);
    } else {
      console.log('No active subscription found.');
    }
  } catch (error) {
    console.error('Failed to check status:', error);
  }
}

API Reference

config

init(config: PaymintsConfig): void

Initializes the Paymints SDK.

  • key (required): Your Paymints public API key. Must start with pmts..
  • baseUrl (optional): Override the default API URL.

subscription

launchCheckout(params: CreateCheckoutParams): Promise<void>

Creates a checkout session and automatically redirects the browser to the payment page.

  • customerReference (required): A unique identifier for the customer in your system.

checkStatus(params: CheckSubscriptionParams): Promise<SubscriptionCheckResponse>

Checks the subscription status for a customer.

  • customerReference (required): The unique identifier for the customer.

Types

The package exports the following TypeScript interfaces for better type safety:

  • PaymintsConfig
  • CreateCheckoutParams
  • CheckSubscriptionParams
  • CheckoutResponse
  • SubscriptionCheckResponse

License

MIT