Selva Compute API Reference - v2.1.0
    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.

      The transport is response-type-agnostic: it does not know which response a given endpoint returns. Callers supply the response type via R (defaulting to unknown, which forces an explicit narrowing before use).

      Type Parameters

      • R = unknown

        The expected response shape. The caller names it at the call site.

      Parameters

      • endpoint: string

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

      • args: Record<string, any>

        Pre-prepared arguments for the request body.

      • config: ComputeConfig

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

      Returns Promise<R>

      The parsed JSON response from the server, typed as R.

      // 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,
      }
      );