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

wayu-js-sdk

v1.0.1

Published

The official Wayu Pay JavaScript SDK for accepting payments in Venezuela (Pago Móvil, C2P). Generate payment links, verify webhooks, multi-merchant.

Readme

Wayu JS SDK

The official Wayu Pay JavaScript SDK for accepting payments in Venezuela (Pago Móvil and C2P). Generate payment links, receive webhook notifications, and manage multi-merchant payments.

npm version License: MIT

Overview

Wayu Pay lets you accept payments in Venezuela with a simple API. This SDK handles authentication (HMAC-SHA256 signatures), payment link generation, and webhook signature verification.

  • Payment Links: Generate checkout URLs in USD or VES
  • Webhooks: Verify and process real-time payment notifications
  • Multi-Merchant: Route payments to different merchants from a single integration

Installation

npm install wayu-js-sdk
# or
yarn add wayu-js-sdk
# or
pnpm add wayu-js-sdk

Usage

Initialize the client

// CommonJS
const WayuPay = require('wayu-js-sdk');

// ESM
import WayuPay from 'wayu-js-sdk';

const wayu = new WayuPay({
  publicKey: 'pk_sbox_...',
  secretKey: 'sk_sbox_...',
});

// Optional: use sandbox explicitly or override base URL
const wayuProd = new WayuPay({
  publicKey: 'pk_live_...',
  secretKey: 'sk_live_...',
  sandbox: false, // or baseUrl: 'https://services-wayu-checkout-production.up.railway.app'
});

Generate a payment link

const result = await wayu.checkout.generatePaymentUrl({
  amount: { value: 25.0, currency: 'USD' },
  product_name: 'Plan Pro',
  product_description: 'Suscripción mensual',
});

// Save the transactionId in your system
await saveTransaction(result.transactionId);

// Redirect the user to checkout
// window.location.href = result.generatePaymentLink;
console.log(result.generatePaymentLink);
console.log(result.transactionId);

Multi-merchant

const result = await wayu.checkout.generatePaymentUrl({
  amount: { value: 50.0, currency: 'USD' },
  product_name: 'Producto del Merchant',
  product_description: 'El pago va directo al merchant',
  merchant_id: 'merch_001',
});

Verify webhook signatures

The SDK supports two header schemes for backward compatibility:

  1. X-Webhook-Signature (docs): HMAC-SHA256(JSON.stringify(payload), webhookSecret)
  2. x-signature (legacy): HMAC-SHA256(timestamp:payload_json_sorted, webhookSecret)
app.post('/api/webhooks/wayu', (req, res) => {
  const isValid = wayu.validateWebhook(
    req.headers,
    req.body,
    process.env.WAYU_WEBHOOK_SECRET
  );

  if (!isValid) {
    return res.status(401).json({ error: 'Invalid signature' });
  }

  const { event, transactionId, data } = req.body;

  switch (event) {
    case 'payment.completed':
      // Update transaction status in your database
      break;
    case 'payment.failed':
      // Notify user of failure
      break;
    case 'payment.expired':
      break;
    case 'payment.refunded':
      break;
  }

  res.status(200).json({ received: true });
});

Webhook events

| Event | Description | |-------|-------------| | payment.completed | Payment was successful | | payment.failed | Payment failed | | payment.expired | Payment link expired | | payment.refunded | Payment was refunded |

API Reference

new WayuPay(config)

Creates a new Wayu Pay client.

  • config.publicKey (string, required): Your public API key
  • config.secretKey (string, required): Your secret API key
  • config.baseUrl (string, optional): Override the API base URL
  • config.sandbox (boolean, optional): Use sandbox environment (auto-detected from pk_sbox prefix if not set)

wayu.checkout.generatePaymentUrl(params)

Generates a payment link.

  • params.amount (object, required): { value: number, currency: 'USD' | 'VES' }
  • params.product_name (string, required): Product name
  • params.product_description (string, optional): Product description
  • params.merchant_id (string, optional): Merchant ID for multi-merchant

Returns: Promise<{ generatePaymentLink: string, transactionId: string }>

wayu.validateWebhook(headers, body, webhookSecret)

Validates a webhook request signature. Supports X-Webhook-Signature and x-signature headers.

Returns: boolean

wayu.generateSignature()

Generates HMAC-SHA256 signature for API requests (used internally).

Returns: { signature: string, timestamp: string }

Security

  • Never expose your secret key in frontend code. Always call the SDK from your backend.
  • Sandbox keys start with pk_sbox and sk_sbox.
  • The timestamp in API requests must be within the last 5 minutes to prevent replay attacks.

License

MIT