Create a Phoenix client.

The client is strongly typed and uses generated openapi types.

import { createClient } from "@arize/phoenix-client";

const client = createClient();

const response = await client.GET("/v1/traces");
// ^ path string is strongly typed, and completion works with autocomplete
// path parameters, query parameters, and request body are also strongly typed based on the openapi spec,
// the path, and the method.
  • Parameters

    • config: {
          getEnvironmentOptions?: () => Partial<ClientOptions>;
          options?: Partial<ClientOptions>;
      } = {}

      The configuration to use for the client.

      • OptionalgetEnvironmentOptions?: () => Partial<ClientOptions>

        The function to use to get the environment options. By default, a function that returns process.env is used.

      • Optionaloptions?: Partial<ClientOptions>

        The options to use for openapi-fetch.createOpenApiClient.

    Returns Client<paths, `${string}/${string}`>

    The Phoenix client as a strongly typed openapi-fetch client.