This repository contains production-ready examples demonstrating advanced features of the Beefree SDK, an embeddable no-code builder for creating stunning emails, landing pages, and popups.
Beefree SDK is an embeddable no-code builder that gives your end users the freedom to design stunning emails, landing pages, and popupsβwithout writing a single line of code. It's easy to configure, intuitive to personalize, and built to scale with your needs.
- π§ Email Builder: No-code email creation environment
- π Page Builder: Landing page creation tools
- π― Popup Builder: Compelling popup design tools
- π€ AI-Generated Templates: Custom AI content creation
- π File Manager: Media asset management
- π Template Catalog: Industry best practice templates
- π§ Comprehensive APIs: Extend functionality with robust API suite
Each example demonstrates production-ready implementation of specific Beefree SDK features with modern development practices:
- π secure-auth-example - β
COMPLETE
- Enterprise-grade authentication with automatic token refresh
- Full-stack TypeScript architecture with React + TypeScript Express.js server
- Backend security with credential isolation
- Production-ready error handling and state management
- π API Monitor Panel - Real-time API debugging with request/response inspection
- π¨ custom-css-example - β
COMPLETE
- Dynamic theming system with 5 pre-built themes
- Real-time theme switching with localStorage persistence
- CSS variable architecture for maintainable styling
- React + TypeScript with modern development stack
- π template-export-pdf-example - β
COMPLETE
- Advanced PDF export via Beefree Content Services API
- Multiple export options (page size, orientation, quality)
- Real-time progress tracking with visual indicators
- Export history management with direct PDF access
- π§ shared/auth.js - β
COMPLETE
- Reusable authentication module for consistency
- JWT token management with security best practices
- Shared across all examples for unified auth experience
- liquid-personalization-example - Advanced personalization with Liquid
- reusable-rows-example - Manage reusable rows across templates
- conditional-rows-example - Show/hide rows conditionally
- locked-content-example - Lock sections with advanced permissions
- multiuser-collaboration-example - Real-time collaboration
- commenting-example - Comments with toast notifications
- advanced-permissions-example - Define roles with permissions
- content-ai-generate-example - Generate text with AI
- content-ai-style-example - Transform text tone/style
- multilanguage-template-example - Full multilingual templates
- form-block-prepopulate-example - Prepopulated forms
- form-block-contentdialog-example - Form block with content dialog
- schema-conversion-example - Convert Simple β Full JSON
- html-importer-example - Convert legacy HTML to Beefree JSON
- special-links-groups-example - Special Links grouped by categories
- video-block-example - Different video block types
- custom-add-ons-blocks-example - Custom block types
- multi-builder-switch-example - Switch between builders
- custom-file-system-example - Go integration with external file systems
- Node.js 16+ (for JavaScript examples)
- Beefree SDK credentials from Developer Console
- Clone repository:
git clone <repository-url>
cd beefree-sdk-examples
- Choose an example:
# Secure Authentication
cd secure-auth-example
# OR Custom CSS Theming
cd custom-css-example
# OR PDF Export
cd template-export-pdf-example
- Install & configure:
npm install
cp .env.example .env
# Edit .env with your Beefree SDK credentials
- Run example:
npm start
# OR for React examples
yarn dev
- Open in browser:
- secure-auth-example:
http://localhost:8080
(frontend) +http://localhost:3000
(backend) - custom-css-example:
http://localhost:8081
(requires secure-auth-example running) - template-export-pdf-example:
http://localhost:5174
(frontend) +http://localhost:3001
(backend)
Create a .env
file in each example directory with the required variables:
# Beefree SDK Credentials (Backend Only)
BEEFREE_CLIENT_ID=your_client_id_here
BEEFREE_CLIENT_SECRET=your_client_secret_here
# Server Configuration
PORT=3000
NODE_ENV=development
# Frontend Configuration
VITE_PORT=8080
# Auth proxy URL (points to secure-auth-example)
VITE_BEEFREE_AUTH_PROXY_URL=http://localhost:3000/auth/token
# Template URL for default template
VITE_BEEFREE_TEMPLATE_URL=https://rsrc.getbee.io/api/templates/m-bee
# Beefree SDK Credentials (Backend Only)
BEEFREE_CLIENT_ID=your_client_id_here
BEEFREE_CLIENT_SECRET=your_client_secret_here
# Beefree Content Services API
BEEFREE_CS_API_KEY=your_content_services_api_key_here
BEEFREE_CS_API_URL=https://api.getbee.io
# Server Configuration
PORT=3001
VITE_PORT=5174
π¨ Security: Never expose Client ID/Secret or API keys in frontend code. Always use server-side only.
Example | Status | Stack | Ports | Key Features |
---|---|---|---|---|
π secure-auth-example | β Ready | React+TS+TS Server | 8080/3000 | Enterprise auth, API monitor, token refresh, full-stack TypeScript |
π¨ custom-css-example | β Ready | React+TS | 8081 | Dynamic themes, CSS variables, real-time switching |
π template-export-pdf-example | β Ready | React+TS | 5174/3001 | PDF export, progress tracking, export history |
π§ shared/auth.js | β Ready | Node.js | - | JWT tokens, security best practices, reusable |
All examples use the shared authentication module (shared/auth.js
) for:
- β Consistent token management
- β Automatic token refresh
- β Error handling
- β Security best practices
beefree-sdk-examples/
βββ shared/
β βββ auth.js # π§ Shared authentication module
βββ secure-auth-example/ # π Vanilla JS - Production-ready secure auth
βββ custom-css-example/ # π¨ React+TS - Advanced theming system
βββ template-export-pdf-example/ # π React+TS - PDF export with progress tracking
βββ README.md # π This file
All examples now use a consistent, modern full-stack TypeScript architecture:
Frontend Stack:
- React 18: Modern React with hooks and concurrent features
- TypeScript: Full type safety with official Beefree SDK types
- Vite: Lightning-fast development server and optimized builds
- Custom Hooks: Reusable logic for auth, themes, and PDF export
- Service Layer: Clean separation of concerns and API management
Backend Stack:
- TypeScript + Express.js: Type-safe, lightweight API server
- ES Modules: Modern JavaScript module system
- tsx Development: Hot reloading for TypeScript backend development
- Shared Auth Module: Consistent authentication across examples
- Environment Variables: Secure credential management
Benefits:
- β Type Safety: Prevents runtime errors with TypeScript
- β Component Architecture: Reusable, maintainable UI components
- β Modern Tooling: Hot reloading, optimized builds, great DX
- β Scalability: Easy to extend and maintain
- β Consistency: Same patterns across all examples
- β Production Ready: Built for real-world applications
- π Beefree SDK Documentation
- π Developer Portal - Get your credentials here
- π§ API Reference
- π¬ Community Support
- π‘οΈ Backend-Only Credentials: Client ID/Secret never exposed to frontend
- π Automatic Token Refresh: Tokens refresh every 5 minutes automatically
- π Shared Authentication Module: Consistent auth logic across all examples
β οΈ Production Error Handling: Comprehensive error states and recovery- π― Custom React Hooks:
useAuth
anduseBeefreeSDK
for state management
- π Dynamic Theme System: 5 pre-built themes (Default, Dark, High Contrast, Coral)
- β‘ Real-time Theme Switching: Instant theme application without page reload
- π¨ CSS Variable Architecture: Maintainable theming with custom properties
- πΎ Theme Persistence: Remembers selected theme using localStorage
- π§ Modern Development Stack: React 18 + TypeScript + Vite
- π PDF Export via Content Services API: Official Beefree API integration
- βοΈ Multiple Export Options: Page size (A4, Letter, Legal), orientation, quality
- π Real-time Progress Tracking: Visual progress indicators during export
- π Export History Management: Track recent exports with success/failure status
- π Direct PDF Access: Open exported PDFs in new browser tabs
- π― Template Format Support: Both HTML and JSON template export
Each example follows these principles:
- β Production-Ready Code: Comprehensive error handling and edge case management
- β Type Safety: Full TypeScript implementation with official Beefree SDK types
- β Modern Architecture: React 18 + TypeScript + Vite + Express.js stack
- β Security Best Practices: Backend-only credentials, secure token management
- β Comprehensive Documentation: Detailed setup and usage instructions
- β Shared Infrastructure: Consistent authentication and patterns across examples
- β Accessibility: WCAG-compliant UI components and keyboard navigation
- β Performance: Optimized builds, lazy loading, and efficient state management
These examples are provided for educational and development purposes. Please refer to the Beefree SDK Terms of Service for usage guidelines.
π Ready to start? Choose an example above and follow its README for detailed setup instructions!