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 🙏

© 2024 – Pkg Stats / Ryan Hefner

bunq-api

v1.0.5

Published

A wrapper for part of the Bunq API v1

Downloads

3

Readme

bunq-api

A wrapper for part of the bunq API v1 in Type-/JavaScript forked from Simon Schraeders https://github.com/c0dr/bunq

intended functionality

install prerequisites (as root or with sudo)

  • node.js
    • apt-get install nodejs
    • npm install -g npm@latest
  • typescript
    • npm install -g typescript
  • jest
    • npm install -g jest

clone, compile, test

git clone https://github.com/cofdev0/bunq-api.git bunq
cd bunq
npm install
tsc
npm run test

setup and initial authentication with bunq server

  • create a public/private key pair
    • change secretsPath in bunq.json to point to an existing directory for your secret data
    • npm run createKey
    • change file names of created key files
    • change publicKeyFile and privateKeyFile in bunq.json to point to newly created key files
  • install public key with bunq server
    • npm run installKey
    • rename newly created JSON file with installationToken in your secretPath
    • have installationTokenFile in bunq.json point to this installationToken file in your secretPath
  • create device server with bunq
    • have secretsFile in bunq.json point to your secret configuration JSON file
    • the secret configuration file must contain the secret API key you receive from bunq and a description of your server
    • like so: { 'secret' : 'nWmbY4QqXra...', 'description':'my bunq dev server' }
    • npm run createDeviceServer
  • create first session with bunq server
    • have bunqSessionFile in bunq.json point to the JSON file where to store the current session
    • have bunqSessionHistoryPath in bunq.json point to a directory where to store history of sessions
    • npm run createSession
  • find your user id
    • npm run requestUser
    • find your user id in the JSON output and enter it into your secret config file with key userId
    • add "accountId" : "" in your secret config file
  • find your account id
    • npm run showAccount
    • find your account id in the JSON output and update your secret config file accordingly

payments

  • show all payments on your account
    • npm run requestPayments
  • send payment to IBAN
    • npm run sendPayment -- --iban NL09BUNQ2290519588 --amount 10 --description donation --name StichtingChainsOfFreedom --sendPayment
    • well done! thanks!

notification on payment

  • install notification filter to receive notification on payment
    • create server certificate to allow https connection (below)
    • have notificationKeyFile and notificationCertFile in secret configuration file point to certificate files
    • npm run installNotification -- https://my.domain.com/callback
  • example server to receive notification on payments
    • execute on server of notified domain:
    • npm run runCallbackServer

create server certificate for notification filters

  • selfsigned certificate
    • openssl genrsa -out server.key 2048
    • openssl req -new -key server.key -out server.csr
    • openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
  • certificate from letsencrypt.org using certbot.eff.org
    • certbot certonly --standalone -d your-domain-name.com
    • renew certificate twice per day with a crontab job:
    • 11 0,12 * * * /usr/bin/certbot certonly --quiet --standalone --renew-by-default -d your-domain-name.com

use in your own projects

import { 
BunqKey, BunqApi, BunqApiConfig, BunqApiSetup, 
BunqConnection, BunqServerConnection, SessionCreator 
} from 'bunq-api/dist/index';

publish to npm repository

  • install dts-generator
    • npm install -g dts-generator
    • create types with:
    • npm run createTypes
  • create package for testing
    • npm pack
  • publish to npmjs.com
    • npm login

    • npm publish