Selva Compute API Reference - v1.5.1
    Preparing search index...

    Function fetchRhinoCompute

    • Generic Rhino Compute fetch function. Sends a POST request to any Compute endpoint with pre-prepared arguments.

      Use this for advanced, low-level control over compute requests. For most use cases, prefer higher-level APIs.

      Type Parameters

      • E extends string

        The endpoint name (e.g., 'grasshopper', 'io'). Determines the response type for better type safety.

      Parameters

      • endpoint: E

        The Compute API endpoint (e.g., 'grasshopper', 'io', 'mesh').

      • args: Record<string, any>

        Pre-prepared arguments for the request body.

      • config: ComputeConfig | GrasshopperComputeConfig

        Compute configuration (server URL, API key, timeout, debug, retry, signal).

      Returns Promise<ComputeResponseFor<E>>

      The parsed JSON response from the server, typed according to the endpoint.

      // Basic usage for the Grasshopper endpoint:
      const response = await fetchRhinoCompute(
      'grasshopper',
      { ... },
      {
      serverUrl: 'https://my-server.com',
      debug: true,
      timeoutMs: 30_000,
      retry: { attempts: 2 },
      signal: controller.signal,
      }
      );