Installation and Fundamentals
Last updated
Was this helpful?
Last updated
Was this helpful?
Beefree SDK is an embeddable no-code content builder that enables your end users to build stunning marketing assets, such as emails, landing pages, and popups, without writing a single line of code.
The following list includes a few key features within Beefree SDK:
Drag-and-drop visual editors
File manager
Multi-user collaboration
Responsive design capabilities
Extensive template library
Secure authentication workflow
This guide provides comprehensive instructions and best practices for implementing Beefree SDK.
This section discusses how to get started with Beefree SDK.
Prior to integrating Beefree SDK, ensure you have:
A Beefree SDK .
Node.js (v14 or higher) installed.
A modern web browser (Chrome, Firefox, Safari, Edge).
To test the SDK locally before production deployment:
Clone the demo repository:
Install dependencies:
Configure environment:
Start the dev server:
Access at http://localhost:8081
Using npm
Using Yarn
Package Details:
TypeScript Support: Included
License: Apache-2.0
This section discusses the authentication process.
The secure authentication flow requires a server-to-server call to obtain a JWT token. This process ensures your client credentials remain protected.
Authentication Endpoint
Required Parameters
The following table lists and descibes the required authentication parameters.
client_id
string
Your application client ID
"abc123-client-id"
client_secret
string
Your application secret key
"xyz456-secret-key"
UID
string
Unique user identifier
"user-12345"
Example Implementation (Node.js)
Important Notes:
The UID must be consistent between authentication and SDK configuration.
Tokens are valid for 12 hours.
Ensure client_secret and client_id aren't exposed in the client-side code.
JSON Authorization Response
This section discusses how to initialize Beefree SDK.
Create a container element in your HTML where the editor will render:
Beefree SDK requires a configuration object with the following essential property:
Full Configuration Reference
The following table explains the container property.
container
string
Yes
DOM element ID for the editor
Initialize the editor with a template JSON object:
The following table lists template management methods that are important for getting started.
load(template)
Load new template
bee.load(newTemplate)
reload(template)
Force reload template
bee.reload(updatedTemplate)
save()
Trigger save callback
bee.save()
saveAsTemplate()
Save as template
bee.saveAsTemplate()
The instance method bee.start(template)
does not need to be called immediately after create
. In a SPA (Single Page Application) or React app, you can create
the editor in a hidden global state but then call the start
method when the template is selected and available. The application loads quickly when all steps are completed consecutively. However, by separating the loading workflow into two parts, the end-user will perceive loading in a fraction of the overall time. Remember, if the client_id
belongs to a File Manager application, bee.start()
can be called without any parameters.
Implement automatic token refresh to maintain uninterrupted sessions:
How to use:
Get a fresh token from your backend
Pass it to updateToken()
Enable real-time collaboration with these additional methods:
How to use:
Generate a unique session-id
on your server
Call join()
with the same ID for all collaborators
The following list includes the most common issues and steps for troubleshooting them.
Authentication Failures
Verify client_id
and client_secret
Ensure UID matches between auth and config
Check network connectivity to auth.getbee.io
Editor Not Loading
Confirm container element exists
Verify container ID matches config
Check for JavaScript errors in console
Token Expiration Issues
Implement onTokenExpired
callback
Test token refresh flow
Q: Can I use the SDK without server-side authentication? A: While possible for testing, production implementations must use server-side auth for security.
Q: How do I customize the editor's appearance? A: The SDK supports UI customization through configuration options. Refer to the advanced documentation.
Q: What happens when the token expires? A: When your token expires after 12 hours:
The editor will become unresponsive
You must proactively:
Best practice is to refresh tokens before expiration (recommended at 11 hours)
This comprehensive guide covers all aspects of Beefree SDK integration, from initial setup to advanced features.
Remember to:
Always use server-side authentication
Implement proper token refresh logic
Test thoroughly before production deployment
Monitor for SDK updates and new features
You can install Beefree SDK using either or :
Repository:
Reference the in GitHub for example templates.
Q: Where can I find sample templates? A: Visit our for examples.