📚
Vendetta Plugin Docs
Contribute
  • ⏰Progress
  • â„šī¸Meta
    • 🔰Getting started
    • đŸ› ī¸Tools
  • 📚Guides
    • 📃Setting up
    • ã€Ŋī¸Local plugin development
    • 📜Manifest
    • 👂Plugin entrypoint
  • 🔰Examples
    • Self destruct plugin
Powered by GitBook
On this page

Was this helpful?

  1. Guides

Plugin entrypoint

PreviousManifestNextSelf destruct plugin

Last updated 1 year ago

Was this helpful?

src/index.ts
import { General } from "@vendetta/ui/components";

const { Text } = General;

export const onLoad = () => console.log("Plugin loaded!");
export const onUnload = () => console.log("Plugin loaded!");
export const Settings = () => <Text style={{ color: "#000" }}>Hello!</Text>;
  • onLoad — A function that gets called when the plugin gets enabled

  • onUnload — A function that gets called when the plugin gets disabled

  • Settings — A React JSX component, serves as the settings for the plugin

A plugin only gets ran when the user enables it. So this piece of code:

src/index.ts
console.log("Plugin loaded!");
export const onUnload = () => console.log("Plugin loaded!");

does the same thing as this piece of code:

src/index.ts
export const onLoad = () => console.log("Plugin loaded!");
export const onUnload = () => console.log("Plugin loaded!");

However it's recommended to keep your initial code in onLoad, incase this changes in the future

📚
👂
gnarpy from regretevator cutting a xan cake