Skip to content

Website guide

Wix Velo:
What Code Can You Add to a Wix Site?

Velo adds JavaScript to a Wix site: frontend code in the visitor's browser and backend code on Wix's servers. It works on the Wix Editor and Wix Studio, not on Wix Harmony.

Figment editorial teamPublished Updated

Velo lets you add JavaScript to a Wix site, split into frontend code that runs in the visitor's browser and backend code that runs on Wix's servers. It works only on the Wix Editor and Wix Studio, not on Wix Harmony. Frontend code reacts to clicks and updates the page. Backend code, through "web modules," handles anything that must stay private, such as calling a paid API with a secret key or querying your site's database. Everything below comes from Wix's developer documentation.

What is Velo?

Velo is Wix's JavaScript development layer, built into the Wix Editor and Wix Studio. It gives you "a zero-setup, serverless backend environment" running on what Wix calls its "Node.js server-side runtime," alongside frontend code you write against page elements (Wix Developers, "About the Site Backend"). It is not a separate product you buy. It is a code layer inside editors that already support it.

Where does frontend code run, and what can it do?

Frontend code runs in the visitor's own browser. Wix's documentation says: "Frontend code runs in the site visitor's browser and here you define the interactive parts of your site," including "Responding to user input," "Updating the UI," and "Making calls to backend services" (Wix Developers, "Where Do I Put My Code?"). Because this code is publicly visible, Wix advises: "avoid including sensitive information, such as API keys or private logic."

Frontend code comes in three kinds:

  • Page code is logic for one page, in that page's own code file.
  • Global code (masterPage.js) runs on every page, for shared logic like a site-wide header, footer or search bar.
  • Public files hold shared functions you write once and import into page files, backend files or other public files.

One mistake Wix flags: importing functions from masterPage.js into individual pages makes its onReady handler run twice on those pages. Put shared logic that is not page-specific in a public file instead.

Where does backend code run, and what can it do?

Backend code runs on Wix's servers and never in the visitor's browser. Wix's documentation says: "Backend code runs on Wix's secure servers and isn't exposed to site visitors. This is the place for logic that needs to be protected, like: Interacting with sensitive data, Sending emails, Handling payments, Verifying permissions." Two file types have different reach:

  • .web.js files (web modules) can be called directly from frontend code. Wix says: "Web modules that can be called from the frontend. You can configure permissions for each function to control who can access them." Older .jsw files do the same job and "have been deprecated in favor of .web.js files but are still supported."
  • Internal .js files cannot be reached from the frontend. If you try, Wix's error message says: "Access to backend script 'backend/calculations.js' denied! Client-side scripts can only import web-modules from backend code context." To expose an internal function, import it into a .web.js file, then import that web module into your page code.

Two more backend files do specialized jobs. http-functions.js exposes custom GET, PUT, POST and DELETE endpoints so outside services can call your site. data.js defines data hooks that run before or after changes to a collection (validating or modifying data on insert, update or remove).

What can Velo code reach?

The backend environment gives you access to:

  • Wix's own database through the wix-data API, or an external database you connect and manage yourself, per Wix's site-backend overview.
  • Wix APIs, the same platform surface Wix's own apps use, for workflows like Bookings, Members and Payments, scoped by the permissions your account and app connection have.
  • Backend events, built-in triggers like onFileUploaded (Media Manager) or onInvoicePaid, which run custom logic when something happens elsewhere on the site.
  • The Secrets Manager, for API keys, OAuth tokens and other sensitive values. Wix says these belong there "instead of hardcoding values into your code," retrieved in backend code through the Secrets API.

The wix-data API lets you query, insert, update and delete items in your site's collections. Wix's glossary defines a database collection as "a table of data that you can use in a Wix site," where each row is an item and each column is a field (Wix Developers, "Velo Glossary"). Wix's CMS can also keep separate sandbox and live collections, so test data and visitor-facing data can differ.

Which Wix editors support Velo?

The Wix Editor and Wix Studio, not Wix Harmony. Wix's "About Wix Harmony" page says: "Wix Harmony doesn't support site code. If your projects require code customization, continue using Wix Editor or Wix Studio" (Wix Developers, "About Wix Harmony"). It lists the features missing from Harmony, including custom site code, HTTP functions, data hooks, backend event handlers, web modules and scheduled jobs. Harmony does allow "custom code to add HTML, JavaScript, and CSS snippets," a narrower feature than Velo and not a substitute for it.

Wix describes Studio as the code-capable option going forward: "Wix Studio supports: Full coding capabilities with the Wix JavaScript SDK and Velo APIs... Professional tooling including IDE integration and Git workflows." Existing Wix Editor sites with Velo code keep working and are "not being migrated to Harmony," so the constraint affects where you can build new Velo functionality. If you are not sure which editor your site uses, see Wix Harmony vs Wix Editor vs Wix Studio.

What are the limits on Velo's data access?

Two caps matter before you design around Wix Data.

  • Query results. A wix-data query's limit() defaults to 50 and tops out at 1,000 items per request. It is lower for some built-in Wix app collections. Wix's example is the Stores/Product collection, capped at 100.
  • Total collection items. Wix caps the total number of items a site's collections can hold. Once you hit it, you cannot add data to any collection until you free up room. The cap does not apply to items in Wix's own app collections, external database collections or sandbox collections.

Sources: Velo API Reference, "Limit" and Wix Developers, "About Data Feature Limitations".

Can AI write or edit my Velo code?

It depends on the AI tool and the editor. Our guide to AI editing a Wix site covers Wix's own Aria assistant, Wix's official developer MCP server for connecting an outside coding agent to Wix's APIs, and how to grant a browser-based agent limited access. None of that changes Harmony's lack of code support.

Where does each kind of code go?

Code typeWhere it runsWhat it can doEditor support
Page codeVisitor's browserHandle events, update the UI, call web modulesWix Editor, Wix Studio
Global code (masterPage.js)Visitor's browser, every pageSite-wide UI logic (header, footer, shared state)Wix Editor, Wix Studio
Public filesVisitor's browser (imported where needed)Shared frontend functions, avoid duplicationWix Editor, Wix Studio
.web.js web modulesWix's serversCallable from the frontend; can touch sensitive data/logic with permission controlsWix Editor, Wix Studio
Internal .js backend filesWix's serversSecure logic not reachable from the frontend directlyWix Editor, Wix Studio
http-functions.jsWix's serversExpose custom REST endpoints to outside servicesWix Editor, Wix Studio
Any of the aboven/an/aNot available on Wix Harmony