Vue.js No-code Email Builder
Welcome to the Vue.js Quickstart Guide for embedding Beefree SDK's no-code email builder in your Vue.js application.
Introduction
This Quickstart Guide walks you through embedding the Beefree SDK's no-code email builder into a Vue 3 application using the official Vue wrapper @beefree.io/vue-email-builder and the /loginV2 authorization process. By the end of this guide, you'll have a fully functional Vue app running locally with the builder embedded, authenticated, and ready to use — following Vue best practices.
Reference the vue-email-builder GitHub repository with the complete code for this project to follow along in this Vue.js Quickstart Guide. The example/ folder in the repository contains a full working demo application.
Watch the Vue.js Video Series to learn more about how to install Beefree SDK into your Vue.js application visually.
Prerequisites
Before you begin, make sure you:
Understand Vue.js and its core concepts (for example,
ref,onMounted, Composition API)Have a Beefree SDK account
Create an application in the Beefree Developer Console
Obtain your Client ID and Client Secret from the Developer Console
What you'll learn
This guide covers how to:
Set up a new Vue 3 app
Install the Beefree SDK Vue wrapper
Set up secure authentication using a proxy server
Initialize and embed the builder using the
Buildercomponent anduseBuildercomposableRun and test your app locally
1. Create a Vue 3 App
To create your Vue 3 app, open a terminal and run the following command. This example uses beefree-vue-demo as the project name.
After installation, your project structure will be ready for development. You'll create and wire up the main app component and the Beefree editor component in the next steps.
2. Install the Beefree SDK Vue Wrapper
To install the official Beefree SDK Vue wrapper npm package, run:
The wrapper has a peer dependency on vue (>= 3.3), so make sure it is already in your project.
This package contains everything needed to render the no-code email builder inside your Vue application: a ready-to-use Builder component and a useBuilder composable for programmatic control.
3. Create the Main App Component
Now you'll set up your app's primary UI structure, which includes a header and a "Read the Docs" button, plus the embedded builder component.
Vue-specific implementation tips
The
<BeefreeEditor />component will be a custom child componentThe
Buildercomponent from@beefree.io/vue-email-builderhandles the editor rendering automaticallyThe
useBuildercomposable provides programmatic control (save,preview,load, etc.)TypeScript integration is fully supported out of the box
File: src/App.vue
This file is responsible for the layout and basic interface of your app. It creates a container that introduces the demo, links to the documentation, and includes the builder.
Note: This helps you visually distinguish the application UI from the embedded builder's interface.
4. Create the Editor Component
You'll now define the builder logic in a dedicated component — BeefreeEditor.vue.
This step includes setting up the Builder component, configuring the useBuilder composable, handling events, and fetching a secure token.
Authentication flow (server-side only)
To securely authenticate with Beefree:
Never expose your Client ID or Client Secret in frontend code
Always use a backend or proxy server to call
/loginV2Pass a UID to uniquely identify the user session
Builder Component and useBuilder Composable
The @beefree.io/vue-email-builder wrapper provides two main exports:
Builder— a Vue component that renders the Beefree editor. It requirestokenandconfigas props. You can optionally pass atemplateprop to load initial content.useBuilder— a composable that manages the builder lifecycle and returns programmatic controls. You pass it a configuration object (IBeeConfig).
The Builder component uses events with the bb- prefix to avoid collisions with native Vue events. Key events include:
@bb-load
Fires when the builder is fully initialized and ready
@bb-save
Fires on save with [pageJson, pageHtml, ampHtml, templateVersion, language]
@bb-save-as-template
Fires on save-as-template with [pageJson, templateVersion]
@bb-error
Fires on errors
@bb-send
Fires when the user triggers "send"
@bb-change
Fires on every content change
@bb-session-started
Fires when a collaborative session starts
The useBuilder composable returns:
save()
Export the current design as JSON + HTML
saveAsTemplate()
Export the current design as a reusable JSON template
preview()
Open a preview of the current design
load()
Load a new template into the editor
loadConfig()
Dynamically update settings (e.g., change language) without re-mounting
getTemplateJson()
Get the current template JSON
updateToken()
Refresh the authentication token
File: src/components/BeefreeEditor.vue
This file handles:
Fetching an access token from the proxy server on mount
Rendering the
Buildercomponent with the token and configHandling
bb-save,bb-save-as-template, andbb-erroreventsProviding programmatic controls via the
useBuildercomposable
You can later extend this to include additional config options like custom translations, modules, sidebar positioning, and more.
5. Set up the proxy server (V2 Auth)
To authenticate securely using /loginV2, create a lightweight proxy server with Node.js and Express.
Why a proxy is required
The Beefree SDK requires authentication via Client ID and Client Secret, which must not be exposed in frontend code. The proxy server allows you to:
Keep credentials safe
Fetch access tokens securely
The .env.example file in the root of the GitHub repository includes an example of a .env file. To create a .env file, rename this file to .env. Copy and paste your credentials from the Beefree SDK Developer Console securely into the file's placeholders. The following code shows an example of what these placeholders look like inside the file.
File: proxy-server.js (root directory)
This server exposes a POST route (/proxy/bee-auth) that:
Accepts a
uidfrom the clientCalls the Beefree Auth endpoint
Returns a token to the frontend
You'll also install axios, express, and cors as dependencies.
6. Run the Application
You're now ready to run both the Vue app and the proxy server.
Important: Run each in a separate terminal tab or window.
Terminal 1 (Proxy Server)
Terminal 2 (Vue App)
Then visit: http://localhost:5173
You should see your app running with the builder loaded inside the UI.
Troubleshooting tips
This section lists best practices to keep in mind, and troubleshooting tips while embedding Beefree SDK into your Vue.js application.
Blank Editor Container
Confirm that a valid
tokenis being passed to theBuildercomponentCheck the browser console for JavaScript errors during initialization
Make sure the proxy server is running and returning a valid token
Authentication issues
Make sure the proxy server is running
Verify that your Client ID and Secret are correct
Open DevTools → Network tab to inspect token requests
TypeScript errors
The
@beefree.io/vue-email-builderpackage includes full TypeScript definitions out of the boxEnsure all event handlers match expected signatures (events use
bb-prefix and pass arguments as arrays)
Common pitfalls to avoid
Don't expose credentials in your frontend code
Handle token expiration scenarios (for example, show a message or refresh)
Don't use the deprecated
@beefree.io/sdkpackage directly — use@beefree.io/vue-email-builderinstead
Next steps
With Beefree SDK running in your Vue 3 app, you can explore advanced customization options.
The useBuilder composable's loadConfig() method lets you change the builder configuration dynamically at runtime. For example, to switch the editor language without re-mounting:
A few common customizations you can apply:
Custom translations
Module ordering
Sidebar positioning
Grouping modules
Collaborative editing
The wrapper supports real-time collaborative editing. To enable it, pass shared and handle the bb-session-started event:
Explore more in the Beefree SDK documentation.
For a full working example including multiple builder types (Email, Page, Popup, File Manager), collaborative editing, and multi-language support (22 languages), see the example/ folder in the vue-email-builder repository.
Last updated
Was this helpful?

