FLUX Laser SDK / API Integration
Drive FLUX laser machines from your own code. The Beam Studio Easy API exposes the whole job pipeline — load a design, calculate it, start the machine, and follow progress — through one simple JavaScript class.
Meet the Beam Studio Easy API
Beam Studio ships with a scripting interface called the Easy API. A global EasyManipulator class connects to your machine, loads a design, and runs the job, so your own tools can prepare and run laser work programmatically. Scripts are plain JavaScript (.js) files: run one by importing it into Beam Studio, or experiment line by line in the built-in console under Help ▸ Debug Tool.
From script to finished job
Every integration drives the same four steps.
- 1
Connect
Create an EasyManipulator instance and select your machine by name with selectMachine().
- 2
Load a design
Pass BVG markup — Beam Studio's SVG-based format whose layers carry speed, power, and repeat parameters — to loadBVG().
- 3
Calculate
calculate() runs the slicing computation and returns the estimated time cost before anything moves.
- 4
Start & monitor
start() uploads the job and begins the work. Follow along with getStatus(), or pause, resume, and abort at any point.
Send a job from code
A complete script: connect, load a BVG design, estimate the time cost, start, and watch progress.
let main = async () => {
// BVG is Beam Studio's SVG-based job format: each layer carries its own
// laser parameters (speed, power, repeat) as data attributes.
const bvg = `
<svg id="svgcontent" width="3000" height="2100"
xmlns="http://www.w3.org/2000/svg"
data-top="-1300" data-left="-512" data-zoom="0.115"
data-rotary_mode="false" data-engrave_dpi="medium">
<g class="layer" data-repeat="1" data-strength="1" data-speed="20" data-color="#333333">
<title>Default</title>
<rect x="201.86" y="196.98" width="713.46" height="913.57" fill="black" stroke="#333333"/>
</g>
</svg>`;
const beamAPI = new EasyManipulator();
beamAPI.addEventListener("LOAD", () => console.log("BVG loaded"));
beamAPI.addEventListener("DONE", () => console.log("Task done"));
beamAPI.addEventListener("ERROR", (event) => console.log("Error", event.detail));
await beamAPI.selectMachine("Your Machine Name");
await beamAPI.loadBVG(bvg);
const { timeCost } = await beamAPI.calculate();
console.log("Estimated time cost:", timeCost);
await beamAPI.start();
// Poll state and progress while the machine works.
setInterval(() => console.log(beamAPI.getStatus()), 2000);
};
main();EasyManipulator methods
| Method | What it does | Returns |
|---|---|---|
| selectMachine(name) | Connects to the machine with the given name. | Promise<Boolean> |
| loadBVG(bvg) | Loads BVG design content into the workspace. | Promise<Boolean> |
| calculate() | Runs the slicing computation and estimates the job duration. | Promise<{ success, timeCost }> |
| start() | Uploads the job to the machine and starts it. | Promise<Boolean> |
| pause() | Pauses the running job. | Boolean |
| resume() | Resumes a paused job. | Boolean |
| abort() | Stops and cancels the current job. | Boolean |
| getStatus() | Reports the machine state and job progress. | { state, progress } |
React to the machine, not to timers
EasyManipulator extends EventTarget, so scripts subscribe with addEventListener and removeEventListener.
| Event | Fired when |
|---|---|
| LOAD | The design file finished loading. |
| CALCULATED | Slicing and time estimation completed. |
| UPLOADING | Job data transfer to the machine began. |
| UPLOADED | Job data transfer finished. |
| DONE | The task completed. |
| ERROR | An operation failed; details arrive in event.detail. |
getStatus() reports one of five machine states — IDLE, READY, BUSY, WORKING, or COMPLETED — together with a progress percentage, so long-running jobs can feed your own dashboard or queue.
Build FLUX into your workflow
The complete Easy API documentation and the Beam Studio source live on GitHub. Questions about an integration project? Our team is happy to help.
