# Function combineUrlPath

- combineUrlPath(
  endpoint: string,
  path: string,
  queryParams?: Record<string, string | undefined>,
  ): string

  Properly combines a base URL endpoint with a path, preserving any base path in the endpoint.

  #### Parameters

  - endpoint: string

    The base URL endpoint that may contain a path component

  - path: string

    The path to append to the endpoint (may include query parameters)

  - `Optional` queryParams: Record<string, string | undefined>

    Optional additional query parameters to append

  #### Returns string

  The properly combined URL string

  #### Example

      combineUrlPath("http://localhost:8787/rivet", "/actors/action")
      // Returns: "http://localhost:8787/rivet/actors/action"

  #### Example

      combineUrlPath("http://localhost:8787/rivet", "/actors?type=foo", { namespace: "test" })
      // Returns: "http://localhost:8787/rivet/actors?type=foo&namespace=test"

  - Defined in rivetkit-typescript/packages/rivetkit/src/utils.ts:225