Skip to main content

Functions

createClient()

Defined in: lib/chatApi.ts:12 Factory function to create and configure a LangGraph SDK Client. Automatically resolves the endpoint URL:
  • Reads NEXT_PUBLIC_LANGGRAPH_API_URL env variable.
  • In browser context, falls back to appending /api to the window location (proxied via Next.js passthrough).
  • Otherwise defaults to /api.

Returns

Client<DefaultValues, DefaultValues, unknown> An instance of the LangGraph SDK Client.