Skip to main content

Custom JS vs. Custom Tools: What's the Difference?

This article will describe the difference between Custom Tool and Custom JS feature.

Written by Saifullah Bhatti

Both the Custom JS feature and Custom Tools are configured through the same customJS parameter, which often causes confusion about whether they are the same thing. They are not. This article explains what each one does, how they are used, and why your custom tools keep working even on plans that do not include the Custom JS feature.

What is Custom JS?

Custom JS lets you inject your own JavaScript into the builder to extend or change its look and behavior. The builder runs inside an iframe, and your script runs inside that iframe. It is useful for restyling the interface, handling custom events, or extending functionality. It is available on the Enterprise plan. See the Custom JS / CSS documentation for full details.

There are two ways to pass your code to the customJS parameter:

  • As a string - place your JavaScript source directly in the parameter (it also accepts an array of strings).

  • As a hosted file - host your .js file on your own server and pass the file's URL.

What are Custom Tools?

Custom Tools let you build your own drag-and-drop tools for the builder, each with its own properties and property editors. They are registered through the same customJS parameter, but instead of arbitrary styling or behavior code, you use Unlayer's dedicated methods:

  • unlayer.registerTool() - registers your custom tool so it appears in the tools panel.

  • unlayer.registerPropertyEditor() - registers a custom property editor (a UI control) for your tool's properties.

These methods (along with createViewer and createWidget) are only available inside the customJS parameter, which is why both features share the same entry point. For a step-by-step guide, see Create a Custom Tool and the Custom Tools overview.

How are they different?

The distinction is what the code does, not where it is passed. Custom JS injects scripts that alter the builder's appearance and behavior. Custom Tools register new tools using Unlayer's recognized registerTool and registerPropertyEditor methods. Because the builder detects these registration methods specifically, it processes them separately from general-purpose Custom JS.

Why your Custom Tools work even without the Custom JS feature

This is the key point. Even though both are passed through the same customJS parameter, they are governed by separate plan entitlements. Custom Tools are available from the Launch plan upward, while the Custom JS feature is limited to Enterprise.

If your plan includes Custom Tools but not the Custom JS feature, your custom tools still work without any issues. The builder recognizes the registerTool and registerPropertyEditor methods and renders your tools correctly. What will not run is any additional JavaScript intended purely to alter the builder's look and behavior, since that requires the Custom JS entitlement.

In short: passing code through customJS does not require the Custom JS feature as long as that code is registering custom tools.

Custom Tools limits by plan

The number of custom tools you can register depends on your plan (see the pricing page for the full comparison):

  • Launch - 1 custom tool

  • Scale - 3 custom tools

  • Optimize - 5 custom tools

  • Enterprise - Custom

If you register more custom tools than your plan allows, the extra tools are excluded from the tools panel and a warning is logged to the browser console. Custom tools within your limit are unaffected. To register more, upgrade your plan.

Did this answer your question?