bolddesk-test-framework-sdk
v1.0.4
Published
The BoldDesk App Framework (BAF) SDK is a JavaScript library designed to facilitate communication across frames between iframed applications and the BoldDesk App Framework.
Maintainers
Readme
BoldDesk App Framework SDK
The BoldDesk App Framework (BAF) SDK is a lightweight JavaScript library that enables seamless communication between iframed applications and the BoldDesk helpdesk platform.
Installation
npm install bolddesk-app-framework-sdkQuick Start
<script src="path/to/baf_sdk.min.js"></script>
<script>
const client = BAFClient.init((context) => {
console.log('App initialized!');
console.log('User:', context.user.name);
});
</script>Or as an ES Module:
import BAFClient from 'bolddesk-app-framework-sdk';
const client = BAFClient.init();Core Features
Data Access (Get/Set)
// Get data
client.get('ticket.subject').then(data => {
console.log(data['ticket.subject']);
});
// Get multiple fields
client.get('ticket.subject', 'ticket.description').then(data => {
console.log(data);
});
// Set data
client.set('ticket.subject', 'New Subject').then(() => {
console.log('Updated');
});Event Handling
// Listen for events
client.on('ticket.updated', (ticket) => {
console.log('Ticket updated:', ticket);
});
// Remove listener
client.off('ticket.updated', handler);Invoke Actions
// Execute platform methods
client.invoke('notification.show', {
type: 'success',
message: 'Operation completed'
});HTTP Requests
// Make requests through platform proxy
client.request({
url: 'https://api.example.com/data',
method: 'GET'
}).then(response => {
console.log(response);
});API Reference
| Method | Description |
|--------|-------------|
| init([callback]) | Initialize the SDK |
| get(...paths) | Retrieve data from host |
| set(path, value) | Update data in host |
| invoke(method, payload) | Call host methods |
| request(options) | Make HTTP requests |
| on(event, callback) | Listen for events |
| off(event, callback) | Remove event listener |
| trigger(event, payload) | Emit custom events |
| has(event) | Check if event has listeners |
Build
npm install
npm run build:dev # Development build
npm run build # Production buildTesting
npm testSecurity Best Practices
- Never expose sensitive data in client code
- Use secure settings placeholders:
{{setting.api_key}} - Validate all user input before API calls
- Only add trusted domains to your app manifest
Manifest Example
{
"name": "My BoldDesk App",
"version": "1.0.0",
"frameworkVersion": "1.0.0",
"product": "BoldDesk",
"widgets": [
{
"name": "Ticket Widget",
"location": "desk.ticket.view.rightpanel",
"url": "widgets/ticket/index.html"
}
],
"trustedDomains": [
"https://api.example.com"
]
}Support
For issues and questions, visit https://www.bolddesk.com or email [email protected]
License
Apache License 2.0. See LICENSE file for details.
Copyright © 2026 BoldDesk
