Settings
How plugins define, read, and update persisted settings in Nuclear.
Settings API for Plugins
Core concepts
Quick start
import type { NuclearPluginAPI } from '@nuclearplayer/plugin-sdk';
export default {
async onLoad(api: NuclearPluginAPI) {
await api.Settings.register([
{
id: 'theme',
title: 'Theme',
description: 'Choose your preferred theme',
category: 'Appearance',
kind: 'enum',
options: [
{ value: 'system', label: 'System' },
{ value: 'light', label: 'Light' },
{ value: 'dark', label: 'Dark' },
],
default: 'system',
},
{
id: 'scrobbleEnabled',
title: 'Enable scrobbling',
category: 'Integrations',
kind: 'boolean',
default: false,
widget: { type: 'toggle' },
},
]);
},
};Setting definitions
ID rules
Categories
Defaults and persistence
React hook (advanced)
Error handling
End-to-end example
Reference
Best practices
Troubleshooting
Symptom
Cause
Fix
Last updated