Registry / crm-productivity / bolddesk-app-framework-sdk

bolddesk-app-framework-sdk

JSON →
library1.0.29jsnpmunverified

The BoldDesk App Framework (BAF) SDK is a lightweight JavaScript library (v1.0.29) that enables seamless communication between iframed applications and the BoldDesk helpdesk platform. It provides methods for data access (get/set), event handling (on/off), invoking platform actions, and making HTTP requests through the host proxy. Unlike generic postMessage wrappers, it is purpose-built for BoldDesk app development with a built-in manifest system for widget configuration and domain trust. Node.js >=18 required.

npm install bolddesk-app-framework-sdk
INSTALL
IMPORT
SIG · BOLDDESK-APP-FRAME
B
bolddesk-app-framework-sdk
crm-productivityjavascriptv1.0.29
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.

BAFClient
import BAFClient from 'bolddesk-app-framework-sdk'
const BAFClient = require('bolddesk-app-framework-sdk')
Package is ESM-only; CommonJS require will fail. Use named import for default export.
BAFClient (constructor)
const client = BAFClient.init(callback)
const client = new BAFClient()
Do not use 'new'. Use static init() method which may or may not accept a callback.
client.get
client.get('ticket.subject').then(data => ...)
client.get(['ticket.subject']).then(...)
Argument is a string path, not an array. Multiple fields are passed as separate string arguments.
client.on
client.on('ticket.updated', handler)
client.addEventListener('ticket.updated', handler)
Uses custom event methods, not DOM EventTarget API.

Shows initialization, data access, event handling, action invocation, and HTTP request proxy.

import BAFClient from 'bolddesk-app-framework-sdk'; const client = BAFClient.init((context) => { console.log('App initialized!'); console.log('User:', context.user.name); }); // Get data client.get('ticket.subject', 'ticket.description').then(data => { console.log('Ticket subject:', data['ticket.subject']); console.log('Ticket description:', data['ticket.description']); }); // Listen to events const handler = (ticket) => { console.log('Ticket updated:', ticket); }; client.on('ticket.updated', handler); // Invoke action client.invoke('notification.show', { type: 'success', message: 'Operation completed' }); // HTTP request via proxy client.request({ url: 'https://api.example.com/data', method: 'GET' }).then(response => console.log(response));
Debug
Known issues
breakingNode.js >=18 is required. Running on older versions will cause syntax/runtime errors.
fix
Upgrade Node.js to v18 or later.
affects: <18
gotchainit() may return undefined if called without a callback? Check documentation; usage with callback is recommended.
fix
Always provide a callback to init() to ensure the client object is fully initialized.
affects: >=1.0.0 <=1.0.29
gotchaDo not use new BAFClient(). Use BAFClient.init() static factory method.
fix
Replace new BAFClient() with BAFClient.init()
affects: >=1.0.0
gotchaUsing require() will fail as package is ESM-only. Use import or dynamic import().
fix
Change require() to import or use import() inside an async function.
affects: >=1.0.0
gotchaThe SDK must be used inside an iframe embedded in BoldDesk. It will not work standalone (no host to communicate with).
fix
Deploy the app within BoldDesk using the manifest system.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: BAFClient is not a constructor
Using 'new BAFClient()' incorrectly
fix
Use BAFClient.init() instead.
ERR_REQUIRE_ESM: require() of ES Module
Using CommonJS require() for an ESM-only package
fix
Use dynamic import() or convert project to ESM.
TypeError: client.get is not a function
Called get() before init() completed without callback
fix
Ensure client is initialized: call get() inside init callback or after promise resolves if init returns a promise.
ReferenceError: BAFClient is not defined
Missing import or script include
fix
Add import BAFClient from 'bolddesk-app-framework-sdk' or include the script tag with correct path.
Upgrade
Version history
1.0.29latest on npm
Audit
Dependencies
noderequiredRequired by package.json engines field (>=18)
Agent activity
40 hits · last 30 days
node
34
OpenAI (training)
1
Resources
bolddesk-app-framework-sdk — npm install bolddesk-app-framework-sdk · libregistry