> For the complete documentation index, see [llms.txt](https://build.localwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://build.localwp.com/building/add-on-structure.md).

# Add-on Structure

Add-ons extend Local in one of two ways:

* Events that are registered with the Local UI are added to the "Renderer" entry point.
* Events that don't register with the Local UI are added to the "Main" entry point.

### ​Renderer entry point​ <a href="#renderer-process-entry-point" id="renderer-process-entry-point"></a>

The renderer process is what runs inside Local's main window. This is where you'll add buttons, forms, and any other user interface elements.

Most Add-ons will exclusively use the renderer process entry point for the sake of simplicity.

To use this entry point, ensure that a `renderer` property is defined within the `package.json` file, which points to the compiled Javascript file.&#x20;

Local passes a [`context`](/building/context-api.md)  object to the exported function, which allows you to leverage existing tools that are already shipped with Local.

![](/files/-MUu7bVS-zDkgDoXwGgf)

### ​Main entry point​ <a href="#main-process-entry-point" id="main-process-entry-point"></a>

The main process allows you to register and hook into Local functionality that doesn't rely on the Local UI. By tapping into the main process, you can run processes even when the window is closed but Local is still running.

To use this entry point, ensure that a `main` property is defined within the `packge.json` file, which points to the compiled Javascript file.

Local passes a [`context`](/building/context-api.md) object to the exported function, which allows you to leverage existing tools that are already shipped with Local.

![](/files/-MUu8KBKLwAzRkTJSoKx)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://build.localwp.com/building/add-on-structure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
