Skip to content
Logo

Plugin API

Definition fields

FieldTypeNotes
namestringRequired. Letters, numbers, underscores, and hyphens only.
setupfunctionRequired. Receives KlackApi; register cleanup with the provided methods.
descriptionstringOptional human-readable summary.
versionstringOptional plugin version shown by Klack.list().
defaultEnabledbooleanDefaults to true. A saved user override takes precedence.

Setup context

PropertyDescription
klack.uiThe scoped methods documented in UI contributions.
klack.domIncremental selector watching and scoped mutation observers.
klack.eventsPlugin-owned event listeners.
klack.timersPlugin-owned timeouts, intervals, and animation frames.
klack.cleanupRegisters cleanup for direct changes and third-party APIs.
klack.loggerSlack renderer’s console, suitable for namespaced development logs.
klack.versionThe currently running Klack version.

Browser global

The frozen window.Klack object exposes:

Klack.version
Klack.list()
Klack.isEnabled(name)
Klack.enable(name)
Klack.disable(name)

Plugin modules must default-export a definition with name and setup.