Skip to content

Plugin System

PRO FEATURE

The plugin system is available in GemShell Pro.

Create plugins to extend GemShell's build process. Inject code, transform assets, add watermarks, send webhooks, and more.

What Can Plugins Do?

  • Inject Code - Add CSS, HTML, and JavaScript to your game
  • Transform Assets - Modify files during build
  • Add Overlays - FPS counters, watermarks, debug tools
  • Send Webhooks - Discord notifications, analytics
  • Encrypt Data - Protect save files with AES-256

Compatibility Promise

We guarantee backwards compatibility for all plugins:

  • Plugins written for GemShell 0.6.0 will work in all future versions
  • Hook signatures are additive-only - we never remove fields
  • Setting types are additive-only - we only add new types
  • Deprecated APIs warn for 2+ versions before removal

Plugin Structure

A plugin is a folder in ~/.gemshell/plugins/:

~/.gemshell/plugins/
└── my-plugin/
    ├── plugin.js       # Manifest (required)
    ├── style.css       # Styles
    ├── template.html   # HTML template
    └── script.js       # JavaScript

Quick Example

plugin.js:

javascript
module.exports = {
  name: 'My Plugin',
  version: '1.0.0',
  inject: ['style.css', 'template.html', 'script.js'],
  settings: [
    { id: 'enabled', type: 'checkbox', label: 'Enable', default: true }
  ]
};

template.html:

html
{{#if enabled}}
<div class="my-overlay" id="my-overlay">Hello!</div>
{{/if}}

script.js:

javascript
const { enabled } = GEMSHELL_SETTINGS;
if (!enabled) return;

console.log('Plugin loaded!');

Next Steps