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

wovenpay

v0.1.6

Published

Js SDK for the wovenpay API

Readme

wovenpay JS SDK

Build Status

** PLEASE NOTE THAT THIS LIBRARY IS UNDER ACTIVE DEVELOPMENT **

USAGE

Install

npm install wovenpay --save

SUPPORTED RESOURCES

  • Customers
  • Payments
  • Plans
  • Webhooks
  • Subscriptions
  • Account Resource [GET and PUT only]
  • Business Resource [GET and PUT only]

To Be Added

  • Webhook Resource [GET]
  • Payment refund
  • Payment cancel
  • Payment disburse
  • Payment disburse

Create a new Instance of wovenpay

import WovenPay from 'wovenpay';
let wovenpay = new WovenPay(apikey, apisecret); //Defaults to sandbox api

//To run on live api, pass true to 'live' parameter
let wovenpay = new WovenPay(apikey, apisecret, true);

Add Token

let response = await wovenpay.getAuthToken(merchantEmail: string, merchantPassword: string);
data = await response.json();

let token = data.token;
wovenpay.token = token;

Add Request Timeout

  import * as Promise from 'bluebird';
  const TIMEOUT = 2000;
  
  function getCustomers(){
    return new Promise((resolve, reject) => {
      wovenpay.Customers.all().then(resolve).catch(reject);
      
      setTimeout(reject, TIMEOUT, new Error("Timeout Error"));    
    });
  }

Change API version

wovenpay.version = "1" //Every request will use version 1 of wovenpay api

Get Token

let response = await wovenpay.getAuthToken(merchantEmail: string, merchantPassword: string)
token = await response.json();

Refresh Token

let response = await wovenpay.refreshAuthToken(token: string)
token = await response.json();

Verify Token

let response = await wovenpay.verifyAuthToken(token: string)
is_valid = await response.json();

Account

To get details about an account

  let response = await wovenpay.Account.details();
  details = await response.json()

Businesses/Apps

Get all businesses

let response = await wovenpay.Business.all()
businesses = await response.json()

Get specific business

let response = await wovenpay.Business.get(businessId: string)
business = await response.json()

Edit a business

let response = await wovenpay.Business.edit(businessId: string, payload: object)
updateResponse = await response.json()

Delete business

let response = await wovenpay.Business.delete(businessId: string)
deleteResponse = await response.json()

Customer

Create a new customer

let response = await wovenpay.Customers.create({email: email});
customer = await response.json();

Edit a customer

let response = wovenpay.Customers.edit(customer.id, {email: email});
customer = await response.json();

Delete a customer

let response = wovenpay.Customers.delete(customer.id);
customer = await response.json();

Retrieve all customers

let response = wovenpay.Customers.all();
customers = await response.json();

Retrieve Specific customer

let response = wovenpay.Customers.get(customer.id);
customer = await response.json();

Plan

Create a new plan

const payload = {
  name: planName,
  business: businessId,
  price: 1000
}
let response = await wovenpay.Plans.create(payload);
plan = await response.json();

Retrieve all plans

let response = wovenpay.Plans.all();
plans = await response.json();

Retrieve Specific plan

let response = wovenpay.Plans.get(plan.id);
plans = await response.json();

Edit a plan

let response = wovenpay.Plans.edit(plan.id, {name:planName, business: Business, price:2000});
plan = await response.json();

Delete a plan

let response = wovenpay.Plans.delete(plan.id);
plan = await response.json();

Subscription

Create a new Subscription

const payload = {
    customer: customerId,
    plan: planId,
    business: businessId,
    period: "month",
    interval: 1
}
let response = await wovenpay.Subscriptions.create(payload);
subscription = await response.json();

Retrieve Specific Subscription

let response = wovenpay.Subscriptions.get(plan.id);
subscription = await response.json();

Edit a Subscription

let response = wovenpay.Subscriptions.edit(subscription.id, {interval: 3});
subscription = await response.json();

Delete a Subscription

let response = wovenpay.Subscriptions.delete(subscription.id);
subscription = await response.json();

Payments

Make Payments Charge

const payload = {
  "method": "mobile.mpesa",
  "amount": 10,
  "mobile":phone,
  "customer": {
    "email":test
  },
  "order": {
    "description": "Payment of Dockerfest Ticket"
  },
  "reference": "myuniquereference"
}
let response = await wovenpay.Payments.charge(payload);
charge = await response.json();

Get list of Payment transactions

You should probably want to use graphql query

let response = wovenpay.Payments.transactions();
transactions = await response.json();

Transaction Status

let response = wovenpay.Payments.status(transaction.id);
status = await response.json();

Webhook

Create a new webhook

let response = await wovenpay.Webhooks.create({event: event, target:url, key:"notsecretkey"});
hook = await response.json();

Edit a webhook

let response = wovenpay.Webhooks.create({event:"customer.created", target: url, key:"secretkey"});
hook = await response.json();

Delete a webhook

let response = wovenpay.Webhooks.delete(hook.id);
hook = await response.json();

GraphQl Query

Query Graph

One can use both string or template literals

let response = await wovenpay.Graph.query(`{ allBusinesses {edges{node{id name }}} }`)
let response2 = await wovenpay.Graph.query`{ allBusinesses {edges{node{id name }}} }`