declareModule
CalldeclareModule once, at the top of the file, before anything else. It is what gives your
plugin a name, puts it in the Plugins tab and tells Seraph what it intends to use.
Without
declareModule the file still runs, but it is named after itself and holds no
permissions, so every gated call it makes is refused.
Permissions
A gated call only goes through when all three of these are true: the master switch is on, that plugin is enabled, and the plugin declared the matching permission. Ask for the least you need, users see the whole list before they enable anything.console, scheduler, input, text, party and the event listeners themselves are ungated.
A refused call is written to the log once per plugin and permission, naming what was attempted, so
a plugin that quietly does nothing is usually a missing entry in permissions.
Network rate limit
Thenetwork permission is additionally rate limited to 30 requests per minute per plugin,
counted across http.fetch and stats, so a plugin cannot spam an endpoint even once you have
granted it access.
Config
Anything you put inconfig becomes a default setting. Users edit it from the plugin’s own menu in
the Plugins tab, and your plugin reads it through the global config object:
config is allowed, and savePluginConfig() writes the changes to disk so they
survive a restart:
plugins/config.
Hiding a value
Name a config key insecrets and the menu draws it as dots with an eye button beside it, the same
as the API key field, so a webhook or a token is not read off the screen during a share:
plugins/config and read through config like
any other setting, so treat this as a guard against an accident rather than a way of keeping a
secret from whoever is at the keyboard. A hidden field is still editable while it is masked, and a
key that is not part of config is ignored.
Dependencies
List other plugins independsOn and Seraph loads them first, so their exports are ready by the
time your file runs: