Angular No-code Email Builder
Welcome to the Angular Quickstart Guide for embedding Beefree SDK's no-code email builder in your Angular application.
Introduction
Welcome to the Angular Quickstart Guide for embedding the Beefree SDK’s no-code email builder in your Angular application.
This step-by-step tutorial demonstrates how to set up and run a fully functional Angular app integrated with the Beefree SDK using the /loginV2 authentication process. By the end of this guide, you’ll have a live development environment showcasing the Beefree email editor embedded in Angular—following best practices for this framework.
Reference the beefree-angular-demo GitHub repository with the complete code for this project to follow along in this Angular Quickstart Guide.
Watch the Angular Video Series to learn more about how to install Beefree SDK into your Angular application visually.
Prerequisites
Before starting, ensure you have the following:
A basic understanding of Angular and its component-based architecture.
Node.js installed on your machine.
You’ve created an application in the Developer Console to obtain your
Client IDandClient Secret.
What You'll Learn
In this guide, you’ll learn how to:
How to create a new Angular app
Install and configure Beefree SDK within the Angular app
Set up an Express proxy server for secure authentication
Create reusable Angular components
Embed and initialize the Beefree builder in your UI
Run your Angular app locally with the builder fully integrated
1. Create the Angular Application
Use the Angular CLI to generate a new standalone project.
This command:
Installs the latest Angular CLI globally.
Creates a new standalone Angular app named
beefree-angular-demo.Enables strict typing and sets CSS as the styling format.
Omits routing for simplicity.
2. Install Dependencies
Install the required SDK and supporting packages:
@beefree.io/sdk: The official SDK for integrating the no-code email builder into the application.axios,express,cors,dotenv: Used for creating a local proxy server that securely handles Beefree SDK's authentication.
3. Configure Environment Variables
Create a .env file at the project root:
.env file at the project root: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.
Ensure you replace your_client_id and your_client_secret with values from the Beefree Developer Console.
Add .env to .gitignore:
.env to .gitignore:This ensures your credentials stay private and aren’t committed to version control.
4. Set Up the Proxy Server
Create proxy-server.js in the root directory. This server acts as a backend that securely fetches authentication tokens from Beefree using your credentials.
This server:
Accepts a
POSTrequest with a user ID.Requests an auth token from Beefree using your credentials.
Returns the full token object needed to initialize the SDK.
5. Create the Beefree Editor Component
Use Angular CLI to generate a standalone component.
This creates a self-contained component for embedding the builder.
beefree-editor.ts
beefree-editor.tsAngular Concepts:
@Component: Defines a reusable UI element.@ViewChild: Gets a reference to a DOM element in the template.ngOnInit: Lifecycle hook that runs after component initialization.ElementRef: Accesses native DOM directly.standalone: true: Skips module declaration—modern best practice.
beefree-editor.html
beefree-editor.html6. Update the Main App Component
Now include your editor inside the main app shell.
app.ts
app.tsAngular renders your App component at the root of the DOM. The BeefreeEditor is injected as a child, encapsulated inside <app-beefree-editor />.
7. Run the Application
Use two terminal windows:
Terminal 1: Run the Proxy Server
Terminal 2: Run the Angular App
Visit: http://localhost:4200
You now have a fully functional Angular app with the Beefree SDK embedded and authenticated via a secure proxy. You should see the Beefree editor embedded and ready to use.
Best Practices
Container ID Match
container: 'beefree-container'in the SDK config matchesid="beefree-container"in the HTML.Full Token Object The proxy returns the complete auth object required by
new BeefreeSDK(token).Type Safety Proper typing is used in
onSave, following TypeScript conventions.Global Naming Consistency Unified naming across:
App:
beefree-angular-demoUser ID:
'beefree-angular-demo-user'Container:
'beefree-container'
Next Steps
Beefree SDK offers extensive customization options. Explore Beefree SDK's documentation to unlock advanced capabilities for your design workflows.
Last updated
Was this helpful?

