Documentation
    Preparing search index...

    Function createThemeService

    • Create a theme service that handles the NIP-5D theme.* NAP.

      Answers theme.get with the current theme (default or options.initialTheme). Exposes publishTheme(theme) for the host app to broadcast theme changes to every registered napplet — the shell adapter (Plan 13-02) wires onBroadcast to runtime.sendToNapplet fan-out.

      Parameters

      Returns ThemeService

      A ThemeService bundle ready for runtime.registerService('theme', service.handler)

      import { createThemeService } from '@kehto/services';

      const theme = createThemeService();
      runtime.registerService('theme', theme.handler);
      theme.publishTheme({ colors: { background: '#fff', text: '#000', primary: '#00f' } });