> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: About Backend Events

## Article: Velo Backend Events

## Article Link: https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/events/about-backend-events.md

## Article Content:

# About Backend Events

Many [Velo APIs](https://dev.wix.com/docs/velo.md) include events that trigger when the required conditions are met. Unlike in the frontend, where event handlers are defined in the page code, for backend events, handlers are defined in the `events.js` backend file.

> **Note**: When extending websites, you can only handle events using Velo. Handling site events using the JavaScript SDK [isn't currently supported](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/develop-with-the-sdk/velo-to-sdk-api-mapping.md#velo-apis-you-should-continue-to-use).

For example, you might have backend event handlers that trigger when:

+ An invoice is paid.
+ A file has been uploaded to the Media Manager.
+ A form is submitted by a site visitor.

Backend events are only triggered for published sites and don't work in preview mode.

<iframe width="560" height="315" src="https://youtube.com/embed/-LAtdo0mbiY" title="Intro to Backend Events on Wix Studio" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Supported IDEs

You can define backend event handlers using:

- The [editor](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/velo-workspace/workspaces/wix-studio-working-with-the-code-panel.md) (Wix Studio and Wix Editor)
- The [Wix IDE](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/velo-workspace/wix-ide/wix-studio-about-the-wix-ide.md) (Wix Studio)
- Your [local IDE](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/developer-tools/git-integration-wix-cli-for-sites/about-git-integration-wix-cli-for-sites.md) (Wix Studio and Wix Editor)

## Velo Package Backend Events

[Velo packages](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/working-with-velo-packages.md) are code libraries built with Velo that allow you to add specific functionality to your site, saving you the time you would have spent coding the functionality on your own.

Some Velo packages include backend events, which are contained in their own `events.js` files. So if you add a Velo package that includes backend events, you might end up with multiple `events.js` files in several locations.

## Testing and Debugging

To test an event handler in preview mode, use [functional testing](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/functional-testing/about-functional-testing.md). Functional testing saves you time and effort when building your own system for triggering and testing your backend functions, by allowing you to quickly test backend functions directly in the code editor.

See step-by-step instructions on [how to test your backend code](https://dev.wix.com/docs/develop-websites/articles/workspace-tools/testing-monitoring/functional-testing/test-backend-functions-with-functional-testing.md).

## See Also

+ [Define backend event handlers](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/events/define-backend-event-handlers.md)
+ [About Account-Level Webhooks](https://dev.wix.com/docs/overview/backend-services/about-account-level-webhooks.md): Notifications for account-wide changes, such as site creation and team member updates. Available for Enterprise and Channels partners, and handled on your own server.