langgraph server - generative UI custom-authentication Failing for entrypoint.js and entrypoint.css #308

Closed
opened 2026-02-15 18:15:45 -05:00 by yindo · 1 comment
Owner

Originally created by @dileep-veya on GitHub (Jul 21, 2025).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph.js documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph.js rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package).

Example Code

The Problem is langraph-sdk not including bearer token for assets fetching hence getting 401 error. custom authentication for api is working fine.

SDK Client creation

import { Client } from '@langchain/langgraph-sdk';
import { env } from '~/env';

export function createClient({ auth_token }: { auth_token: string }) {
  const client = new Client({
    apiUrl: env.NEXT_PUBLIC_LANGGRAPH_API_URL,
    defaultHeaders: { Authorization: `Bearer ${auth_token}` },
  });
  return client;
}

useStream initialisation

  const streamValue = useTypedStream({
    apiUrl,
    defaultHeaders: {
      "authorization": jwtToken
    },
    assistantId,
    threadId: threadId ?? null,
    onFinish(state) {
      if (state.values.promptSuggestions) {
        setPromptSuggestions(state.values.promptSuggestions);
      }
    },
    onCustomEvent: (event, options) => {
      if (isUIMessage(event) || isRemoveUIMessage(event)) {
        options.mutate((prev) => {
          const ui = uiMessageReducer(prev.ui ?? [], event);
          return { ...prev, ui };
        });
      }
    },
    onThreadId: (id) => {
      setThreadId(id);
      // Refetch threads list when thread ID changes.
      // Wait for some seconds before fetching so we're able to get the new thread that was created.
      sleep().then(() => refetch());
    },
  });

Error Message and Stack Trace (if applicable)

Image Image

Description

  • SDK not including bearer token for frontend javascript assets like entrypoint.css, entrypoint.js.

System Info

system : Ubuntu
browser : chrome

langraph package versions :

"@langchain/langgraph-sdk": "^0.0.99",
"@langchain/core": "^0.3.66",
"@langchain/langgraph": "^0.3.10",

Originally created by @dileep-veya on GitHub (Jul 21, 2025). ### Checked other resources - [x] I added a very descriptive title to this issue. - [x] I searched the LangGraph.js documentation with the integrated search. - [x] I used the GitHub search to find a similar question and didn't find it. - [x] I am sure that this is a bug in LangGraph.js rather than my code. - [x] The bug is not resolved by updating to the latest stable version of LangGraph (or the specific integration package). ### Example Code The Problem is langraph-sdk not including bearer token for assets fetching hence getting 401 error. custom authentication for api is working fine. SDK Client creation ``` import { Client } from '@langchain/langgraph-sdk'; import { env } from '~/env'; export function createClient({ auth_token }: { auth_token: string }) { const client = new Client({ apiUrl: env.NEXT_PUBLIC_LANGGRAPH_API_URL, defaultHeaders: { Authorization: `Bearer ${auth_token}` }, }); return client; } ``` useStream initialisation ``` const streamValue = useTypedStream({ apiUrl, defaultHeaders: { "authorization": jwtToken }, assistantId, threadId: threadId ?? null, onFinish(state) { if (state.values.promptSuggestions) { setPromptSuggestions(state.values.promptSuggestions); } }, onCustomEvent: (event, options) => { if (isUIMessage(event) || isRemoveUIMessage(event)) { options.mutate((prev) => { const ui = uiMessageReducer(prev.ui ?? [], event); return { ...prev, ui }; }); } }, onThreadId: (id) => { setThreadId(id); // Refetch threads list when thread ID changes. // Wait for some seconds before fetching so we're able to get the new thread that was created. sleep().then(() => refetch()); }, }); ``` ### Error Message and Stack Trace (if applicable) <img width="1330" height="1067" alt="Image" src="https://github.com/user-attachments/assets/efffa9fd-363a-445e-b529-b344b78d7044" /> <img width="1330" height="1067" alt="Image" src="https://github.com/user-attachments/assets/36330e4b-676f-457a-9aea-ae7b933d6246" /> ### Description - SDK not including bearer token for frontend javascript assets like entrypoint.css, entrypoint.js. ### System Info system : Ubuntu browser : chrome langraph package versions : "@langchain/langgraph-sdk": "^0.0.99", "@langchain/core": "^0.3.66", "@langchain/langgraph": "^0.3.10",
yindo closed this issue 2026-02-15 18:15:45 -05:00
Author
Owner

@dileep-veya commented on GitHub (Jul 23, 2025):

we are going for prod this weekend please some one point to the right documentation or guide.

@dileep-veya commented on GitHub (Jul 23, 2025): we are going for prod this weekend please some one point to the right documentation or guide.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#308