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

talo-pay

v1.2.0

Published

Type-safe WinterCG-compatible TypeScript SDK for Talo Pay API

Readme

Talo Pay SDK (TypeScript)

Type-safe, WinterCG-compatible SDK for the Talo Transfers API.

Install

npm install talo-pay
# or
bun add talo-pay

Authentication behavior

The client manages access tokens automatically using your credentials:

  • clientId
  • clientSecret
  • userId

It fetches a token from POST /users/:user_id/tokens, caches it in memory, refreshes before expiration, and retries once on 401 with a fresh token.

Environment selection

The SDK supports first-class environments:

  • environment: "production" -> https://api.talo.com.ar
  • environment: "sandbox" -> https://sandbox-api.talo.com.ar

If baseUrl is provided, it overrides environment.

import { TaloClient } from "talo-pay";

const talo = new TaloClient({
  clientId: process.env.TALO_CLIENT_ID!,
  clientSecret: process.env.TALO_CLIENT_SECRET!,
  userId: process.env.TALO_USER_ID!,
  environment: "sandbox", // "production" | "sandbox"
});

Create a payment

import { TaloClient } from "talo-pay";

const talo = new TaloClient({
  clientId: process.env.TALO_CLIENT_ID!,
  clientSecret: process.env.TALO_CLIENT_SECRET!,
  userId: process.env.TALO_USER_ID!,
  environment: "production",
});

const payment = await talo.payments.create({
  user_id: process.env.TALO_USER_ID!,
  price: { amount: 1500, currency: "ARS" }, // 1500 ARS
  payment_options: ["transfer"],
  external_id: "order_12345",
  webhook_url: "https://your-app.com/api/talo/webhook",
  motive: "Order #12345",
  client_data: {
    first_name: "Juan",
    last_name: "Perez",
    email: "[email protected]",
    dni: "12345678",
  },
  // partner_id: process.env.TALO_PARTNER_ID, // required when operating as a partner
});

console.log(payment.id, payment.payment_status);

Create a refund

const refund = await talo.refunds.create("VAR-123", {
  refund_type: "PARTIAL", // or "FULL"
  amount: "500.00", // required only for PARTIAL
  currency: "ARS", // required only for PARTIAL
  blame: {
    team_id: "soporte",
    mail: "[email protected]",
  },
  user_id: process.env.TALO_USER_ID!,
});

console.log(refund.refund_id, refund.status);

Partner flows

// 1) Redirect URL to onboard a user
const authorizationUrl = talo.partners.getAuthorizationUrl("partner_id", {
  referredUserId: "external_user_123",
});

// 2) Exchange callback code for partner token + user mapping
const exchange = await talo.partners.exchangeToken({
  code: "code_from_redirect",
  client_id: process.env.TALO_PARTNER_ID!,
  client_secret: process.env.TALO_PARTNER_SECRET!,
});

// 3) Query/update account config
const account = await talo.partners.getAccount(exchange.user_id);
await talo.partners.updateAccount(exchange.user_id, {
  transfer_tolerance: 15,
});

Next.js App Router webhook route

import { createWebhookHandler } from "talo-pay";

const handler = createWebhookHandler({
  clientId: process.env.TALO_CLIENT_ID!,
  clientSecret: process.env.TALO_CLIENT_SECRET!,
  userId: process.env.TALO_USER_ID!,
  environment: "sandbox",
}, {
  onPaymentUpdated: async ({ event, payment }) => {
    console.log(event.paymentId, event.externalId, payment.payment_status);
  },
});

export async function POST(request: Request): Promise<Response> {
  return handler(request);
}

Documentation

  • Getting started: docs/getting-started.md
  • Environments: docs/environments.md
  • Partners: docs/partners.md
  • Refunds: docs/refunds.md
  • Webhooks: docs/webhooks.md

Resources

  • talo.payments.create(...)
  • talo.payments.get(...)
  • talo.payments.updateMetadata(...)
  • talo.customers.create(...)
  • talo.customers.get(...)
  • talo.customers.getTransaction(...)
  • talo.partners.getAuthorizationUrl(...)
  • talo.partners.exchangeToken(...)
  • talo.partners.getAccount(...)
  • talo.partners.updateAccount(...)
  • talo.refunds.create(...)
  • talo.sandbox.simulateCvuTransfer(...)
  • talo.webhooks.handler(...)
  • createWebhookHandler(...)

Top-level aliases are available too (for example, talo.createPayment(...)).