# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
