Registry / storage / bkper-js

bkper-js

JSON →
library2.35.2jsnpmunverified

JavaScript/TypeScript client for the Bkper REST API, providing classes and functions for authentication, authorization, and data manipulation. Current stable version is 2.35.2, released on npm with regular updates. It supports Node.js and modern browsers, ships TypeScript definitions, and offers CDN usage without build tools. Key differentiators include simple OAuth token provider configuration, compatibility with @bkper/web-auth for *.bkper.app subdomains, and a Bkper CLI for token management.

npm install bkper-js
INSTALL
IMPORT
SIG · BKPER-JS
B
bkper-js
storagejavascriptv2.35.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Bkper
import { Bkper } from 'bkper-js'
import Bkper from 'bkper-js'
Named export, not default. Also works with require: const { Bkper } = require('bkper-js').
bkperjs (CDN global)
<script src='https://cdn.jsdelivr.net/npm/bkper-js@2/dist/bkper.min.js'></script>; const { Bkper } = bkperjs;
const { Bkper } = bkper; // Wrong global name
CDN exposes the global 'bkperjs' object.
bkper (CLI helper)
import { getOAuthToken } from 'bkper'
import { getOAuthToken } from 'bkper-js'
Separate package for CLI authentication.

Initialize Bkper with OAuth token from CLI and retrieve a book by ID.

import { Bkper } from 'bkper-js'; import { getOAuthToken } from 'bkper'; Bkper.setConfig({ oauthTokenProvider: async () => getOAuthToken(), }); const bkper = new Bkper(); const book = await bkper.getBook('your-book-id'); console.log(`Book: ${book.getName()}`);
Debug
Known issues
gotchaThe @bkper/web-auth SDK only works on *.bkper.app subdomains; session cookies are scoped to .bkper.app.
fix
Use CDN/browser approach with access token for other domains.
affects: >=2.0.0
breakingVersion 2.x drops support for Node.js < 10 and older browsers. ESM only; no CommonJS.
fix
Use Node.js >=10 or modern browser; if using old Node, stay on 1.x.
affects: >=2.0.0 <3.0.0
deprecatedBkper.setConfig with static config is deprecated; use instance-level config in future major.
fix
Pass config to constructor: new Bkper({ oauthTokenProvider: ... })
affects: >=2.30.0
gotchaAccess tokens from bkper CLI are valid for 1 hour only; must refresh via CLI or implement refresh logic.
fix
Run 'bkper auth token' again or integrate OAuth refresh flow.
affects: >=2.0.0
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'bkper-js'
Package not installed or wrong import path.
fix
Run: npm install bkper-js
TypeError: bkperjs is not defined
Using CDN but accessing wrong global name or script not loaded.
fix
Use global 'bkperjs' (not 'bkper') and ensure script tag with src points to CDN.
Error: oauthTokenProvider is required
Missing configuration before using Bkper.
fix
Call Bkper.setConfig({ oauthTokenProvider: async () => ... }) before creating instance.
Upgrade
Version history
2.35.2latest on npm
Audit
Dependencies
@bkper/web-authoptionalOptional: for OAuth login flow on *.bkper.app subdomains
Agent activity
46 hits · last 30 days
node
40
OpenAI (training)
1
Resources
bkper-js — npm install bkper-js · libregistry