Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion libs/angular/src/lib/transport/fetch-stream.transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ export class FetchStreamTransport implements AgentTransport {
* @param onThreadId - Optional callback invoked when a new thread is created
*/
constructor(apiUrl: string, onThreadId?: (id: string) => void) {
this.client = new Client({ apiUrl });
// Normalize relative paths (e.g. '/api') to absolute URLs.
// The LangGraph SDK Client requires an absolute URL, but production
// environments use relative paths that are proxied by Vercel middleware.
const absoluteUrl = apiUrl.startsWith('http://') || apiUrl.startsWith('https://')
? apiUrl
: typeof window !== 'undefined'
? `${window.location.origin}${apiUrl}`
: apiUrl;
this.client = new Client({ apiUrl: absoluteUrl });
this.onThreadId = onThreadId;
}

Expand Down