mcp-use TypeScript API
    Preparing search index...

    Function useDeepLink

    • Read the incoming ChatGPT deep link through the view's existing connection.

      Reads the initial openai/deepLink host context after initialization and updates when the host sends a new URL. Returns undefined before the host supplies a link or when the host does not support deep links. Route parsing, authorization, and local navigation remain the application's responsibility. Older host path / query payloads are normalized to the same URL shape.

      The subscription is cleaned up when the component unmounts. This hook does not create another connection or send local navigation back to the host.

      Returns DeepLinkHandle

      The latest incoming app-relative URL.

      function Browser() {
      const { url } = useDeepLink();
      return <Route path={url ?? "/"} />;
      }