# Quick Reference {#quick-reference}


Essential reference tables and checklists for plugin development.


## Plugin Lifecycle Methods {#plugin-lifecycle-methods}


| Method           | Phase        | Purpose                               |
| ---------------- | ------------ | ------------------------------------- |
| `onInitialize()` | Startup      | Register listeners, set up monitoring |
| `onActivate()`   | Activation   | Create windows, start services        |
| `onDeactivate()` | Deactivation | Hide windows, pause services          |
| `onDispose()`    | Shutdown     | Release all resources                 |


## Template Comparison {#template-comparison}


| Template    | Bundle Size | Best For                                      |
| ----------- | ----------- | --------------------------------------------- |
| HTML/CSS/JS | ~60 KB      | Simple plugins, rapid prototyping             |
| React       | ~200 KB     | Medium complexity, component reusability      |
| Angular     | ~350 KB     | Complex applications, enterprise requirements |


## Download Context Types {#download-context-types}


| Type                              | Use Case                                          |
| --------------------------------- | ------------------------------------------------- |
| `PluginDownloadContextType.CDN`   | HTTPS ZIP archive from a CDN endpoint             |
| `PluginDownloadContextType.LOCAL` | Local filesystem ZIP (development and enterprise) |
| `PluginDownloadContextType.NPM`   | npm package registry (public or private)          |


## IPC Channel Naming Convention {#ipc-channel-naming-convention}


All plugin IPC channels should be prefixed with the plugin's unique identifier to prevent collisions:

```
plugin-name::channel-action
```


## Common IPC Patterns {#common-ipc-patterns}


```typescript
// Main → Renderer (one-way push)
window.webContents.send("my-plugin::update", data);

// Renderer → Main (fire-and-forget)
ipcRenderer.send("my-plugin::notify", data);

// Renderer → Main (request/response)
const result = await ipcRenderer.invoke("my-plugin::action", data);

// Main process handler
ipcMain.handle("my-plugin::action", async (event, data) => {
  return { result: "response" };
});
```


## Distribution Checklist {#distribution-checklist}


- [ ] `manifest.json` present and valid
- [ ] `main` field references a compiled bundle
- [ ] All IPC handlers removed in `onDispose()`
- [ ] Settings validated before persistence
- [ ] No raw Node.js APIs exposed to the renderer process
- [ ] `contextIsolation` enabled and not overridden
- [ ] Build artifacts packaged as `build.zip`
- [ ] Semantic version follows `MAJOR.MINOR.PATCH`


## Essential Files Reference {#essential-files-reference}


| File                | Purpose                                     | Required          |
| ------------------- | ------------------------------------------- | ----------------- |
| `manifest.json`     | Plugin identity and entry point declaration | Yes               |
| `index.ts`          | Main process entry point                    | Yes               |
| `package.json`      | npm package configuration                   | Yes               |
| `webpack.config.js` | Build pipeline configuration                | Yes               |
| `tsconfig.json`     | TypeScript compiler configuration           | Yes               |
| `preload.ts`        | Main-to-renderer IPC bridge                 | If using a window |
| `ui/index.html`     | Renderer process UI document                | If using a window |


## Additional Resources {#additional-resources}


- [Electron Documentation](https://www.electronjs.org/docs)
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
- [Webpack Documentation](https://webpack.js.org/concepts/)
- [Akita State Management](https://opensource.salesforce.com/akita/)
- [GitHub Issues](https://github.com/ever-co/ever-gauzy/issues)
- [Discussions](https://github.com/ever-co/ever-gauzy/discussions)
