Documentation
    Preparing search index...

    Function routeServiceMessage

    • Route a NappletMessage envelope to the matching service handler.

      NAP-domain services are routed by the domain prefix of message.type (e.g., 'signer.signEvent' -> 'signer' service).

      INC-routed services receive inc.emit messages and are routed by the topic prefix before ':' (e.g., topic 'audio:play' -> 'audio' service).

      Returns true if a service handled the message, false otherwise.

      Parameters

      • windowId: string

        The napplet window that sent the message

      • message: NappletMessage

        The NappletMessage envelope to route

      • services: ServiceRegistry

        The service registry to look up handlers

      • sendToNapplet: SendToNapplet

        Callback to send messages back to the napplet

      Returns boolean

      true if a service handled the message, false if no matching service

      const handled = routeServiceMessage(windowId, msg, services, sendToNapplet);
      if (!handled) { // fallback handling }