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

twikey-api-client

v0.0.1

Published

Twikey API wrapper

Readme

Want to allow your customers to pay in the most convenient way, then Twikey is right what you need.

Recurring or occasional payments via (Recurring) Credit Card, SEPA Direct Debit or any other payment method by bringing your own payment service provider or by leveraging your bank contract.

Twikey offers a simple and safe multichannel solution to negotiate and collect recurring (or even occasional) payments. Twikey has integrations with a lot of accounting and CRM packages. It is the first and only provider to operate on a European level for Direct Debit and can work directly with all major Belgian and Dutch Banks. However you can use the payment options of your favorite PSP to allow other customers to pay as well.

Requirements

To use the Twikey API client, the following things are required:

Installation

Using npm:

npm install twikey-api-client

Using yarn:

yarn add twikey-api-client

How to create anything

The api works the same way regardless if you want to create a mandate, a transaction, an invoice or even a paylink. the following steps should be implemented:

  1. Use the Twikey API client to create or import your item.

  2. Once available, our platform will send an asynchronous request to the configured webhook to allow the details to be retrieved. As there may be multiple items ready for you a "feed" endpoint is provided which acts like a queue that can be read until empty till the next time.

  3. The customer returns, and should be satisfied to see that the action he took is completed.

Find our full documentation online on api.twikey.com.

Getting started

Initializing the Twikey API client using the Requests library. and configure your API key which you can find in the Twikey merchant interface.

let twikeyClient:TwikeyClient = new TwikeyClient({
        apiKey: "apiKey",
        apiUrl: "https://mycompany.twikey.com/api/creditor",
        userAgent: "myApp",
});

Documents

Invite a customer to sign a SEPA mandate using a specific behaviour template (ct) that allows you to configure the behaviour or flow that the customer will experience. This 'ct' can be found in the template section of the settings.


let invite = twikeyClient.document.create({
   ct: Number(CT),
   email: "[email protected]",
   firstname: "Twikey",
   lastname: "Support",
   address: "Derbystraat 43",
   city: "Gent",
   zip: "9000",
   country: "BE",
   l: 'nl',
})

After creation, the link available in invite.url can be used to redirect the customer into the signing flow or even send him a link through any other mechanism. Ideally you store the mandatenumber for future usage (eg. sending transactions).

Feed

Once signed, a webhook is sent (see below) after which you can fetch the detail through the document feed, which you can actually think of as reading out a queue. Since it'll return you the changes since the last time you called it.

const feed = client.document.feed();
for await (const document of feed) {
   if (document.IsNew) {
      console.log("New mandate: ",newMandate)
   }
   if (document.IsUpdated) {
      console.log("Updated mandate: ",newMandate)
   }
   if (document.IsCancelled) {
      console.log("Cancelled mandate: ",newMandate)
   }
}

Transactions

Send new transactions and act upon feedback from the bank.

const transaction = await client.transaction.create({
   mndtId: "CORERECURRENTNL16318",
   message: "Test message",
   amount: 500,
});

Feed

const feed = await client.transaction.feed();
for await (const tx of feed) {
   console.log("Updated transaction: ",tx)
}

Webhook

When wants to inform you about new updates about documents or payments a webhookUrl specified in your api settings be called.


let incomingSignature = req.get("X-SIGNATURE");
let payload = req.originalUrl;
let valid = twikeyClient.verifyWebHookSignature(incomingSignature,payload);

API documentation

If you wish to learn more about our API, please visit the Twikey Api Page. API Documentation is available in English.

Want to help us make our API client even better?

Want to help us make our API client even better? We take pull requests.

Support

Contact: www.twikey.com