Documentation
    Preparing search index...

    Interface ShellAdapter

    All adapters that the shell requires from the host application.

    const hooks: ShellAdapter = {
    relayPool: myRelayPoolHooks,
    relayConfig: myRelayConfigHooks,
    windowManager: myWindowManagerHooks,
    auth: myAuthHooks,
    config: myConfigHooks,
    hotkeys: myHotkeyHooks,
    workerRelay: myWorkerRelayHooks,
    crypto: myCryptoHooks,
    };
    interface ShellAdapter {
        auth: AuthHooks;
        ble?: BleHooks;
        capabilities?: CapabilityHooks;
        common?: CommonHooks;
        config: ConfigHooks;
        crypto: CryptoHooks;
        dm?: DmHooks;
        hotkeys: HotkeyHooks;
        intent?: IntentHooks;
        link?: LinkHooks;
        lists?: ListsHooks;
        onAclCheck?: (event: AclCheckEvent) => void;
        onHashMismatch?: (dTag: string, claimed: string, computed: string) => void;
        onNip5dIframeCreate?: (
            windowId: string,
        ) => { aggregateHash: string; dTag: string } | null;
        onUnroutedMessage?: (info: UnroutedMessageInfo) => void;
        relayConfig: RelayConfigHooks;
        relayPool: RelayPoolHooks;
        serial?: SerialHooks;
        services?: ServiceRegistry;
        upload?: UploadHooks;
        webrtc?: WebrtcHooks;
        windowManager: WindowManagerHooks;
        workerRelay: WorkerRelayHooks;
        getConfigOverrides?(): RuntimeConfigOverrides;
    }
    Index

    Properties

    auth: AuthHooks
    ble?: BleHooks

    Optional shell-mediated BLE backend (NAP-BLE). When present and isAvailable() is true, the shell advertises ble. The host still registers the concrete service via registerService('ble').

    capabilities?: CapabilityHooks

    Optional capability advertisement override. Omitted by production hosts.

    common?: CommonHooks

    Optional shell-mediated common social backend (NAP-COMMON). When present and isAvailable() is true, the shell advertises common. The host still registers the concrete service via registerService('common').

    config: ConfigHooks
    crypto: CryptoHooks
    dm?: DmHooks
    hotkeys: HotkeyHooks
    intent?: IntentHooks

    Optional archetype intent dispatcher (NAP-INTENT). When present and isAvailable() is true, the shell advertises the intent domain so napplets can call window.napplet.intent. The host still registers the concrete service via registerService('intent').

    link?: LinkHooks

    Optional shell-mediated link backend (NAP-LINK). When present and isAvailable() is true, the shell advertises link. The host still registers the concrete service via registerService('link').

    lists?: ListsHooks

    Optional shell-mediated NIP-51 list backend (NAP-LISTS). When present and isAvailable() is true, the shell advertises lists. The host still registers the concrete service via registerService('lists').

    onAclCheck?: (event: AclCheckEvent) => void

    Called on every ACL enforcement check. Both allows and denials are reported.

    onHashMismatch?: (dTag: string, claimed: string, computed: string) => void

    Called when aggregate hash verification fails (computed != declared).

    onNip5dIframeCreate?: (
        windowId: string,
    ) => { aggregateHash: string; dTag: string } | null

    Called at iframe creation for NIP-5D napplets. Returns identity metadata for originRegistry.register(). Returning null means "not NIP-5D / skip registration".

    onUnroutedMessage?: (info: UnroutedMessageInfo) => void

    Called when ShellBridge.handleMessage drops an incoming postMessage because it cannot be routed to a registered napplet window (no source window, or the source Window is not in originRegistry). Observe-only — the message is still dropped; this hook exists so otherwise-silent drops are diagnosable (the FEED-02 / hyprgate#21 class of "a napplet's messages vanish" bug).

    relayConfig: RelayConfigHooks
    relayPool: RelayPoolHooks
    serial?: SerialHooks

    Optional shell-mediated serial backend (NAP-SERIAL). When present and isAvailable() is true, the shell advertises serial. The host still registers the concrete service via registerService('serial').

    services?: ServiceRegistry

    Optional service extensions. Each key is a service name (e.g., 'audio', 'notifications'). Napplets discover available services via kind 29010 service discovery events.

    const hooks: ShellAdapter = {
    // ... required adapters ...
    services: {
    audio: myAudioServiceHandler,
    notifications: myNotificationServiceHandler,
    },
    };
    upload?: UploadHooks

    Optional shell-mediated upload backend (NAP-UPLOAD). When present, the shell advertises the upload domain so napplets can call window.napplet.upload. The host still registers the concrete service via registerService('upload').

    webrtc?: WebrtcHooks

    Optional shell-mediated WebRTC backend (NAP-WEBRTC). When present and isAvailable() is true, the shell advertises webrtc. The host still registers the concrete service via registerService('webrtc').

    windowManager: WindowManagerHooks
    workerRelay: WorkerRelayHooks

    Methods

    • Optional runtime behavior overrides — demo/debug use only. Called lazily on each relevant operation (replay check, buffer push), so changes take effect immediately without runtime recreation.

      Returns RuntimeConfigOverrides