Guide

Modules

Extend Glyria with plug-and-play NPM modules.

Overview

Glyria modules are NPM packages that ship their own commands and events. Once declared in your config, they are automatically loaded alongside your own code — no manual imports needed.

Adding a module

Install the package, then declare it in glyria.config.ts:

npm install @glyria/timers
// glyria.config.ts
export default defineGlyriaConfig({
    modules: ["@glyria/timers"]
})

That's it. Glyria will automatically discover and load the module's commands and events at startup.

How it works

When Glyria starts, it scans each declared module's package for commands/ and events/ folders and loads them exactly like your own files. If neither folder exists, it skips silently.

Auto imports

Each module exposes its exports under a PascalCase namespace derived from its package name. You can use them anywhere in your project without importing anything.

PackageNamespace
@glyria/timersTimers.*
@glyria/economyEconomy.*
@glyria/moderationModeration.*
// No import needed
const job = Timers.createJob(() => {
    console.log("runs every minute")
}, "* * * * *")
The namespace is always the package name without the scope, in PascalCase. @glyria/timersTimers, @glyria/some-featureSomeFeature.

Multiple modules

export default defineGlyriaConfig({
    modules: [
        "@glyria/timers",
        "@glyria/economy",
        "@glyria/moderation",
    ]
})

Each module is independent — commands and events from all declared modules are loaded without conflict.

Copyright © 2026