Trilium Electron API
    Preparing search index...

    Interface ElectronSecurityApi

    Security settings that live outside the database (in data_dir/security.json) to prevent malicious scripts from modifying them. Changes require a native OS confirmation dialog and an app restart to take effect.

    interface ElectronSecurityApi {
        setBackendScriptingEnabled(enabled: boolean): Promise<boolean>;
        setLanAccessEnabled(enabled: boolean): Promise<boolean>;
        setSqlConsoleEnabled(enabled: boolean): Promise<boolean>;
    }
    Index

    Methods

    • Requests a change to a security setting. Shows a native OS confirmation dialog before writing. Returns true if the user confirmed and the change was written (restart required to take effect), false if cancelled.

      Parameters

      • enabled: boolean

      Returns Promise<boolean>

    • Requests enabling/disabling LAN access. When enabled, the desktop binds its TCP listener to all interfaces (instead of loopback) so other devices can reach it — e.g. to sync from another device. Same confirmation + restart flow as above.

      Parameters

      • enabled: boolean

      Returns Promise<boolean>

    • Requests a change to the SQL console setting. Same flow as above.

      Parameters

      • enabled: boolean

      Returns Promise<boolean>