Methods and Events
Complete reference guide for all Beefree SDK methods, callbacks, and events.
Overview
How Methods and Events Work
const bee = new BeefreeSDK(token);
const beeInstance = bee.start(beeConfig, template);
// Use methods to control the editor
beeInstance.save();
beeInstance.preview();
// Configure callbacks to respond to events
const beeConfig = {
container: 'editor-container',
onSave: function(jsonFile, htmlFile) {
// Handle save event
},
onChange: function(jsonFile, response) {
// Handle content changes
}
};Instance Methods
Core Methods
beeInstance.start(templateToLoad, userInfo, templateInfo, options)
beeInstance.load(template)
beeInstance.reload(template)
Control Methods
beeInstance.save()
beeInstance.saveAsTemplate()
beeInstance.send()
Preview and View Methods
beeInstance.togglePreview()
beeInstance.toggleStructure()
beeInstance.toggleMergeTagsPreview()
Advanced Methods
beeInstance.execCommand(command)
beeInstance.loadWorkspace(type)
beeInstance.loadConfig(config)
File Manager Methods
Callback Functions
Save and Template Callbacks
onSave
onSaveAsTemplate
onAutoSave
onSend
Content Change Callbacks
onChange
onRemoteChange
Loading and Workspace Callbacks
onLoad
onLoadWorkspace
Error and Warning Callbacks
onError
onWarning
Preview and View Callbacks
onPreview
onTogglePreview
onViewChange
File Management Callbacks
onFilePickerInsert
onFilePickerCancel
Collaboration Callbacks
onComment
Event Configuration Examples
Basic Event Handling
Advanced Event Handling
File Manager Configuration
Method Chaining and Async Operations
Best Practices
Error Handling
Performance
User Experience
Collaboration
Development
TypeScript Support
Last updated
Was this helpful?

