Skip to content

Libraries & SDKs

Choose the right library for your environment: bkper-js for Node.js and browsers, bkper-gs for Google Apps Script, @bkper/web-auth for browser OAuth, and @bkper/bkper-api-types for TypeScript definitions in any project.

Choose the right library for your environment. All libraries are built on the REST API and are used by the Bkper team to build our own products.

bkper-js

JavaScript/TypeScript SDK for Node.js and browsers.

The primary client library for programmatic access to Bkper. Use it for scripts, platform apps, and web applications.

import { Bkper } from 'bkper-js';
import { getOAuthToken } from 'bkper';
Bkper.setConfig({
oauthTokenProvider: async () => getOAuthToken(),
});
const bkper = new Bkper();
const books = await bkper.getBooks();

bkper-gs

Google Apps Script library.

Access Bkper from Apps Script — Google Sheets automations, triggers, add-ons. Authentication is handled by the Apps Script runtime.

function listBooks() {
var books = BkperApp.getBooks();
books.forEach(function (book) {
Logger.log(book.getName());
});
}

@bkper/web-auth

Web authentication SDK.

Browser-based OAuth for web applications. Use with bkper-js when building client-side apps.

import { BkperAuth } from '@bkper/web-auth';
const auth = new BkperAuth({ onLoginSuccess: () => initApp() });
await auth.init();
// Use with bkper-js
const token = await auth.getAccessToken();

@bkper/web-design

CSS design tokens for Bkper web applications.

Provides typography, spacing, border, and color tokens as CSS custom properties. Includes light/dark theme support and account-type color families. Works standalone or integrates with Web Awesome — if Web Awesome is loaded, Bkper tokens automatically inherit its design system values.

@import '@bkper/web-design';

Then use the tokens in your styles:

.my-component {
font-family: var(--bkper-font-family);
padding: var(--bkper-spacing-medium);
color: var(--bkper-color-text);
border: var(--bkper-border);
}

@bkper/bkper-api-types

TypeScript type definitions for the REST API.

Add autocomplete and contextual documentation to any TypeScript project that works with Bkper API payloads.

Terminal window
npm install @bkper/bkper-api-types

Configure tsconfig.json to make the bkper namespace globally available:

{
"compilerOptions": {
"types": ["@bkper/bkper-api-types"]
}
}

Then use the bkper namespace directly — no import needed:

const event: bkper.Event = await c.req.json();
const book: bkper.Book = event.book;

Which library to use

ScenarioLibrary
Node.js scripts and automationsbkper-js + CLI
Platform apps (server-side)bkper-js
Platform apps (client-side)bkper-js + @bkper/web-auth
Platform apps (styling)@bkper/web-design
Google Apps Scriptbkper-gs
Google Sheets add-onsbkper-gs
Any language (direct HTTP)REST API + @bkper/bkper-api-types