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

@splito/sdk

v1.0.3

Published

Official JavaScript/TypeScript SDK for Splito - Split payments across multiple recipients

Downloads

13

Readme

Splito SDK

Official JavaScript/TypeScript SDK for Splito - Split payments across multiple recipients with ease.

Installation

npm install @splito/sdk
# or
yarn add @splito/sdk

Quick Start

import { Splito } from '@splito/sdk';

// Initialize the SDK
const splito = new Splito({
  apiKey: 'your-api-key-here'
});

// Create a product
const product = await splito.createProduct({
  name: 'Premium Subscription',
  description: 'Monthly premium subscription',
  price: 2999, // cents
  currency: 'USD'
});

// Create a payment intent
const paymentIntent = await splito.createPaymentIntent({
  amount: 2999, // cents
  currency: 'USD'
});

// Redirect customer to the hosted payment page
window.location.href = paymentIntent.hosted_url;

API Reference

Initialization

const splito = new Splito({
  apiKey: string,     // Your Splito API key
  timeout?: number    // Request timeout in ms (default: 10000)
});

Methods

createProduct(data)

Create a new product.

const product = await splito.createProduct({
  name: string,
  description?: string,
  price: number,        // Amount in cents
  currency?: string,    // Default: 'USD'
  metadata?: object,
  external_product_id?: string  // Your unique product identifier
});

createPaymentIntent(data)

Create a new payment intent.

const intent = await splito.createPaymentIntent({
  amount: number,       // Amount in cents
  currency: string,     // Default: 'USD'
  metadata?: object
});

Returns:

{
  id: string,
  hosted_url: string,   // URL to redirect customers to
  // ... other fields
}

getPaymentIntent(id)

Retrieve a payment intent by ID.

const intent = await splito.getPaymentIntent('intent_id');

listPaymentIntents(params?)

List payment intents with optional filtering.

const intents = await splito.listPaymentIntents({
  limit?: number,
  offset?: number,
  status?: string,
  product_id?: string
});

listProducts(params?)

List products with optional filtering.

const products = await splito.listProducts({
  limit?: number,
  offset?: number,
  search?: string,
  is_active?: boolean
});

getProductByExternalId(externalProductId)

Retrieve a product by its external product ID.

const product = await splito.getProductByExternalId('your_external_id');

listRecipients(params?)

List recipients with optional filtering.

const recipients = await splito.listRecipients({
  limit?: number,
  offset?: number,
  search?: string,
  status?: string
});

getEvents(params?)

Retrieve events with optional filtering.

const events = await splito.getEvents({
  type?: string,
  limit?: number
});

getAnalytics(params?)

Get analytics data.

const analytics = await splito.getAnalytics({
  start_date?: string,  // ISO format
  end_date?: string     // ISO format
});

sendTestWebhook(webhookUrl, webhookSecret?)

Send a test webhook event.

const result = await splito.sendTestWebhook(
  'https://your-site.com/webhook',
  'optional_webhook_secret'
);

Error Handling

All SDK methods throw errors when requests fail:

try {
  const intent = await splito.createPaymentIntent({
    amount: 2999,
    currency: 'USD'
  });
} catch (error) {
  console.error('Payment creation failed:', error.message);
}

TypeScript Support

The SDK is written in TypeScript and provides full type definitions:

import { Splito, SplitoConfig } from '@splito/sdk';
import type { 
  CreatePaymentIntentRequest,
  CreatePaymentIntentResponse,
  PaymentIntent 
} from '@splito/sdk';

Examples

React Integration

import { useState } from 'react';
import { Splito } from '@splito/sdk';

const splito = new Splito({
  apiKey: process.env.REACT_APP_SPLITO_API_KEY
});

function CheckoutButton() {
  const [loading, setLoading] = useState(false);

  const handleCheckout = async () => {
    setLoading(true);
    try {
      const intent = await splito.createPaymentIntent({
        amount: 2999,
        currency: 'USD',
        metadata: { userId: '123' }
      });
      
      // Redirect to Splito hosted payment page
      window.location.href = intent.hosted_url;
    } catch (error) {
      console.error(error);
      setLoading(false);
    }
  };

  return (
    <button onClick={handleCheckout} disabled={loading}>
      {loading ? 'Loading...' : 'Pay $29.99'}
    </button>
  );
}

Node.js Backend

import express from 'express';
import { Splito } from '@splito/sdk';

const app = express();
const splito = new Splito({
  apiKey: process.env.SPLITO_API_KEY
});

app.post('/create-payment', async (req, res) => {
  try {
    const { amount, currency } = req.body;
    
    const intent = await splito.createPaymentIntent({
      amount,
      currency,
      metadata: { orderId: req.body.orderId }
    });
    
    res.json({ checkoutUrl: intent.hosted_url });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

Support

  • 📧 Email: [email protected]
  • 📚 Documentation: https://splito.net/docs
  • 🐛 Issues: https://github.com/your-org/splito-sdk/issues

License

MIT License - see LICENSE file for details.