Documentation
    Preparing search index...

    Function routeServiceMessage

    • Route a NappletMessage envelope to the matching service handler.

      Direct NAP-domain services are routed by the domain in their wire message.type (e.g., 'notify.send' -> 'notify' service). INC messages are owned by the INC runtime; their topic values are opaque here.

      This low-level selection primitive performs no source, domain, ACL, messageCapabilities, or firewall checks. Never call it as a fallback for untrusted input; host ingress must use Runtime.handleMessage. 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 }