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

bkper

v3.3.2

Published

Node.js command line client for Bkper

Downloads

174

Readme

A command line utility to create and update Bkper Apps and Bots

Instalation

Add the package:

npm i bkper

or

yarn add bkper

or

bun add bkper

Optionally, you can install it globally to be able to use the bkper command line utility:

npm i -g bkper

or

yarn global add bkper

Commands

  • login - Logs the user in. Saves the client credentials to a ~/.bkper-credentials.json file.
  • logout - Logs out the user by deleting client credentials.
  • app -c - Create a new App based on ./bkperapp.yaml file.
  • app -u - Update an existing App based on ./bkperapp.yaml file.

Examples

npm bkper login
yarn bkper login

Environment Variables

The following environment variable is necessary in order to communicate with the Bkper REST API:

BKPER_API_KEY=XXXX

The app command also uses the following variables in order to perform App create/update operations:

BKPER_CLIENT_SECRET=YYYY
BKPER_USER_EMAILS="[email protected] [email protected]"
[email protected]

You can add a .env file at the root of your project with those variables and bkper will automatically load from it. Follow these steps in order to configure a valid Bkper API key.

WARNING: Never upload variables to the source code repository.

./bkperapp.yaml Reference

id: "The App agent id. It can NOT be changed after the App created."
name: "The name of the App or Bot."
logoUrl: "Set your logo url from public host. Best fit 200x200 px. Use https://"

# Context menu configuration
menuUrl: "The menu url to open in the popup window. See reference bellow."
menuUrlDev: "The menu url to open in the popup window, when opened by the developer user."
menuText: "The context menu call to action."
menuPopupWidth: 500 # width in pixels. Default to 80% of screen width.
menuPopupHeight: 300 # height in pixels. Default to 90% of screen height.

# Bot events configuration
events:
  - "TRANSACTION_POSTED"
  - "TRANSACTION_CHECKED"
  - "TRANSACTION_UNCHECKED"
  - "TRANSACTION_UPDATED"
  - "TRANSACTION_DELETED"
  - "TRANSACTION_RESTORED"
  - "ACCOUNT_CREATED"
  - "ACCOUNT_UPDATED"
  - "ACCOUNT_DELETED"
  - "GROUP_CREATED"
  - "GROUP_UPDATED"
  - "GROUP_DELETED"
  - "FILE_CREATED"
  - "BOOK_UPDATED"

filePatterns:
  - "The file patterns the Bot is capable of process. It accepts wildcard. E.g."
  - "radiusbank*.ofx"
  - "-*.qif"


# Webhook bot configuration
webhookUrl: "The production webhook url"
webhookUrlDev: "The development webhook url"

# Schema to provide autocompletion
propertiesSchema:
  book:
    keys:
      - "key1"
      - "key2"
    values:
      - "value2"
      - "value2"
  group:
    keys:
      - "key1"
      - "key2"
    values:
      - "value2"
      - "value2"
  account:
    keys:
      - "key1"
      - "key2"
    values:
      - "value2"
      - "value2"
  transaction:
    keys:
      - "key1"
      - "key2"
    values:
      - "value2"
      - "value2"

Accepted expressions in menuUrl property:

  • ${book.id} - the current book id
  • ${book.properties.xxxxx} - any property value from the current book
  • ${transactions.query} - the current query being executed on transactions list
  • ${transactions.ids} - the ids of selected transactions, splitted by comma
  • ${account.id} - the current account being filterd
  • ${account.properties.xxxxx} - any property value from the current account being filtered
  • ${group.id} - the current group being filterd
  • ${group.properties.xxxxx} - any property value from the current group being filtered

Example:

"menuUrl": "https://app.bkper.com/b/#transactions:bookId=${book.id}"

Library

The getOAuthToken returns a Promise that resolves to a valid OAuth token, to be used by the bkper-js library

Example:

import { Bkper } from 'bkper-js';
import { getOAuthToken } from 'bkper';

Bkper.setConfig({
  oauthTokenProvider: async () => getOAuthToken(),
})

Documentation